Commit 92a351f
committed
Gate BMF payload versions per project
Each project now declares the highest BMF payload version it accepts. The field is
`bmf_version` on the project, it defaults to 0 everywhere, and it is visible to
everyone that can see the project. Only a server admin can move it: a PATCH that
carries the field from anyone else is forbidden, and a PATCH that does not carry it
is the patch it has always been. The gate is a plain setting, so an admin can lower
it again just as easily.
The gate is a maximum, not an exact match. A project at version 1 still ingests a
payload that declares version 0 and a payload that declares nothing at all, so
raising the gate refuses nothing that ingested before it moved.
Ingest checks the gate twice, once for each way a payload states its version, and
both refusals are the same class and name both versions, the payload's and the
project's. The `bmf_version` key a payload declares is checked before anything is
created for the report, because later layers hang payload shapes off the declared
version and none of them should reach a project that does not accept them. The
version the results actually parsed as is checked after parsing, because a payload
can reach a v1 leaf without declaring anything: the `json_v1` adapter names the leaf
outright, and the `magic` and `json` nodes fall back to it. Without the second check
the gate would be decorative.
That second check is a deliberate behavior change for those two undeclared paths on
a project still at version 0. They are not a documented way to send v1 results, and
a gate a payload can walk around is not a gate.
Report ingest, `/v0/run`, and a job based run share one check rather than three
copies of it. A job declares nothing, since its results are the runner's own output
rather than a submitted payload, but the project gate still applies to what those
results parse as.1 parent 478de4f commit 92a351f
28 files changed
Lines changed: 1027 additions & 64 deletions
File tree
- lib
- api_projects
- src
- tests
- api_run/tests
- bencher_adapter/src/results
- bencher_api_tests/src
- bencher_comment/src
- bencher_json/src/project
- bencher_plot
- bencher_schema
- migrations/2026-08-26-120000_project_bmf_version
- src
- model
- project
- report
- results
- runner
- bencher_valid/src
- services
- api
- cli/src/bencher/sub/project/project
- console/src/types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| |||
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
324 | 335 | | |
325 | 336 | | |
326 | 337 | | |
| |||
0 commit comments