Add protocol version auto-update workflow - #978
Conversation
There was a problem hiding this comment.
Pull request overview
Adds daily automation to calculate and update each image’s default protocol version from resolved component sources.
Changes:
- Adds protocol-version extraction and update logic.
- Adds a scheduled workflow that opens auto-merging update PRs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.scripts/auto-update-protocol-version |
Calculates protocol defaults from component sources. |
.github/workflows/auto-update-protocol-version.yml |
Runs updates daily and creates PRs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/auto-update-protocol-version.yml:105
- This recovery path is not idempotent. If a run pushes the hash-named branch but fails before
gh pr create, a rerun finds no open PR and then tries to push a newly created commit to the existing remote branch, which is rejected as non-fast-forward; the same occurs when a PR is closed without deleting its branch. Detect and reuse or safely replace an existing remote branch, and explicitly handle any closed PR, before pushing.
# Skip only if a PR for this exact component set is already open.
if gh pr list --head "$branch" --state open --json number --jq '.[0].number' | grep -q .; then
echo "PR already exists for this update"
exit 0
fi
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/auto-update-protocol-version.yml:99
images.resolved.jsoncontains SHAs for every dependency, including unrelated moving refs such as Lab and Galexie. If a protocol-update PR remains open, any such commit changes this hash, so the next daily run opens another PR with the sameimages.jsonchange instead of deduplicating it. Key the branch on the proposedimages.json(or a normalized protocol-update set) and keep the resolved snapshot only for the audit trail.
resolved=$(cat images.resolved.json)
hash=$(printf '%s' "$resolved" | sha256sum | cut -c1-16)
branch="auto-update-protocol-version/${hash}"
What
A daily workflow that sets each image's
protocol_version_defaultto the highest protocol supported by all of its xdr, core, rpc, and horizon components — read from each component's source at the resolved commit — and opens an auto-merging PR when the value changes.Why
Maintainers had to keep
protocol_version_defaultin sync with the components' max supported protocol by hand, which is error-prone and drifts out of date (#860).Close #860