Skip to content

ci(frontend): fast-fail build sentinel on push to protected branches (closes #177)#179

Merged
cristim merged 1 commit intofeat/multicloud-web-frontendfrom
ci/issue-177-frontend-sentinel
Apr 28, 2026
Merged

ci(frontend): fast-fail build sentinel on push to protected branches (closes #177)#179
cristim merged 1 commit intofeat/multicloud-web-frontendfrom
ci/issue-177-frontend-sentinel

Conversation

@cristim
Copy link
Copy Markdown
Member

@cristim cristim commented Apr 28, 2026

Summary

Closes #177 (P1, urgency:now, effort:xs).

Pre-commit's Build frontend hook catches local edits that break the build, but it does NOT run for rebases, merge commits authored via the GitHub UI, or push races. PR #160#172 was the motivating incident: a rebase silently orphaned the formatRelativeTime import, pre-commit didn't re-run, the merge landed, and per-cloud deploys all failed ~30 minutes later in their Docker frontend-builder stage.

What's added

.github/workflows/frontend-build-sentinel.yml:

  • Triggers on push to main and feat/** branches.
  • Runs npm ci, npx tsc --noEmit, npm run build, and npx jest --no-coverage --silent inside frontend/.
  • Uses actions/setup-node@v6 with cache: 'npm' keyed on frontend/package-lock.json so the warm path is sub-30s.
  • concurrency: { group: 'frontend-build-${{ github.ref }}', cancel-in-progress: true } so successive pushes only build the latest tip.
  • 5-minute timeout cap.

Effect

A broken frontend build now fires within ~1 minute of landing on the protected branch, well before the per-cloud deploys hit the same failure 30+ minutes later. Run cost is negligible (~30s warm, ~45s cold, single ubuntu-latest runner).

Verification

  • Workflow file is YAML-valid.
  • Will get its first real test on this PR's merge — if anything in this branch's tip happens to break the frontend build, the new sentinel will catch it on the very push that lands it.

🤖 Generated with claude-flow

Summary by CodeRabbit

  • Chores
    • Introduced automated build and test workflow that executes on every push to main and feature branches, performing TypeScript type verification, frontend application build, and test suite execution.

Closes #177.

Pre-commit's `Build frontend` hook catches local edits that break the
build, but it does NOT run for:
  - rebases,
  - merge commits authored via the GitHub UI, or
  - push races where two commits interleave in an unintended order.

PR #160#172 was the motivating incident: a rebase silently orphaned
the `formatRelativeTime` import, pre-commit didn't re-run, the merge
landed, and the per-cloud deploys all failed ~30 minutes later in
their Docker `frontend-builder` stage.

Adds `.github/workflows/frontend-build-sentinel.yml`:
  - triggers on push to `main` and `feat/**`,
  - runs `npm ci`, `tsc --noEmit`, `npm run build`, and
    `jest --no-coverage --silent` in `frontend/`,
  - cancels in-progress runs on the same ref so successive pushes
    only build the latest tip,
  - 5-minute timeout cap.

Run time on warm cache: ~30s. Cost: negligible. Effect: a broken
frontend build fires within ~1 min of landing on the protected branch,
well before the deploys hit the same failure.
@cristim
Copy link
Copy Markdown
Member Author

cristim commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow is introduced that triggers on pushes to main and feat/\* branches. It performs frontend build validation by installing dependencies, running TypeScript typecheck, building the frontend, and executing Jest tests, with per-ref concurrency management and npm caching.

Changes

Cohort / File(s) Summary
Frontend Build Sentinel Workflow
.github/workflows/frontend-build-sentinel.yml
New workflow that runs on push to main and feat/** branches. Executes npm ci, npx tsc --noEmit, npm run build, and Jest tests in a single job with 5-minute timeout, per-ref concurrency, and npm cache keying on frontend/package-lock.json.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A sentinel hops into place,
Catching builds that lose the race,
No more waits for distant shores—
Thirty seconds, gates open doors,
Fast feedback, errors caught in grace!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding a fast-fail CI sentinel for frontend builds on protected branches, and references the linked issue #177.
Linked Issues check ✅ Passed The PR implementation fully satisfies all coding requirements from issue #177: workflow triggers on push to main and feat/*, runs npm ci and npm run build in frontend/, includes tsc typecheck and jest tests for parity, uses npm caching via actions/setup-node, and implements concurrency with cancel-in-progress.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the stated objective: the single new workflow file (.github/workflows/frontend-build-sentinel.yml) implements exactly what issue #177 specifies with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/issue-177-frontend-sentinel

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/frontend-build-sentinel.yml (1)

42-46: Pin GitHub Actions to immutable commit SHAs for supply-chain security.

Lines 42 and 45 use mutable version refs (@v5, @v6). Pinning to commit SHAs prevents silent behavior drift when maintainers update version tags and reduces supply-chain risk.

Update:

  • Line 42: actions/checkout@v5 → pin to full SHA of v6
  • Line 45: actions/setup-node@v6 → pin to full SHA of current v6.x release
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/frontend-build-sentinel.yml around lines 42 - 46, Replace
the mutable action refs with immutable commit SHAs: update the uses value for
actions/checkout (currently "actions/checkout@v5") to the full commit SHA
corresponding to the v6 tag, and update the uses value for actions/setup-node
(currently "actions/setup-node@v6") to the full commit SHA for the current v6.x
release; locate these entries by searching for the strings "actions/checkout"
and "actions/setup-node" in the workflow and substitute the tag refs with their
respective full commit SHAs to pin the actions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/frontend-build-sentinel.yml:
- Around line 42-46: Replace the mutable action refs with immutable commit SHAs:
update the uses value for actions/checkout (currently "actions/checkout@v5") to
the full commit SHA corresponding to the v6 tag, and update the uses value for
actions/setup-node (currently "actions/setup-node@v6") to the full commit SHA
for the current v6.x release; locate these entries by searching for the strings
"actions/checkout" and "actions/setup-node" in the workflow and substitute the
tag refs with their respective full commit SHAs to pin the actions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a540dbd-dec8-466f-b3fe-7cd8da0d2a30

📥 Commits

Reviewing files that changed from the base of the PR and between 3e655cb and f6a203e.

📒 Files selected for processing (1)
  • .github/workflows/frontend-build-sentinel.yml

@cristim cristim merged commit 0da903d into feat/multicloud-web-frontend Apr 28, 2026
3 checks passed
@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/internal Team-internal only effort/xs Trivial / one-liner type/chore Maintenance / non-user-visible labels Apr 28, 2026
@cristim cristim deleted the ci/issue-177-frontend-sentinel branch April 29, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/internal Team-internal only priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant