Skip to content

ci: gate expensive Verify steps by changed domain - #144

Merged
spizeck merged 1 commit into
mainfrom
chore/change-aware-ci
Sep 28, 2026
Merged

spizeck merged 1 commit into
mainfrom
chore/change-aware-ci

Conversation

@spizeck

@spizeck spizeck commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Makes CI change-aware inside the single required Verify job: a classifier step diffs the PR against main, groups the expensive work by domain (app / rules / e2e / markdown), and gates the corresponding steps. Pushes to main still run everything.

Previously a docs-only PR paid for npm ci, JDK 21 setup, the Firebase emulator rules suite, a Chromium download, and a production build.

Required-check safety

Verify stays a single always-present job — the required check name is unchanged and can never go pending. Steps are gated individually, so the check resolves success quickly when a domain is irrelevant.

The classifier fails safe: uncomputable diff or unrecognized path → run all step groups. Cheap JSON/YAML validation runs inside the classifier for config-only changes.

Expected behavior

Change typecheck/lint/test/build JDK + rules tests Playwright smoke md-links
vercel.json, .github/**, .vscode/** skip skip skip skip
*.md skip skip skip run
app/**, components/**, lib/**, public/**, content/**, build config run skip run run
firestore.rules, storage.rules, firebase.json, rules-tests/** skip run skip skip
tests/**, *.test.ts, scripts/**, eslint.config.mjs run skip skip run
smoke-tests/**, playwright.config.ts run (build needed) skip run run
package.json / package-lock.json / .nvmrc run run run run
unknown/unmatched file run run run run
push to main run run run run

Validation

Classifier logic exercised locally against simulated diffs. Workflow YAML validated.

Generated with Devin

Summary by Sourcery

Make the required Verify workflow change-aware so pull requests run only the validation domains affected by their changes while retaining safe full-coverage behavior.

New Features:

  • Add change-aware classification to gate CI verification steps by affected domains while preserving a single required Verify job.
  • Run lightweight JSON/YAML validation for configuration-only changes.

Bug Fixes:

  • Ensure CI fails safe by running all verification domains when the PR diff cannot be computed or contains unrecognized files.

Enhancements:

  • Skip unnecessary dependency installation, language setup, builds, emulator tests, browser tests, and Markdown checks for unaffected changes.
  • Continue running the complete verification suite for pushes to main and dependency-related changes.

CI:

  • Make the Verify workflow classify changed files and conditionally run application, rules, end-to-end, and Markdown validation steps.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @spizeck, this account has used its review budget of 1,500,000 diff characters for the last 7 days.

You can request another review in 22 hours and 45 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
deepdivebrewing-web Ready Ready Preview Sep 28, 2026 12:24am UTC

Request Review

@sourcery-ai

sourcery-ai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

Makes the required Verify workflow change-aware by classifying PR files into validation domains and conditionally running expensive setup and checks, while failing safe on uncertain diffs and running the complete suite on pushes to main.

Sequence diagram for domain-gated Verify execution

sequenceDiagram
    participant GitHub
    participant Verify
    participant Classifier
    participant AppChecks
    participant RulesChecks
    participant E2EChecks
    participant Markdown

    GitHub->>Verify: Start required Verify job
    Verify->>Classifier: Checkout and classify changed files
    alt push to main
        Classifier-->>Verify: app=true, rules=true, e2e=true, md=true
    else PR diff is unavailable or contains an unknown path
        Classifier-->>Verify: Enable all domains
    else recognized PR paths
        Classifier-->>Verify: Enable matching domain outputs
    end
    Classifier-->>Verify: Validate changed JSON/YAML
    Verify->>Verify: Install Node dependencies when any domain is enabled
    opt app enabled
        Verify->>AppChecks: check:react-versions, tsc, lint, test, build
    end
    opt rules enabled
        Verify->>RulesChecks: Setup JDK 21 and test:rules
    end
    opt e2e enabled
        Verify->>E2EChecks: Install Chromium and run Playwright tests
    end
    opt md or app enabled
        Verify->>Markdown: check:md-links
    end
    Verify-->>GitHub: Resolve single Verify check
Loading

Flow diagram for change-aware Verify CI gating

flowchart TD
    A[Checkout with full history] --> B[Classify changed files]
    B --> C{Push to main?}
    C -->|Yes| D[Enable app rules e2e md]
    C -->|No| E[Diff against origin/base]
    E --> F{Diff unavailable or unknown path?}
    F -->|Yes| D
    F -->|No| G[Enable matching domains]
    B --> H[Validate changed JSON/YAML]
    D --> I[Set GitHub step outputs]
    G --> I
    H --> I
    I --> J{Any domain enabled?}
    J -->|Yes| K[Setup Node and npm ci]
    J -->|No| L[Skip expensive setup]
    K --> M{Enabled domains}
    M -->|app| N[Typecheck lint test build]
    M -->|rules| O[Setup JDK and run rules tests]
    M -->|e2e| P[Install Chromium and run smoke tests]
    M -->|md or app| Q[Check Markdown links]
Loading

File-Level Changes

Change Details Files
Adds a fail-safe changed-file classifier that emits app, rules, end-to-end, Markdown, and aggregate gates for pull requests while preserving full execution on pushes to main.
  • Fetches full history and diffs the PR against its base branch.
  • Maps recognized paths to the appropriate validation domains and runs all domains for diff failures or unknown paths.
  • Performs JSON and optionally YAML validation during classification for configuration changes.
  • Exports boolean outputs used to gate downstream workflow steps.
.github/workflows/ci.yml
Gates dependency setup and expensive verification steps inside the single required Verify job.
  • Skips Node setup and npm ci when no domain is relevant.
  • Gates application checks, Java/rules tests, build, Playwright installation/tests, artifact upload, and Markdown link checks independently.
  • Retains Markdown link checking for Markdown or application changes and keeps the Verify check always present.
.github/workflows/ci.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@spizeck
spizeck merged commit e8c3a7e into main Sep 28, 2026
4 checks passed
@spizeck
spizeck deleted the chore/change-aware-ci branch September 28, 2026 00:25

This branch was successfully deployed

1 active deployment
Preview — f05b331a Deployed Sep 28, 2026 by vercel[bot]
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