Skip to content

Clean up validation - #942

Merged
AlexanderKaran merged 11 commits into
mainfrom
clean-up-validation
Nov 25, 2026
Merged

AlexanderKaran merged 11 commits into
mainfrom
clean-up-validation

Conversation

@AlexanderKaran

Copy link
Copy Markdown
Collaborator

The final PR, which builds on #938

As each benchmark runs in the CI, it saves its output to a temporary JSON file, and these are merged at the end. Now that everything is using the same schema, we can simplify the validation.

Now the process is:

  • First job runs and grabs the Chrome version and other stuff needed for the start of the schema, like so:
  framework: z.enum(
    FrameworkOptions.filter((option) => option !== 'baseline-html'),
  ),
  timingMeasuredAt: z.iso.datetime(),
  projects: z.record(z.enum(FrameworkProjectOptions), Project),
  runner: z.string(),
  browserVersion: z.string(),
  frameworkVersion: z.string(),
  frameworkReleasedAt: z.string().min(1),
  • Then each benchmark runs, validates its output against its benchmark schema plus any extras, like making sure iteration numbers match.
  • Uploads to tempory file
  • FInal step merges all tempory files and then runs one final validation agains the schema

Got to nuke so much unnecessary repeated validation by using the same schema, and this also opens up more sharing between benchmarks for expanding our suite of benchmarks.

Also one other little tweaks I changed it to each benchmark saves into its own tempoery JSON file rather than one big one to stop multiple runs overwritting each other locally when running them.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
framework-performance 0f7180d Commit Preview URL

Branch Preview URL
Nov 25 2026, 04:34 AM

@dreyfus92 dreyfus92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice cleanup alex, lgtm!

one question tho, save-ci-stats now accepts missing benchmark files, so if one doesn't come back it just disappears from latest.json and validate won't flag it. was that on purpose? a quick "every configured measurement has a file" check would keep it

also noticed that an invalid file now shows up as a zod error on the merged result, so we lose which file it came from

dreyfus92
dreyfus92 previously approved these changes Nov 24, 2026
@AlexanderKaran

Copy link
Copy Markdown
Collaborator Author

nice cleanup alex, lgtm!

one question tho, save-ci-stats now accepts missing benchmark files, so if one doesn't come back it just disappears from latest.json and validate won't flag it. was that on purpose? a quick "every configured measurement has a file" check would keep it

also noticed that an invalid file now shows up as a zod error on the merged result, so we lose which file it came from

So for point 2 I made a slight tweak so you will get the file name now on merge.

For point 1 I am going to have a simple check but I want to mess with the packages/results/src/frameworks-config.ts to do it. There is two measurment arrays in here. I want just one that then checks the keys exists :)

dreyfus92
dreyfus92 previously approved these changes Nov 25, 2026

@dreyfus92 dreyfus92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense! thanks again!

@AlexanderKaran
AlexanderKaran merged commit e15eaad into main Nov 25, 2026
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants