Repository navigation
ci: re-record generated baselines on the ci:rebaseline label - #2122
Merged
Merged
Conversation
Two pull requests that both re-record a generated baseline conflict as soon as the first merges; the second then re-merged develop, took develop's side of the generated file, re-ran the recorders and restated the figures by hand. The ci:rebaseline label now does that cycle in one workflow run: merge origin/develop, take develop's side of a conflict confined to the listed generated paths (any other conflict fails), run every recorder, refuse a movement the merge does not explain, commit with the movement in the message, push, remove the label and comment the movement for adjudication. scripts/rebaseline-movement.py attributes each moved record to the side that moved it against the merge base; a record neither side moved that the fresh run moves is unexplained and stops the run. The training expectation is never re-recorded; a recorder changing it fails the run. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…nt check parse_census and parse_apijson keyed the rules and the scorecard rows only, so a root figure the fresh run moved (oursRefused, pilotFailed, a root's file count) passed the movement check unattributed. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…gh the environment, never take develop's side of a source fixture A pull request in conflict with develop gets no pull_request run, so the label could not start the workflow for the case it exists for; the branch name reached the shell by expression interpolation; and the golden directories hold the .sysml/.kerml/.ttl sources beside the goldens, which the merge would have taken develop's side of. Comments trimmed to two lines. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
There was a problem hiding this comment.
Devin Review found 6 findings. Devin automatically fixed all 6 findings.
Fixed by Devin (6)
- Conflicted pull requests cannot start rebaseline — The workflow now triggers on pull_request_target labeled, which GitHub runs for a conflicted pull request too; the same label and same-repository guards apply, and the hygiene test pins the trigger.
- Fixture conflicts erase branch source models — Under the golden directories only *.golden, .golden. and *.sha256 count as generated; a conflicting .sysml/.kerml/.ttl source fixture fails the merge step, and a recorder changing one fails the change check (hygiene test asserts both).
- Changed baseline metrics bypass movement checks — parse_census and parse_apijson now key every root's full metadata (all fields but name/rules) as a record, so a moved oursRefused, pilotFailed or file count is attributed like any other record.
- Workflow header exceeds comment length limit — Header cut to two lines; the cycle it replaces is described in CONTRIBUTING.md instead.
- Generated-path comment exceeds length limit — Comment cut to two lines, as every other comment in the workflow.
- Branch names execute commands during merging — The branch name now reaches the merge step through the BRANCH environment variable, never by expression interpolation into the shell.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Merged
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Two pull requests that both re-record a generated baseline conflict as soon as the first merges. The second then re-merges
develop, takesdevelop's side of the generated file, re-runs the recorders (pilot-apijson-diff -updatealone is about an hour), restates the figures and re-runs CI — for a PR that was otherwise ready. This makes that cycle a one-label operation..github/workflows/rebaseline.ymlruns onpull_requestlabeled, guarded ongithub.event.label.name == 'ci:rebaseline'and on the head being a branch of this repository (head.repo.full_name == github.repository), and:origin/developwith--no-ff; a conflict confined to the generated paths listed inGENERATED_PATHStakesdevelop's side (git checkout --theirs, or the deletion), any other conflicting file fails the run and names the files;grpcio-tools==1.83.0(the version the committed stubs record), Node 24,bufby digest, the pinned pilot exporter, the corpora through.github/actions/corporaand the PSSM suite through its download script;make stdlib-snapshot,make proto-buf proto-ts proto-rust python-proto,pilot-apijson-diff -update,derived-census -update, the corpus gates with-update-pilot-corpora -update-spec-examples -update-pssm-migration -update-corpus-roundtrip -update-api-json-roundtrip,-update-structure-differential,-update-library-prefix-sweep,tests/export -update(goldens and.sha256digests),tests/parser -run TestGolden -update, thenmake docs-counts;tests/corpus/testdata/training_examples_expected.txtchanged — it is asserted clean, never re-recorded, and no step passes-update-training;scripts/rebaseline-movement.py(new): for every generated path it reads the records at the merge base, the PR head,developand the merge commit, keys them the way each recorder writes them (verdict per corpus path, counts per root and property for the structure differential, per probe for the sweep, per root and rule for the derived census, per scorecard row and root for the api-json baseline, blob per golden), and classifies every record the fresh run moved against the merged tree: moved by this branch, bydevelop, by both (the merge's verdict, to adjudicate), or unexplained — a record neither side moved, or one a single side moved whose fresh value is not that side's. One unexplained movement stops the run before anything is committed;always()), and comments the same summary — or the failure — for adjudication (always()).concurrencyis per pull request without cancellation,permissionsarecontents: readat the top andcontents: write/pull-requests: writeon the job only.Token. The checkout and push use
secrets.REBASELINE_TOKENwhen the repository defines it, elsegithub.token. Withgithub.tokenGitHub starts nopull_requestrun for the pushed head (events a workflow's own token raises do not trigger workflows), so the re-recorded head gets CI only on the next push or through a token withcontents: write; the workflow header and CONTRIBUTING.md say so. Whether to add a PAT is a maintainer decision.The generated paths deliberately exclude
docs/project/pilot-{differential,xpect,rejection}-baseline.json: this workflow does not run those recorders (they need the Java validators and take a scheduled run), so a conflict there stays a hand-resolved one rather than silently takingdevelop's side.docs/project/api-json-differential(the fragment directory #2084 introduces) is listed so the allowlist is right whichever lands first; a path absent from every revision is skipped.Documented in CONTRIBUTING.md (documentation conventions, beside the baseline guidance) and AGENTS.md §6.2.
How it was verified
python3 scripts/rebaseline-movement-test.py: 8 tests — attribution of each side's movement, an interaction neither side made (exit 1, the record named), a regenerated golden reported not attributed, the training expectation refused, every parser keyed the way its recorder writes, the summary file; the repository tests build a real git repository with a merge base, two sides and their merge. Registered inmake scripts-coverageand the PR docs job.go test ./tests/hygienewith the newtests/hygiene/rebaseline_workflow_test.go: the trigger islabeledalone, the job guards on the label and the same-repository head, the permissions split, the allowlist names the baselines and never the training expectation, every recorder is run, no step passes-update-training, no recorder runs after the movement check, no push before it, the label removal and the comment runalways(), the corpora come from.github/actions/corpora.go build ./...,go vet ./...,gofmt -lempty,make lint.develop, labelledci:rebaseline; that run is held until the merge coordinator releases the runners, and the run link will be added here.Checklist
make testandmake lintpass locally (lint, hygiene, the script's tests; the full race suite runs in CI)Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/db2463db486544eb9f5b9e5a8389e7c3
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/db2463db486544eb9f5b9e5a8389e7c3?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work