Repository navigation
ci: read the Platform branch from its default branch - #1186
Conversation
Freeze published App Store schema has failed on every scheduled run since 2026-09-30: schema_release.rb pinned PLATFORM_BRANCH = "v4.2-dev", Platform renamed that branch to v5.0-dev, and the contents API returns 404 for the old ref, which surfaced as "Schema registry is unavailable". The script now reads dashpay/platform's default_branch once per run and uses it for the registry read, the freeze dispatch and the gate messages. The TestFlight workflow's platform_ref defaults to blank, which checks out the same default branch, so the next rename needs no edit in either place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughSchema release tooling now resolves Platform’s default branch for registry reads and workflow dispatches. The TestFlight workflow accepts a blank Platform ref to select the default branch. Setup instructions now refer to the default branch. ChangesPlatform default branch
Priority: ⬆️ High Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Pipeline as SchemaRelease::Pipeline
participant GitHub as SchemaRelease::GitHub
participant API as GitHub REST API
Pipeline->>GitHub: Request Platform default branch
GitHub->>API: GET /repos/dashpay/platform
API-->>GitHub: Return default_branch
GitHub-->>Pipeline: Return cached, validated branch
GitHub->>API: Dispatch workflow with branch ref
Merge Risk: ⚪ Minimal · up to No concrete issue remains that would prevent merging the default-branch selection change after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change retains branch validation and release-schema checks, with no demonstrated security-control bypass. Remaining uncertainty concerns whether the separate Platform freeze worker preserves branch identity and retry behavior when the default branch changes. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
|
✅ Final review complete — no blockers (commit 21b8d3f) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The exact-head diff consistently uses a lazy, cached Platform default-branch lookup for registry reads and freeze dispatches, and preserves explicit TestFlight ref overrides. One nonblocking limitation remains: the new validation rejects valid branch names containing slashes, weakening the documented rename-independence guarantee. Verification was static only; the supplied exact-head CI snapshot reports a successful test job and latest PR-title check.
💬 1 nitpick(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (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:
lowbygpt-6.1-sol(effort low) — This is a small, contained CI tooling change that replaces a hardcoded branch with a validated default-branch lookup and updates workflow defaults, tests, and documentation. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 97% left, weekly 99% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 15% left, 5h 100% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `.github/scripts/schema_release.rb`:
- [NITPICK] .github/scripts/schema_release.rb:140-142: Branch-name validation rejects slashes, so a slashed default-branch name would still require a tooling edit
The new regex rejects valid Git branch names such as `release/v6`. If Platform adopts such a default branch, registry reads and freeze dispatches will stop with `Unexpected default branch`, despite the documented guarantee that renaming the default branch requires no code change. Both consumers transport the name safely: `GitHub#file` URI-encodes the query value, and `dispatch` JSON-encodes the workflow ref. Permit valid slash-separated branch names while retaining rejection of missing or malformed values, and add a regression case for a slashed default branch. This does not affect the current `v5.0-dev` branch and is nonblocking.
| name = request("get", "repos/#{PLATFORM_REPO}")["default_branch"] | ||
| unless name.is_a?(String) && name.match?(/\A[A-Za-z0-9][A-Za-z0-9._-]*\z/) | ||
| raise Error, "Unexpected default branch for #{PLATFORM_REPO}: #{name.inspect}" |
There was a problem hiding this comment.
💬 Nitpick: Branch-name validation rejects slashes, so a slashed default-branch name would still require a tooling edit
The new regex rejects valid Git branch names such as release/v6. If Platform adopts such a default branch, registry reads and freeze dispatches will stop with Unexpected default branch, despite the documented guarantee that renaming the default branch requires no code change. Both consumers transport the name safely: GitHub#file URI-encodes the query value, and dispatch JSON-encodes the workflow ref. Permit valid slash-separated branch names while retaining rejection of missing or malformed values, and add a regression case for a slashed default branch. This does not affect the current v5.0-dev branch and is nonblocking.
source: glm-5.3-flash (phase1-reviewer: general)
romchornyi
left a comment
There was a problem hiding this comment.
No blockers. Reviewed at 21b8d3f: the lazy, memoised platform_branch is correct, next-build / record-build / bind-build make no extra request, and no PLATFORM_BRANCH reference is left. This makes the scheduled sync read the registry again.
The points below are recommendations and do not block the merge.
1. A default-branch flip is not the same as a rename. dashpay/platform already has v5.1-dev and v6.0-dev next to the default v5.0-dev, so the next transition is likely to be a default flip to an existing branch. The v6.0-dev registry is 48,898 bytes against 49,398 on v5.0-dev / v5.1-dev, so it is behind on at least one freeze. If the default moves there before a forward-merge, gate reads merged from it and blocks internal/external builds even when platform_ref points at a commit that has the freeze, and the scheduled sync re-dispatches the freeze against the new default every 12 h. The same flip silently changes what a blank platform_ref builds (release-dashpay-testflight.yml:18); the internal-only channel has no gate to stop it. Worth a line in SCHEMA_RELEASES.md saying that registries must be forward-merged before Platform's default is switched.
2. Record the resolved branch. With a blank platform_ref the run name and summary say only "default branch" (release-dashpay-testflight.yml:863). Printing git -C platform rev-parse --abbrev-ref HEAD in the provenance step would keep the line auditable after the default moves.
3. Branch-name check is stricter than the companion PR. schema_release.rb:141 rejects names with a slash (release/6.0), while dashpay/platform#5293 accepts anything git check-ref-format accepts. file URL-encodes the ref and dispatch sends it as JSON, so the restriction is not needed for safety. Already noted by thepastaclaw.
4. Error message on 5xx/429. The rescue HTTPError at schema_release.rb:146 reports every status as a token-access problem. merged_registry already separates 401/403/404 from "unavailable or rate-limited"; the same split here would stop a 503 from sending someone to rotate a healthy token.
5. Test coverage of the registry read. The pipeline fake's file(*_args) ignores the ref, so trunk-dev is asserted only in the gate message and against dispatch. A hardcoded ref reintroduced in merged_registry would still pass. Having the fake record its arguments and asserting the ref once would close that.
6. CLAUDE.md:75 still tells contributors to pin Platform v4.2-dev for release builds.
Merge order. Until dashpay/platform#5293 lands, the sync here goes green while a new freeze dispatch would reach a worker that still checks out v4.2-dev; the PR description already calls this out.
🤖 Reviewed with Claude Code
Issue being fixed or feature implemented
Freeze published App Store schema has failed on every scheduled run since 2026-09-30 17:29 UTC (e.g. https://github.com/dashpay/dashwallet-ios/actions/runs/37040985404):
The token and the registry are fine.
schema_release.rbpinsPLATFORM_BRANCH = "v4.2-dev", and Platform renamed that branch tov5.0-dev. The branches API follows the rename, but the contents API with?ref=v4.2-devreturns 404 ("No commit found for the ref"), which the script reports as a missing registry. #1174 fixed the same rename in the TestFlight workflow by writing in the new name, so the next rename would break both again.What was done?
schema_release.rb: removedPLATFORM_BRANCH.GitHub#platform_branchreadsdefault_branchfromGET repos/dashpay/platformonce per run (lazily, sonext-build/record-build/bind-buildmake no extra request), rejects a missing or unsafe name, and turns an HTTP error into a clear token-access message. The registry read, the freeze dispatchrefand bothgatemessages use it. The registry location is printed to the step summary.release-dashpay-testflight.yml:platform_refis now optional and blank by default.actions/checkoutwith a blankreffor another repository checks out its default branch.run-nameand the release summary show "default branch" when it is blank. Any branch, tag or SHA can still be entered.SCHEMA_RELEASES.md: setup step 2 refers to Platform's default branch instead ofv4.2-dev.There is deliberately no override variable. The Platform worker never accepts a Platform ref from its caller, so an iOS-side override would read the registry from one branch while the worker writes to another. If the default branch ever points somewhere wrong,
gatestill blocks the upload because the selected Platform commit will not contain the freeze.Companion Platform change: dashpay/platform#5293 (worker checkout and
BASE_BRANCHinfreeze_appstore_release.py). The two are independent. This PR alone makes the scheduled run green again: the 3.0.0 freeze is already merged onv5.0-dev, so sync only records it as merged. The Platform PR must land before the next App Store release that needs a new freeze.How Has This Been Tested?
ruby -I.github/scripts -e 'Dir[".github/scripts/*_test.rb"].sort.each { |f| require File.expand_path(f) }': 101 runs, 0 failures (Ruby 4.0 locally; CI uses 3.3).python3 -m unittest discover -s .github/scripts -p 'test_*.py': 9 tests pass.trunk-devinstead of the live branch name, so a reintroduced hardcode would fail. New tests cover reading the branch once and dispatching with it, and rejecting a missing, empty or unsafe name or a 403.platform_branchreturnsv5.0-devand the registry reads (49,398 bytes), which is the read that fails in the scheduled runs today.syncdispatch withdry_run: trueshould printSchema registry: dashpay/platform:v5.0-dev/…and report the 3.0.0 freeze as merged.Breaking Changes
None. A TestFlight dispatch with a blank
platform_refnow uses Platform's default branch, which is what the old pre-filled value pointed at.Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation