fix: Action as brand color + release deploy race condition - #370
Conversation
Action is a brand color (the interactive/CTA accent), not a semantic status color. Update brandColors.js group field and the DomainPanel partition so it appears in "Extended brand colors" alongside Secondary and Tertiary, leaving the Status section for success/warning/error/info/danger only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fg7U9rTiqBgbsPuz9kdWea
…y dispatch After sync-main pushes the version-bump commit, it immediately dispatches deploy-configurator.yml and publish-dist.yml via `gh workflow run --ref main`. GitHub's API can lag a few seconds behind a just-completed git push, so the dispatch event resolves `main` to the pre-bump HEAD — both downstream workflows then build from the wrong commit and bake the old version (observed: v0.6.7 release deployed the configurator showing v0.6.6). Fix: capture `git rev-parse HEAD` as `deploy_ref` immediately after the push step, then pass it as `-F git_ref=<sha>` to both dispatches. The deploy and publish-dist workflows gain an optional `git_ref` workflow_dispatch input; when set, checkout uses it explicitly instead of the event's racy head_sha. For push-triggered runs (not from release.yml) the input is empty and `github.sha` is used as before — no behaviour change for those paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fg7U9rTiqBgbsPuz9kdWea
📝 WalkthroughWalkthroughTwo independent changes: the CI release pipeline is updated so ChangesCI/CD: Pin downstream deploys to exact post-sync SHA
Configurator: Reclassify
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish-dist.yml:
- Around line 52-54: The workflow uses github.sha which refers to the
workflow_dispatch trigger commit, not the actual checked-out ref. When git_ref
is provided and checkout occurs at that ref on line 54, the github.sha variable
still points to the wrong commit. Capture the actual commit SHA that was checked
out (either from the actions/checkout action output or by running git rev-parse
HEAD after checkout) and store it as a variable, then use that variable instead
of github.sha when creating SOURCE.txt around line 82 and in the commit message
around line 111 to ensure correct provenance tracking.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d9cafe4a-d393-41b0-a106-f6223dad4e37
📒 Files selected for processing (5)
.github/workflows/deploy-configurator.yml.github/workflows/publish-dist.yml.github/workflows/release.ymlconfigurator/src/components/DomainPanel.svelteconfigurator/src/lib/brandColors.js
…ger SHA
When publish-dist.yml is dispatched with a custom git_ref, checkout builds that
ref but ${GITHUB_SHA} still points at the workflow_dispatch trigger commit. That
would stamp SOURCE.txt and the dist commit message with the wrong source commit.
Resolve the actual checked-out HEAD after checkout and use it for both.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fg7U9rTiqBgbsPuz9kdWea
There was a problem hiding this comment.
1 issue found and verified against the latest diff
You’re at about 91% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/publish-dist.yml">
<violation number="1" location=".github/workflows/publish-dist.yml:54">
P2: Build can run from `inputs.git_ref` but still records `GITHUB_SHA`, causing incorrect source-commit metadata. This can mislabel the published dist as built from a different commit than the one actually checked out.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| persist-credentials: false | ||
| # When dispatched from release.yml, git_ref is the exact post-sync SHA | ||
| # so the dist bundles are always stamped with the released version. | ||
| ref: ${{ inputs.git_ref || github.sha }} |
There was a problem hiding this comment.
P2: Build can run from inputs.git_ref but still records GITHUB_SHA, causing incorrect source-commit metadata. This can mislabel the published dist as built from a different commit than the one actually checked out.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/publish-dist.yml, line 54:
<comment>Build can run from `inputs.git_ref` but still records `GITHUB_SHA`, causing incorrect source-commit metadata. This can mislabel the published dist as built from a different commit than the one actually checked out.</comment>
<file context>
@@ -44,6 +49,9 @@ jobs:
persist-credentials: false
+ # When dispatched from release.yml, git_ref is the exact post-sync SHA
+ # so the dist bundles are always stamped with the released version.
+ ref: ${{ inputs.git_ref || github.sha }}
# No dependency cache on the publish path: a poisoned cache could be
</file context>
Summary
Two post-release fixes.
1. Action is a brand color, not a status color
The Colors panel grouped
actionunder "Status colors" alongside success/warning/error/info/danger. Butactionis the interactive/CTA accent — a brand color. Moved it:brandColors.js:action.group→'brand'DomainPanel.svelte:actionnow lives in the "Extended brand colors" accordion (with Secondary/Tertiary); Status section is now success/warning/error/info/danger only.2. Release deploy race condition (configurator showed stale version)
Symptom: after releasing v0.6.7, the deployed configurator still showed v0.6.6.
Root cause: the
sync-mainjob pushes the version-bump commit tomain, then immediately dispatchesdeploy-configurator.ymlandpublish-dist.ymlviagh workflow run --ref main. GitHub's API lags a few seconds behind a just-completed push, so the dispatch resolvedmainto the pre-bump HEAD. Both downstream workflows built from the old commit and baked the previous version (the configurator version pill is stamped at Vite build time frompackage.json).Fix:
release.yml: capturegit rev-parse HEADasdeploy_refright after the push, pass it as-F git_ref=<sha>to both dispatches.deploy-configurator.yml+publish-dist.yml: new optionalgit_refworkflow_dispatch input; checkout uses${{ inputs.git_ref || github.sha }}. Release-dispatched runs now build the exact version-bumped commit. Push-triggered runs are unchanged (empty input →github.sha).Note on the current v0.6.7 deployment
This fix prevents recurrence. To correct the already-deployed v0.6.7 configurator, re-run
deploy-configurator.ymlfrom the Actions tab (leavegit_refblank — main now points at the v0.6.7 sync commit).Test plan
actionappears under Extended brand colors, not Statusgit_refplumbed through all three files)npm run release)🤖 Generated with Claude Code
https://claude.ai/code/session_01Fg7U9rTiqBgbsPuz9kdWea
Generated by Claude Code
Summary by cubic
Reclassifies the
actioncolor as a brand color in the configurator UI. Fixes a release deploy race so downstream builds use the correct versioned commit and ensures dist provenance is stamped with the actual built SHA.Bug Fixes
actionto Extended brand colors with Secondary/Tertiary; Status now only success/warning/error/info/danger.release.ymlcaptures the post-push SHA and passes it asgit_reftodeploy-configurator.ymlandpublish-dist.yml; both workflows accept optionalgit_refand check out${{ inputs.git_ref || github.sha }}.publish-dist.ymlresolves the checked-out SHA after checkout and uses it forSOURCE.txtand the dist commit message, so provenance matches the built tree when a customgit_refis used.Migration
deploy-configurator.ymlfrom Actions withgit_refleft blank.Written for commit cf80a88. Summary will update on new commits.
Summary by CodeRabbit