ci(update-models): sign commits with bot identity, add semantic catalog diff - #4110
Merged
Merged
Conversation
aheritier
marked this pull request as ready for review
September 2, 2026 07:13
trungutt
previously approved these changes
Sep 2, 2026
aheritier
marked this pull request as draft
September 2, 2026 09:20
This comment was marked as resolved.
This comment was marked as resolved.
aheritier
marked this pull request as ready for review
September 2, 2026 09:47
This comment was marked as resolved.
This comment was marked as resolved.
aheritier
commented
Sep 2, 2026
aheritier
commented
Sep 2, 2026
trungutt
previously approved these changes
Sep 2, 2026
aheritier
commented
Sep 2, 2026
Two independent improvements to the weekly models.dev snapshot refresh (.github/workflows/update-models.yml), which previously opened PRs with an unsigned commit attributed to whoever happened to trigger the run, and a static, uninformative PR body. Signed commits --------------- Add `sign-commits: true` to the existing `peter-evans/create-pull-request` step. This builds the commit through GitHub's API instead of a local `git push`, so it is Verified regardless of which token creates it. On the default `GITHUB_TOKEN` (used explicitly via `token: github.token` for clarity) the commit author/committer becomes `github-actions[bot]` consistently, rather than the human who happened to run the workflow. `persist-credentials: false` is set on checkout as a minor hardening measure, since `create-pull-request` is given its token explicitly and never needs checkout's persisted git credential. Semantic catalog diff, no AI ----------------------------- `pkg/modelsdev/snapshot.json` is a single-line, multi-megabyte JSON file, so its raw git diff is one useless line — this is why the PR body was static. Instead: - `.github/scripts/models-delta.jq` computes a structural added/removed/changed diff between two snapshot.json files. - `.github/scripts/models-delta-render.jq` renders that diff to markdown tables, with a `safe()`/`safe_diff()` sanitiser clamping every third-party (models.dev) string to a short, bounded, control-character-free charset before it reaches the PR body — that body is consumed by this repo's automated PR-review pipeline, so untrusted text needs bounding before it gets there. - `scripts/models-delta.sh` is the single wrapper around both jq scripts; a new `task models-delta` target and the workflow's "Compute catalog delta" step both call it, so the diff logic exists in exactly one place. With no arguments it diffs HEAD's pkg/modelsdev/snapshot.json against the working tree — the same comparison the workflow makes after `task update-models`, so the local and CI code paths never drift apart. - The workflow uses the rendered markdown as the PR body/title/commit subject. The delta step is `continue-on-error: true` with a static-body fallback step, so a jq/shell bug degrades the PR text instead of silently skipping the weekly refresh. A refresh still opens a PR even when only snapshot_date.txt changed (no catalog content diff), preserving today's behaviour and avoiding any interaction with the check-models-fresh staleness test. - `scripts/models-delta-test.sh` is a golden-fixture regression test for the two jq scripts (fixtures under .github/scripts/testdata/), since they have no Go-test equivalent and only run for real, unattended, once a week. `.github/workflows/models-delta-lint.yml` runs it (plus shellcheck) as its own path-filtered workflow — mirrors the repo's existing docs-lint.yml pattern — rather than unconditionally on every PR via ci.yml's blanket lint job. - A concurrency group and a canonical-repo job guard prevent an overlapping workflow_dispatch from racing the weekly schedule run. Phase 3 of the original proposal (an LLM-written PR summary via docker/docker-agent-action) is deferred to a future change.
aheritier
force-pushed
the
chore/update-models-workflow-signed-commits
branch
from
September 2, 2026 15:17
f756ea2 to
f78c6dd
Compare
This comment was marked as resolved.
This comment was marked as resolved.
rumpl
approved these changes
Sep 2, 2026
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.
🤖 Automated implementer agent — this comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer
Two independent improvements to the weekly
update-models.ymlrefresh (root-cause analysis and the full three-phase design were scoped directly with the requester in a design discussion prior to this PR; there is no filed GitHub issue to link). Phase 3 (AI-generated PR summary viadocker/docker-agent-action) is explicitly deferred to a follow-up PR — no agent/LLM step, no.github/agents/*.yaml, no new secrets here.Signed commits
Create pull request(peter-evans/create-pull-request) now passessign-commits: truewithtoken: ${{ github.token }}— this builds the commit through GitHub's API instead of a localgit push, so it's Verified regardless of which token creates it. On the defaultGITHUB_TOKEN, the commit author/committer is consistentlygithub-actions[bot], rather than whoever happened to trigger the run.docker/docker-agent-action/setup-credentialsto mint adocker-read-write[bot]App token, buying bot branding and CI auto-triggering on the created PR. That was deliberately dropped — not worth the added dependency for those two benefits alone. Accepted trade-off: commits show asgithub-actions[bot], and the pre-existing weekly-manual-CI-rerun tax (GitHub's recursion guard doesn't fire workflows off PRs created byGITHUB_TOKEN) returns.contents: write+pull-requests: write(needed for the defaultGITHUB_TOKENto do the signed-commit-via-API + PR creation itself).persist-credentials: falseon checkout. Aconcurrencygroup and a canonical-repo job guard prevent an overlappingworkflow_dispatchfrom racing the weekly schedule.on:block (workflow_dispatch+ weeklyschedule) is untouched — byte-identical tomain.Semantic catalog diff, no AI
.github/scripts/models-delta.jq— structural added/removed/changed diff between two snapshot.json files..github/scripts/models-delta-render.jq— renders that diff to markdown tables, with asafe()/safe_diff()sanitiser clamping every third-party (models.dev) string to a short, bounded, control-character-free charset before it reaches the PR body, since that body flows into this repo's automated PR-review pipeline.scripts/models-delta.sh— the single caller of both scripts;task models-delta(Taskfile) and the workflow both shell out to it, so the jq logic exists in exactly one place. With no args it diffs HEAD'ssnapshot.jsonagainst the working tree (what a localtask update-modelswould change);--json-out FILEalso emits the structural JSON.task update-modelsand uses the rendered markdown as the PR body/title/commit message. The delta step iscontinue-on-error: truewith a static-body fallback, so a jq/shell failure degrades the PR text instead of silently skipping the weekly refresh.snapshot_date.txtchanged (no catalog content diff) — conservative choice, preserves today's behavior and doesn't interact withcheck-models-fresh/TestSnapshotDateIsFresh.scripts/models-delta-test.shis a golden-fixture regression test for the two jq scripts..github/workflows/models-delta-lint.ymlruns it (plusshellcheck) as its own path-filtered workflow — mirrors this repo's existingdocs-lint.ymlpattern — rather than unconditionally on every PR viaci.yml's blanket lint job.Testing
task build,task test,task lintall pass (one pre-existing, environment-flakypkg/cachetest unrelated to this diff, reproduced identically on unmodifiedmain)../scripts/workflow-lint.sh,actionlint -shellcheck=shellcheck, andshellcheck scripts/models-delta.sh scripts/models-delta-test.shall clean.pkg/modelsdev/snapshot.jsonviatask models-deltayields empty added/removed/changed.reviewersub-agent across many passes (verdict: approve) plus multiple rounds of human security review — see PR comments for the full history of findings addressed, including the deliberate App-token removal and the CI lint path-scoping.Branch history was squashed into a single commit per request; the incremental "address review round N" commits are not individually preserved.