Repository navigation
Conversation
The prepare step merged main into the open update PR's branch with
`-X theirs`. Merging generated uv.lock files line by line mixed two
resolutions, and uv refused the result ("Failed to parse uv.lock"), so
every run since at least 2026-10-10 failed at "Generate API clients".
The prepare step now checks out update-dependencies from origin/main on
every run and records the commit the remote branch points at. The push
step replaces the remote branch with --force-with-lease against that
commit, or creates it with a plain push when it does not exist. Neither
step asks gh about pull requests any more, so the prepare step no longer
gets GH_TOKEN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The push step now compares the rebuilt branch's files with the commit the remote branch points at and skips the push when they match; the commit message carries the date, so the commits themselves always differ. When the update changes no file on main, nothing is committed or pushed: pushing main's own commit would leave an open update PR with no changes. The step reports changes_detected, and the PR step runs whenever the update changed files on main, so an update PR is opened or kept current even when the push was skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each run now rebuilds the update branch from main, so the open update
PR's description said the wrong thing ("Subsequent runs append commits").
The create-PR step still reuses an open update PR, but now replaces its
whole description, "Fixes #N" first, whenever it differs from the
current one; before, it changed only the first line. The description
says that each run replaces the branch, so commits pushed by hand are
lost on the next run.
The open-PR lookup now ignores pull requests from forks whose branch is
also named update-dependencies, as the Public API's relock does, so the
step never rewrites a fork PR's description.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added this pull request to stack #891
October 21, 2026 21:26
The update PR's summary said the workflow "regenerates the API clients", which reads as if the PR contained client changes. The generated clients are not committed, so the PR changes only uv.lock files; the summary now says so. The workflow's comment on the PR step now says the step replaces an open PR's description, not only its first line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #889
Stacked on #862 (base
pr-description-check), whose create-PR step names a tracking issue on the first line of the update PR's description; that behaviour is kept.Problem
The daily
Update dependenciesworkflow has failed on all 24 runs from 2026-09-28 to 2026-10-21; the last successful run was 2026-09-27. Every run fails at "Generate API clients":With #583 open,
dependency-update-prepare-branch.shchecked outupdate-dependenciesand rangit merge --no-edit -X theirs origin/main, which merged all seven generateduv.lockfiles line by line. That mixes entries from two resolutions. Reproduced locally: the same merge oforigin/update-dependencies(d8a27a12) withorigin/main(07e3ec48) gives thecryptographyerror above inprojects/policyengine-simulation-entry, andDependency detect-installer has missing source field but has more than one matching packageinlibs/policyengine-fastapi.Changes
Following the approach of the Public API's relock (PolicyEngine/policyengine-api#3994):
main. The prepare step checks outupdate-dependenciesfromorigin/mainon every run and never merges. It records the commit the remote branch points at (git ls-remote) as theremote_headoutput. It no longer callsgh, so it no longer getsGH_TOKEN.--force-with-lease=refs/heads/update-dependencies:<remote_head>, so a push made to the branch during the run makes this push fail rather than be overwritten. When the branch does not exist, a plain push creates it.remote_head; the commit message carries the date, so files are compared, not commits. When the update changes no file onmain, nothing is committed or pushed; pushingmain's own commit would leave the open PR with no changes.changes_detected), even when the push was skipped. It reuses an open update PR and replaces its whole description,Fixes #Nfirst, when it differs; before, it changed only the first line. The description says each run replaces the branch, so commits pushed to it by hand are lost on the next run. The open-PR lookup ignores fork PRs whose branch has the same name.The workflow still runs
make update(uv lock --upgradein everylibs/*andprojects/*project) andgh pr create/gh pr edit, as #887'ssim.dependencies.scheduled-relockcheck expects. No file that only #887 changes is edited here.Commits (tests written first)
Tests are in
projects/policyengine-simulation-entry/tests/test_workflow_scripts.py, using the fakeghandgitofworkflow_script_support.FakeCommands.update-dependenciesand mergedorigin/main)Checks
ruff0.15.22format --checkandcheck(select = ["ALL"]): clean; no newnoqa.shellcheckon the three changed scripts: clean.python3 scripts/run_quality_guards.py: passed.python3 -m scripts.rules guard --base-ref origin/pr-description-check: passed.python3 -m scripts.rules render: no changes.sim.dependencies.scheduled-relockcheck (locked_installs.relock_violations), run on a copy ofuv-lock-ruleswith these four workflow files: no violations; itslocked-installsguard passed.Local run of the job's steps
On a detached
origin/main(07e3ec48), with these scripts and agitwrapper that recordedgit configandgit pushinstead of running them:remote_head=d8a27a12…;update-dependencieschecked out at07e3ec48, no merge../scripts/generate-clients.sh: succeeded.make update: succeeded.uv lock --checkin all eight projects: every lock parses and passes.uv.lockfiles;changes_detected=true,branch_pushed=true; the recorded push wasgit push --force-with-lease=refs/heads/update-dependencies:d8a27a12c22eb88e5fb7216ab5e37a3746c47239 origin HEAD:refs/heads/update-dependencies.Nothing was pushed.
Effect on #583 after merge
On the next scheduled run,
update-dependenciesis replaced by one commit on top ofmainwith that day's lock upgrades, so #583's diff becomes only those upgrades. #583 stays open; its description is replaced withFixes #Nand the new summary, where#Nis a new "Update dependencies" issue (none is open now).Secrets and permissions
APP_ID,APP_PRIVATE_KEY: organization Actions secrets (visibility: all repositories), passed toactions/create-github-app-token. The checkout step stores the App token, sogit ls-remote,git fetchandgit pushin the prepare and push steps use it; the PR step gets it asGH_TOKEN.GITHUB_REPOSITORY,GITHUB_OUTPUT: set by the runner for every step.REMOTE_HEAD: the prepare step'sremote_headoutput, passed through the push step'senv:.update-dependencies(GET /repos/{repo}/rules/branches/update-dependenciesis empty; the only ruleset,main, targets the default branch), so a force push with a lease is allowed. The App token last pushed to the branch on 2026-09-27 (d8a27a12).🤖 Generated with Claude Code