ci: run checks only for domains the PR actually changed - #44
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Reviewer's GuideThe workflow now performs a fail-safe, path-based classification of PR changes, validates configuration files cheaply, and conditionally runs the Next.js and Firebase checks at the job level while preserving full CI on pushes to master and maintaining required-check safety. Flow diagram for change-aware CI checksflowchart TD
Event[PR or push event] --> Detect[Detect changes]
Detect --> Diff[git diff --name-only]
Diff --> Validate[Validate changed JSON and workflow YAML]
Validate --> Classify[Classify paths into app and functions outputs]
Classify --> AppGate{app output is true}
Classify --> FunctionsGate{functions output is true}
AppGate -->|yes| App[App Next.js check]
AppGate -->|no| AppSkip[App check skipped]
FunctionsGate -->|yes| Functions[Functions Firebase check]
FunctionsGate -->|no| FunctionsSkip[Functions check skipped]
Diff -->|diff unavailable or unknown path| Full[Run all domains]
Event -->|push to master| Full
Full --> App
Full --> Functions
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes CI change-aware. A new
Detect changesjob diffs the PR against the base branch, classifies changed paths into domains, and gates each existing check with a job-levelif:. Pushes tomasterstill run the full suite.Previously a docs/
vercel.json-only PR booted bothApp (Next.js)andFunctions (Firebase)— fullnpm ci+ tests + builds that cannot detect a regression from those files.Required-check safety
The ruleset requires
App (Next.js)andFunctions (Firebase). Gating uses job-levelif:, not workflowpaths:filters: a skipped job reports Success and satisfies required checks, whereas a filtered workflow would leave required checks pending forever. Check names stay present on every PR — this PR demonstrates it (only.github/**changed → both jobs skip, checks still resolve).The classifier fails safe: uncomputable diff or unrecognized path → run everything. Cheap validation added for config-only changes (JSON parse + workflow YAML parse).
Expected behavior
*.md, docs,.github/**,vercel.json,.devin/**src/**,public/**,scripts/**, app configsfunctions/**,firebase.json,.firebaserc,firestore.rules, indexespackage.json/package-lock.json/.nvmrcmasterValidation
Classifier logic exercised locally against simulated diffs (vercel-only, docs, app code, functions, lockfile, rules, unknown). Workflow YAML validated.
Generated with Devin
Summary by Sourcery
Make CI change-aware by classifying pull request changes and running only the relevant domain checks while preserving required-check safety and full master-branch coverage.
Enhancements:
CI: