Skip to content

Add protocol version auto-update workflow - #978

Merged
leighmcculloch merged 28 commits into
mainfrom
auto-update-protocol-version
Aug 31, 2026
Merged

Add protocol version auto-update workflow#978
leighmcculloch merged 28 commits into
mainfrom
auto-update-protocol-version

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Aug 26, 2026

Copy link
Copy Markdown
Member

What

A daily workflow that sets each image's protocol_version_default to 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_default in sync with the components' max supported protocol by hand, which is error-prone and drifts out of date (#860).

Close #860

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 26, 2026
@leighmcculloch
leighmcculloch marked this pull request as ready for review August 26, 2026 13:20
Copilot AI balanced review requested due to automatic review settings August 26, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .scripts/auto-update-protocol-version
Comment thread .scripts/auto-update-protocol-version Outdated
Comment thread .scripts/auto-update-protocol-version Outdated
@leighmcculloch
leighmcculloch requested a review from a team August 26, 2026 14:00
Comment thread .github/workflows/auto-update-protocol-version.yml
Copilot AI review requested due to automatic review settings August 31, 2026 03:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread .scripts/auto-update-protocol-version Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 31, 2026 04:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI review requested due to automatic review settings August 31, 2026 04:50
@leighmcculloch
leighmcculloch enabled auto-merge (squash) August 31, 2026 04:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json contains 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 same images.json change instead of deduplicating it. Key the branch on the proposed images.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}"

@leighmcculloch
leighmcculloch merged commit 7f1fb0f into main Aug 31, 2026
102 checks passed
@leighmcculloch
leighmcculloch deleted the auto-update-protocol-version branch August 31, 2026 05:03
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fallback to Stellar Core's supported protocol version when config.protocol_version_default is not set

3 participants