Skip to content

ci: build TestFlight against .platform-ref when platform_ref is blank - #1223

Merged
romchornyi merged 8 commits into
developfrom
ci/testflight-platform-ref-pin
Oct 21, 2026
Merged

romchornyi merged 8 commits into
developfrom
ci/testflight-platform-ref-pin

Conversation

@romchornyi

@romchornyi romchornyi commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

A TestFlight dispatch with a blank platform_ref checks out dashpay/platform's default branch (#1186). DashWalletTests checks out the SHA in .platform-ref (#1213). For the same wallet commit, the release can therefore link a different SDK from the one its tests ran against.

#1222 makes this matter: it pins testnet to Platform protocol 14 and moves .platform-ref to 5.0.0-rc.4, the release testnet runs. thepastaclaw flagged the gap there as blocking. Today it is harmless, because v5.0-dev (907a1b98af) has the same v13/v14 tables and schema-releases.json as rc.4. That holds only until the default branch moves on.

What was done?

release-dashpay-testflight.yml has a new step, Resolve the platform ref, before the platform checkout. It handles three cases:

  • Explicit platform_ref: used as given. Before the checkout, anything other than a full 40-hex SHA must exactly match a branch or tag (or a full refs/… name) on dashpay/platform, checked with git ls-remote. An abbreviated SHA, a typo or a suffix such as dev now fails in seconds, not after the full-history fetch. A failed lookup is reported as a lookup failure. A ref containing whitespace is rejected, and leading or trailing whitespace is trimmed.
  • Blank, and wallet_ref has .platform-ref: the step reads that SHA. It must be a regular file holding a full 40-hex SHA, the same check as in unit-tests.yml; a symlink or a directory fails.
  • Blank, and no .platform-ref: this is a branch cut before test: revive DashWalletTests against dashpay and run it on every PR #1213. The step warns and falls back to the default branch, as before, so old branches stay releasable.

Resolve build provenance compares the checked-out commit with the pin. When the commit is off the pin, the step warns. The release summary records the result:

- platform: `<sha>` (from: `.platform-ref`; on the .platform-ref pin)
- platform: `<sha>` (from: `v5.1-dev`; off the .platform-ref pin <pin>)
- platform: `<sha>` (from: `default branch`; no .platform-ref)

The platform_ref input description and run-name describe the new default.

How Has This Been Tested?

  • actionlint 1.7.7: the only report is the existing macos-26 runner label, which this tool version does not know. develop gets the same report.
  • The resolve step on its own, taken from the workflow YAML and run locally against the live dashpay/platform remote:
Input Result
Pin, platform_ref blank builds the pin
No pin, platform_ref blank default branch, with a warning
v5.1-dev accepted
v5.0.0-rc.4 accepted
refs/heads/v5.1-dev accepted
Full SHA accepted
5b41ca3 rejected
v4.2-devv rejected
dev rejected
v5.1* rejected
Pin set to v5.1-dev rejected
Pin is a symlink or a directory rejected
A newline in the input rejected
Whitespace around a ref trimmed and accepted
  • Local /code-review passes: repeated until a pass came back clean.
  • Not run on Actions: a workflow_dispatch change only runs once it is on the default branch.

Breaking Changes

A blank platform_ref now builds from the wallet branch's .platform-ref rather than the Platform default branch. To build against a branch head (for example v5.1-dev), enter it explicitly. The build then warns that it is off the pin, and the summary records that.

For an internal or external upload, the schema gate checks the Platform commit. If an App Store freeze is merged into Platform after the pin was set, gate fails with "missing from the selected Platform commit". Bump .platform-ref or enter a ref to fix it.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Build & Release
    • TestFlight release summaries now show where the Platform version came from and whether it matches the pinned version.
    • Invalid or unresolved Platform versions now stop the release workflow instead of proceeding with a build.

jeanpierreroma and others added 8 commits October 19, 2026 23:18
A blank platform_ref checked out Platform's default branch, so a release
could link a different SDK from the one DashWalletTests ran against for
the same wallet commit. Blank now reads the SHA in wallet_ref's
.platform-ref; a branch without that file falls back to the default
branch as before, and an explicit ref still wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9eef17fc-48e4-4ab1-a311-7fd14d65df75
📥 Commits

Reviewing files that changed from the base of the PR and between 6766463 and 8f79576.

📒 Files selected for processing: 1
  • .github/workflows/release-dashpay-testflight.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The TestFlight workflow now resolves the Platform checkout ref from a validated input, the wallet’s .platform-ref pin, or Platform’s default branch. It uses that ref for checkout and reports whether the checked-out commit matches the pin.

Changes: Platform Ref Resolution

Layer / File(s) Summary
Resolve and check out the Platform ref
.github/workflows/release-dashpay-testflight.yml
The workflow validates an entered ref and gives it precedence over the wallet’s .platform-ref pin. If neither is available, it uses Platform’s default branch. The checkout uses the resolved ref.
Report the checked-out pin status
.github/workflows/release-dashpay-testflight.yml
Build provenance records whether the checked-out commit matches the pin, and warns when it does not. The release summary reports the ref source and pin status.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant WalletCheckout
  participant PlatformRepository
  participant BuildProvenance
  participant ReleaseSummary
  Workflow->>WalletCheckout: Read .platform-ref when no input ref is set
  Workflow->>PlatformRepository: Check out the resolved ref
  Workflow->>BuildProvenance: Compare checked-out commit with pin
  BuildProvenance-->>Workflow: Return pin status
  Workflow->>ReleaseSummary: Report ref source and pin status
Loading

Suggested reviewers: llbartekll

Merge Risk: ⚪ Minimal · up to 8f795

The workflow selects the requested Platform ref, wallet pin, or default branch as intended and reports pin status. No merge-blocking issue was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: TestFlight builds use .platform-ref when platform_ref is blank.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 8f79576) · triage: normal

@thepastaclaw thepastaclaw 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.

Final validation — Phase 1 + Phase 2

The workflow change correctly resolves blank platform_ref values from the wallet's validated .platform-ref, validates explicit refs before checkout, and records the actual Platform commit and pin status in release provenance. The exact head contains no in-scope correctness, security, or architecture defects, and all supplied CI checks for this commit passed.

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — This changes release workflow logic for resolving and validating Platform commits, affecting build provenance and release gating rather than merely formatting or documentation.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer

@llbartekll llbartekll 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.

Approving. This closes the gap where a TestFlight build could link a different SDK from the one DashWalletTests ran against. The resolve step matches unit-tests.yml's pin check, an entered ref still takes precedence, and the summary now records where the Platform commit came from.

Checked locally: I pulled the Resolve the platform ref step out of the YAML and ran it under /bin/bash (3.2) against the live dashpay/platform remote. All of these behaved as the PR table says:

  • blank with a pin
  • blank without a pin
  • v5.0.0-rc.4
  • refs/tags/v5.0.0-rc.4
  • v5.1-dev, including with whitespace around it
  • dev, 5b41ca3 and HEAD (all rejected)
  • refs/pull/4978/head (accepted)

CI is green.

Two inline notes, neither blocking. One more:

  • Tests: the step holds about 60 lines of branching shell inside the YAML, and nothing in CI runs it. The 14-row table in the description is already a test plan. Moving the step into .github/scripts, next to schema_release.rb and its schema_release_test.rb, would let CI check it. That can be a follow-up.

# after a full-history fetch, so anything but a full SHA must name a
# branch or tag exactly. ls-remote patterns match name suffixes, so
# the returned names are compared exactly.
if [[ -n "$ref" && ! "$ref" =~ ^[0-9a-fA-F]{40}$ ]]; then

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.

Nit: an uppercase SHA gets through here, but .platform-ref must be lowercase, and git rev-parse HEAD (line 372) always prints lowercase. So if someone enters the pin itself in uppercase, line 376's string comparison reports the build as "off the .platform-ref pin" and warns, even though it is the same commit. Lowercasing a 40-hex ref before it is written to $GITHUB_OUTPUT fixes this: tr 'A-F' 'a-f' works under bash 3.2, where ${ref,,} does not.

source="$ref"
elif [[ -n "$pin" ]]; then
ref="$pin"
source=".platform-ref"

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.

This trade-off is right. You covered the operational cost in Breaking Changes, but it will come up after every App Store release:

  1. The freeze PR merges into Platform's default branch.
  2. The next blank-ref internal or external run fails gate, until someone bumps .platform-ref.

gate's message says "Select a commit containing that freeze" and never mentions .platform-ref. An operator will likely just type a branch, which builds off the pin. Two possible follow-ups:

  • When source is .platform-ref, have gate or this workflow name the pin as the thing to bump.
  • Have the schema-freeze workflow also open the .platform-ref bump PR here.

Not blocking.

@romchornyi
romchornyi merged commit f1b1b3d into develop Oct 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants