Repository navigation
Refuse extraction records that squash or rebase merges dropped from main - #4
Merged
Merged
Conversation
The extraction script checked only that the recorded extracted commit is an ancestor of the new extraction, inside the output directory. It never checked the collector checkout that will merge the output. The repo settings and the main ruleset allow squash and rebase merges, and either one lands a carry-over pull request's changes and updated record on main under new commits, without the extracted commits themselves. A re-run then exited 0 and listed nothing new, yet merging its output added the carried-over commits a second time. When a record exists, the script now requires the current directory to be a git work tree whose HEAD contains the recorded extracted commit, and refuses before creating the output directory or rewriting the record otherwise. The message says carry-over pull requests must be merged with a merge commit, and the README documents the rule and a recovery (an `ours` merge of the squashed pull request's original head). The extraction tests now build calibration-diagnostics look-alikes whose collector changes arrive through merge commits, both kinds the filter produces (merges it prunes and merges it keeps), and land carry-over branches on main by merge commit, squash and rebase. Re-run tests run from a collector checkout, as the README does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI runs `bash tools/check-quality.sh`, which runs both Ruff checks and syntax-checks every script in tools/ and scripts/. The README still listed the two Ruff commands, so a developer following it skipped the shell syntax checks that CI enforces. A test now requires every command in the README's Tests block to be one that the validation workflow runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README listed the Workload Identity provider and the environment secrets and variables as preconditions still to meet. They are provisioned: both environments hold the 15 TELEMETRY_* variables and the 2 identifier secrets, and the microcosm-collector provider and the deployment service account's binding exist. The section now says so and lists only what remains, in order: carry over outstanding telemetry-service changes, stop calibration-diagnostics deploying the service, then set COLLECTOR_DEPLOY_ENABLED. The README and the Push workflow's header comment also said the `github.event_name == 'push' && github.ref == 'refs/heads/main'` condition makes tag, pull request and other-branch runs skip deployment. The Push workflow runs only for pushes to main, so the condition is always true and only guards against a later change to its triggers. Both now say that. The released 0.2.0 changelog entry is left as published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the Orrery projection (#9) and the 0.3.0 release. No conflicts; none of main's new commits touch the extraction tool, its tests or the push workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
pushed a commit
that referenced
this pull request
Oct 27, 2026
Brings in #6 (the submission contract, released as 0.4.0), #4, #11 and #23. No conflicts: README.md, pyproject.toml and uv.lock merged automatically, and the consumed fragment changelog.d/artifact-submission-contract.added.md is removed, leaving only this branch's artifact-intake.added.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #3
tools/extract-from-calibration-diagnostics.shexited 0 after a carry-over pull request had been squash-merged or rebase-merged, although merging its output then adds the carried-over commits a second time. This PR makes it refuse that case and documents that carry-over pull requests must be merged with a merge commit. It also corrects three README and workflow-comment inaccuracies from the same post-merge review of #2. Merging releases 0.3.1 (onefixedfragment;mainreleased 0.3.0 with #9 after this PR was opened). Deployment stays off.The bug and the fix
The script only checked
git merge-base --is-ancestor <recorded extracted_commit> <new extraction>inside the output directory. A squash or rebase merge puts a carry-over's changes and updatedtools/extraction-source.envonmainunder new commits, somainno longer contains the recorded extracted commit. Nothing checked that.When a record exists, the script now requires the current directory to be a git work tree whose
HEADcontains the recorded extracted commit. It checks this before creating the output directory or rewriting the record. If the check fails, it exits 1 and says that carry-over pull requests must be merged with a merge commit. The README's carry-over section now states the rule and a recovery: merge the squashed pull request's original head (pull/<number>/head) into the next carry-over branch withgit merge -s ours, which records those commits as merged without changing any file. A test covers that recovery.The tests now use merge-commit topology, as calibration-diagnostics does. git-filter-repo (
--prune-degenerate auto) keeps a pull request's merge commit when the branch was up to date with main, and prunes it when main moved on meanwhile. The fixtures produce both cases. Re-run tests run from a collector checkout fixture: the first extraction's history plus a commit that adds the record, as #2 did. Carry-over branches land onmainby merge commit, squash or rebase, the way GitHub's merge methods do.Commits
tests/test_extraction.py: 4 failed, 9 passed. The squash and rebase cases exited 0 with an empty "New since the last extraction" list, as in the reproduction. A record naming an unknown commit got the old message after the output directory was created. Running outside a git work tree exited 0.tests/test_quality_check.py: 1 failed, 3 passed (bash tools/check-quality.shmissing from the README's Tests block)test_deployment_workflow.py,test_release_workflow.py,test_quality_check.py): 24 passedmaininto this branchmain's new commits (#9's Orrery projection and the 0.3.0 release) touch none of this PR's files exceptREADME.md, where git merged the two changes in separate sections.tests/test_extraction.pyandtests/test_quality_check.py: 17 passed.bash tools/check-quality.shpassed;bash tools/check-changelog.sh: 0.3.0 -> 0.3.1The merge-topology re-run test and the recovery test passed before the fix too. They guard the merge-commit path, which the old tests did not exercise. Before the fix, in the squash fixture, a merge of the re-run's output would have added
Merge pull request #219,Document …,Test …andApply event batches incrementallyagain.Gates on each commit:
uv sync --locked --dev, the touched test files plustest_collector_uses_store_vocabulary,bash tools/check-quality.sh,bash tools/check-changelog.sh(0.2.0 -> 0.2.1), and shellcheck 0.11.0 ontools/*.shandscripts/*.sh. On the last commit, actionlint 1.7.12 too. CI runs the full suite.Other corrections
bash tools/check-quality.sh, which runs both Ruff checks andbash -novertools/andscripts/, instead of the two Ruff commands. A test now requires every command in that block to be one the validation workflow runs.telemetry-service/changes. Then stop calibration-diagnostics deploying the service throughtelemetry-service.yml. Then setCOLLECTOR_DEPLOY_ENABLED.github.event_name == 'push' && github.ref == 'refs/heads/main'condition is always true, because the Push workflow runs only for pushes tomain. It guards only against a later trigger change. The released 0.2.0 changelog entry is unchanged.Environment variables (push.yaml changed: comments only)
No variable, secret, trigger or condition changed. For completeness, here is everything
.github/workflows/push.yamlreads. I checked names only, read-only, and printed no values.TELEMETRY_GCP_PROJECT_ID,TELEMETRY_GCP_REGION,TELEMETRY_ARTIFACT_REGISTRY_NAME,TELEMETRY_CLOUD_SQL_CONNECTION,TELEMETRY_RUNTIME_SERVICE_ACCOUNT,TELEMETRY_MIGRATION_SERVICE_ACCOUNT,TELEMETRY_SERVICE,TELEMETRY_MIGRATION_JOB,TELEMETRY_IMAGE_NAME,TELEMETRY_DATABASE_SECRET_NAME,TELEMETRY_MIGRATION_DATABASE_SECRET_NAME,TELEMETRY_JWT_SECRET_NAME,TELEMETRY_READ_SECRET_NAME,TELEMETRY_PRODUCTION_CLOUD_SQL_CONNECTION,TELEMETRY_PRODUCTION_SERVICEstaging,production)env:throughvars.*indeploy-staginganddeploy-production, which declareenvironment: staging/productionTELEMETRY_GCP_WIF_PROVIDER,TELEMETRY_GCP_DEPLOY_SERVICE_ACCOUNTstaging,production)with:ofgoogle-github-actions/authin both deployment jobsCOLLECTOR_DEPLOY_ENABLEDif:of both deployment jobsAPP_ID,APP_PRIVATE_KEYwith:ofactions/create-github-app-tokeninversioningDEPLOYMENT_ENVIRONMENT;IMAGE_URI,REVISIONenv:; stepenv:Unverified by me: the
microcosm-collectorWorkload Identity provider's attribute condition and the deployment service account'sroles/iam.workloadIdentityUserbinding. Reading them needs gcloud reauthentication, which is not possible non-interactively. They were verified read-only when #2 was provisioned. I also did not re-check that the variable values still equal calibration-diagnostics' values.Merge methods (now enforced in the repository settings)
When this PR was opened, the repo settings and the "Protect main" ruleset still allowed squash and rebase merges. They have since been changed outside this PR. Checked read-only on 2026-10-20:
allow_merge_commit: true,allow_squash_merge: false,allow_rebase_merge: false;allowed_merge_methods: [merge].So GitHub now refuses to squash or rebase any pull request into
main, carry-overs included. The script's check still matters: it catches a record that is not inHEAD's history for any other reason, such as running the script from a checkout other thanmainor a branch created from it, or a future change to these settings. This PR itself changes no settings or rulesets.Status (2026-10-20)
56aaeae:main(eac60d4, 0.3.0) merged in with a merge commit, because the branch was 5 commits behind. No conflicts.56aaeae: Lint workflows, Check changelog fragment, verify / Test, lint, and build, and Required checks all passed.telemetry-service/(calibration-diagnostics#219), with a merge commit, the only method the repo now allows. Merging releases 0.3.1; withCOLLECTOR_DEPLOY_ENABLEDunset, nothing deploys.🤖 Generated with Claude Code