Skip to content

ci: pre-merge frontend build gate (closes #191)#232

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
ci/issue-191-pr-build-gate
May 3, 2026
Merged

ci: pre-merge frontend build gate (closes #191)#232
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
ci/issue-191-pr-build-gate

Conversation

@cristim
Copy link
Copy Markdown
Member

@cristim cristim commented May 3, 2026

Summary

Security note: pull_request vs pull_request_target

Uses pull_request (not pull_request_target). pull_request_target runs with base-branch secrets and is a known fork-exfiltration vector. pull_request runs in the PR-head context with no secrets — safe for untrusted-code builds.

Paths filter

Restricts execution to PRs that touch frontend/** or the workflow file itself. Avoids wasting ~60s of runner time on Go/Terraform-only PRs.

Test plan

  • Open a PR against feat/multicloud-web-frontend that changes a file in frontend/ — confirm "Frontend build (PR)" check appears and passes.
  • Introduce a deliberate TypeScript error in frontend/src/*.ts in a PR — confirm the check fails and blocks merge.
  • Open a PR that only touches Go or Terraform files — confirm the check is skipped (no run triggered).
  • Add Frontend build (PR) to branch protection required status checks for feat/multicloud-web-frontend and main.

Summary by CodeRabbit

  • Chores
    • Added automated build and type-checking validation for pull requests to ensure code quality before merging.

Add .github/workflows/frontend-build.yml — a pull_request-triggered job
that runs npm run typecheck (tsc --noEmit) and npm run build (webpack)
for any PR targeting feat/multicloud-web-frontend or main that touches
frontend/** or the workflow file itself.

Rationale for pull_request vs pull_request_target: pull_request_target
executes in the base-branch context with access to repository secrets,
making it a fork-exfiltration vector. pull_request is safe for
untrusted-code builds — it runs in the PR-head context with no secrets.

Paths filter restricts the gate to PRs that actually touch the frontend,
avoiding wasted CI minutes on Go/Terraform-only PRs (~60s/run).

Node version and action versions (checkout@v5, setup-node@v6, Node 24)
match the existing frontend-build-sentinel.yml so both jobs run in the
same environment. Concurrency group cancels stale runs on force-push.

This is a companion to frontend-build-sentinel.yml (#177), not a
replacement — the sentinel guards the protected branch post-merge
(defence-in-depth for rebase/UI-merge slip-throughs); this gate
catches failures before merge.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f0e4743-e5dc-4c9a-a230-be4814e192c1

📥 Commits

Reviewing files that changed from the base of the PR and between c84fd02 and ba6c49c.

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

📝 Walkthrough

Walkthrough

This PR adds a GitHub Actions workflow that automatically builds and typechecks the frontend on pull requests targeting specific branches, with concurrency control to cancel redundant runs.

Changes

Frontend CI Workflow

Layer / File(s) Summary
Workflow Configuration
.github/workflows/frontend-build.yml
New GitHub Actions workflow triggered on pull_request events to feat/multicloud-web-frontend and main branches; configured with read-only permissions, concurrency-based cancellation, and Node.js v24 with npm caching. Build job runs from frontend/ directory with npm ci, npm run typecheck, and npm run build steps (5-minute timeout).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

Suggested labels

triaged, priority/p2, severity/medium, urgency/this-sprint, impact/internal, effort/xs, type/chore

Poem

🐰 A workflow so clean, a build so divine,
TypeScript checks pass at node twenty-four's line,
Pull requests now race through the automated spine,
Frontend builds steady with cache bells that chime! ✨

🚥 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 clearly summarizes the main change: adding a pre-merge CI check for frontend builds via GitHub Actions workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ 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-191-pr-build-gate

Review rate limit: 0/5 reviews remaining, refill in 57 minutes and 58 seconds.

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

@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 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.

@cristim cristim added priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/internal Team-internal only effort/s Hours type/chore Maintenance / non-user-visible triaged Item has been triaged labels May 3, 2026
@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 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.

@cristim cristim merged commit 87ddf2d into feat/multicloud-web-frontend May 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours 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