Skip to content

fix(deploy): ensure standards-sync label exists + document the deploy standard#481

Merged
don-petry merged 1 commit into
mainfrom
fix/standards-deploy-ensure-label
Jun 18, 2026
Merged

fix(deploy): ensure standards-sync label exists + document the deploy standard#481
don-petry merged 1 commit into
mainfrom
fix/standards-deploy-ensure-label

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Summary

Two follow-ups to #480 (PR-based stub deploy):

  1. Bugfixsd_deploy_via_pr passed gh pr create --label standards-sync, which fails outright on any target repo lacking that label. None of the 7 consumer repos carry it (only .github-private does), so feat: implement issue #478 — deploy standard workflows via PRs, not direct pushes #480 as merged would fail PR creation on every real target. The lib now creates the label if missing (create-if-missing, no --force so an existing curated label is never clobbered) before opening the PR. Regression test added.
  2. Docs — adds a "Deploying & syncing stubs" standard to standards/ci-standards.md: stubs are deployed via PRs (deploy-standard-workflows.sh, standards-sync label, never direct-push / never --admin), with the ruleset-protected-repo rationale.

How it was found

Caught by the controlled live verification requested for #480: running the real script on a ruleset-protected repo (ContentTwin) showed branch + Contents-API PUT + PR all work (no 409 — the original bug is fixed), but gh pr create failed on the missing label. After this fix, a live re-run opened a correctly-labeled PR (label auto-created) on ContentTwin with no 409; the throwaway PR was closed.

Validation

  • bats — 14/14 pass (added: "ensures the label exists before opening the PR", asserting gh label create precedes gh pr create).
  • shellcheck --severity=warning -x — clean.
  • Live: fixed script opened a labeled standards-sync PR on the protected repo ContentTwin end-to-end (closed afterward).

Related (separate, not in this PR)

The verification also surfaced a three-way pin inconsistency between the deploy templates, the compliance audit's expected pins (check_centralized_workflow_stubs), and the fleet (e.g. dependency-audit/dependabot-automerge: template+audit @v1 but repos run @v2; agent-shield/dependabot-rebase templates SHA-pinned vs audit @v1). Filed separately — a blind re-sync would push downgrades/pin-flips, so it needs its own remediation.

Refs #478, #480.

🤖 Generated with Claude Code

…cument deploy standard

The PR-based deploy (#480) passed `gh pr create --label standards-sync`, which
fails outright on any target repo lacking that label — and none of the consumer
repos carry it (only .github-private does). Live verification on a ruleset-
protected repo confirmed branch+PUT+PR creation works (no 409) but PR creation
failed on the missing label.

- sd_deploy_via_pr now creates the label if missing (create-if-missing, no
  --force so an existing curated label is never clobbered) before opening the PR.
- Add a regression test asserting the label is ensured before `gh pr create`.
- Document the deploy/sync standard in ci-standards.md ("Deploying & syncing
  stubs"): PR-based via deploy-standard-workflows.sh, standards-sync label,
  never direct-push / never --admin, with the ruleset-protected-repo rationale.

Refs #478, #480.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@don-petry don-petry requested a review from a team as a code owner June 18, 2026 21:19
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 14 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 13be82d1-3405-415d-a926-f529c19a4f78

📥 Commits

Reviewing files that changed from the base of the PR and between 101ddfc and 91d842e.

📒 Files selected for processing (3)
  • scripts/lib/standards-deploy.sh
  • standards/ci-standards.md
  • test/scripts/lib/standards-deploy.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/standards-deploy-ensure-label

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 and usage tips.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry don-petry disabled auto-merge June 18, 2026 21:20
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
**PR State:**
- All CI checks completed with `success` or `skipped` conclusions
- No reviews with `CHANGES_REQUESTED`
- One check (`Analyze (actions)`) still `in_progress` but no blocking conclusion yet
- No Tier 1 blockers (failures, timeouts, changes requested, etc.)
---
## Summary
**No actionable issues found.**
The SonarCloud bot comment reports a **passing quality gate** with zero new issues, zero security hotspots, and no code quality concerns. This is an informational status report, not an issue requiring fixes.
All CI checks pass. The PR is ready to merge.

@don-petry don-petry enabled auto-merge (squash) June 18, 2026 21:20

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the standard deployment script to ensure that the PR label exists on the target repository before creating a pull request, preventing failures when the label is absent. It also adds a regression test to verify this behavior and documents the stub deployment and syncing process in the CI standards documentation. There are no review comments, so I have no additional feedback to provide.

@don-petry don-petry disabled auto-merge June 18, 2026 21:21
@don-petry don-petry merged commit 1160a31 into main Jun 18, 2026
28 checks passed
@don-petry don-petry deleted the fix/standards-deploy-ensure-label branch June 18, 2026 21:21
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (no-changes)

Agent reasoning
Addressed 0 threads:
  (no open review threads)
Test verification: PASS
  shellcheck: clean (no output)
  bats 14/14 tests passed:
    ok 1 opens a PR and reports OPENED with the url
    ok 2 happy path makes the full create call sequence
    ok 3 ensures the label exists before opening the PR
    ok 4 skips when an open PR already exists on the branch
    ok 5 idempotent skip makes no branch/PUT/PR-create calls
    ok 6 reuses an existing branch and still opens the PR
    ok 7 passes the existing blob sha when updating a drifted stub
    ok 8 fails cleanly when the base sha cannot be resolved
    ok 9 fails when the branch can neither be created nor found
    ok 10 fails when the PUT is rejected
    ok 11 fails when the PR cannot be created
    ok 12 fails when the local file is missing
    ok 13 dry-run plans a PR to create a missing stub
    ok 14 dry-run skips a stub that is already compliant
Files changed: none
```
The PR is clean: zero open review threads, all CI checks passing, and gemini-code-assist gave a positive review with no change requests. No changes were needed.

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.

1 participant