Skip to content

Skip image builds and runtime tests for docs-only changes - #410

Closed
cooktheryan wants to merge 1 commit into
mainfrom
ci-docs-only-gating
Closed

cooktheryan wants to merge 1 commit into
mainfrom
ci-docs-only-gating

Conversation

@cooktheryan

@cooktheryan cooktheryan commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Documentation-only changes currently run image builds, Go tests, and the full Podman integration matrix. Add a shared lightweight Git change classifier and gate every runtime/image job on its result while keeping Sphinx validation active. Docs-only PRs/main pushes now skip heavy jobs and publication.

Treat docs/**, root Markdown, and Read the Docs config as documentation. Code, examples, dependency files, scripts, workflow/action changes, mixed changes, and unknown paths run the full suite. Scheduled/manual sample checks remain enabled; missing or empty Git comparisons conservatively run tests. Job-level gating preserves existing check names and avoids workflow-filter pending checks.

Validation: six classifier tests including real Git history and code-to-docs renames; actual PR #409 classifies runtime=false; actionlint; strict Sphinx build; diff checks. Verified that all existing job steps, matrices, permissions, and runner settings are preserved. This CI change itself runs the full checks.

Summary by Sourcery

Gate resource-intensive runtime and image CI jobs on a shared documentation-only change classifier while continuing lightweight validation for documentation changes.

New Features:

  • Add shared CI change-scope classification to identify documentation-only changes across GitHub Actions workflows.

Enhancements:

  • Skip runtime, image-building, integration, and publication jobs for documentation-only changes while conservatively running them for mixed, unknown, or unresolvable changes.
  • Preserve existing job names and runtime checks by applying job-level gating across CI workflows, including scheduled and manually triggered runs.
  • Classify documentation as docs paths, root Markdown files, and Read the Docs configuration while treating code-to-documentation renames as runtime changes.

CI:

  • Add unit coverage for documentation, mixed changes, Git history, merge-base comparisons, null-delimited paths, and renames.

Signed-off-by: Ryan Cook <rcook@redhat.com>
@sourcery-ai

sourcery-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Sorry @cooktheryan, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a reusable, conservative Git change-scope workflow and applies job-level gating across runtime-heavy CI and publication workflows, so documentation-only changes continue to run Sphinx validation while skipping image builds, Go tests, integration matrices, and publishing without changing existing check identities or runtime job configuration.

Sequence diagram for CI change classification

sequenceDiagram
    participant GitHub
    participant Scope as ci-scope workflow
    participant Git as Git repository
    participant Classifier as ci-change-scope.py
    participant Jobs as Runtime/image jobs
    participant Docs as Sphinx validation

    GitHub->>Scope: workflow_call
    Scope->>Git: checkout fetch-depth=0
    Scope->>Scope: Test change classification
    Scope->>Classifier: runtime_required(CI_EVENT, CI_BASE, CI_HEAD)
    Classifier->>Git: git merge-base(base, head)
    Classifier->>Git: git diff --name-only --no-renames
    Git-->>Classifier: changed paths
    Classifier-->>Scope: runtime=true or runtime=false
    Scope-->>GitHub: runtime output
    alt runtime=false
        GitHub->>Docs: run Sphinx validation
        GitHub-->>Jobs: skip runtime/image jobs
    else runtime=true
        GitHub->>Jobs: run builds and runtime tests
        Jobs->>Publish: enable publication when event/ref permits
    end
Loading

File-Level Changes

Change Details Files
Add a reusable Git-based classifier that conservatively identifies documentation-only changes.
  • Classify docs/, root Markdown, and Read the Docs config as documentation.
  • Treat code, examples, dependencies, scripts, CI files, mixed changes, renames, unknown paths, and incomplete comparisons as runtime-required.
  • Use merge-base for pull requests and null-delimited Git diffs for robust path handling.
  • Add unit coverage for classification rules, real Git history, missing history, and code-to-docs renames.
.github/workflows/ci-scope.yml
scripts/ci-change-scope.py
tests/ci/test_change_scope.py
Gate image builds, Go tests, integration matrices, artifact jobs, and publication on the shared runtime classification result.
  • Invoke the reusable scope workflow from all runtime-heavy workflows.
  • Add job-level needs/if conditions while preserving existing job names, matrices, permissions, runners, and steps.
  • Keep schedule/manual sample behavior and publication event restrictions intact.
  • Ensure skipped runtime jobs do not create workflow-filtered pending checks.
.github/workflows/docker-image.yml
.github/workflows/host-artifacts.yml
.github/workflows/quadlet.yml
.github/workflows/sample-apps.yml
.github/workflows/sops.yml
.github/workflows/unit-tests.yml
Preserve documentation validation while optimizing docs-only CI execution.
  • Leave Sphinx documentation validation active for documentation-only changes.
  • Skip runtime/image publication work when the classifier returns false.
  • Retain conservative full-suite behavior for unsupported events and missing or empty Git baselines.
  • Validate the workflow changes with classifier tests, actionlint, strict Sphinx builds, and diff checks.
.github/workflows/ci-scope.yml
.github/workflows/docker-image.yml
.github/workflows/host-artifacts.yml
.github/workflows/quadlet.yml
.github/workflows/sample-apps.yml
.github/workflows/sops.yml
.github/workflows/unit-tests.yml
docs/release_notes.rst

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

@cooktheryan cooktheryan closed this Oct 8, 2026
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