Skip to content

Run smoke matrix on push, full matrix on demand#14432

Open
marawan206 wants to merge 1 commit into
masterfrom
ci-trigger-policy
Open

Run smoke matrix on push, full matrix on demand#14432
marawan206 wants to merge 1 commit into
masterfrom
ci-trigger-policy

Conversation

@marawan206

Copy link
Copy Markdown
Contributor

Why

Right now every push to master runs the full GPU matrix (3× Python stable + nightly). As we expand coverage (more Python versions, more OSs), running everything on every commit gets too heavy. This separates a cheap per-commit signal from the on-demand full sweep.

What changes

A prepare job resolves the scope from the trigger and the rest of the matrix is driven from its output:

Trigger Scope What runs
push to master/release/** smoke Python 3.12 · stable · linux (one leg)
workflow_dispatch (default) full Python 3.10/3.11/3.12 · stable + 3.11 nightly · linux
workflow_dispatchscope: smoke smoke same as push

The full scope is exactly today's matrix — nothing is lost, it just moves behind a manual trigger so it can be run on demand (Actions → Run workflow → scope). This is the "trigger runs manually for a complete scope" mechanism we wanted.

Deliberately out of scope

This PR only changes triggering, not the version matrix. Updating Python/CUDA versions (drop 3.9/3.10, add 3.13, bump CUDA) depends on the self-hosted runners having the matching conda envs provisioned, and will be a separate PR that just edits the version arrays in the prepare job. Keeping the two concerns apart so this one is safe to land independently.

Notes / open question

  • prepare runs on ubuntu-latest; the test jobs still target the existing [self-hosted, Linux] runners and the existing comfy-action (CUDA stays the action default, 12.1).
  • The smoke config is Python 3.12 stable — easy to adjust if you'd rather keep all three stable versions on push. Open to feedback on where to draw the smoke/full line.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The test-ci workflow is refactored to support operator-selectable test scope via a new workflow_dispatch input. A prepare job resolves the chosen scope (smoke or full) into concrete test parameters: a list of stable Python versions and a boolean flag indicating whether nightly tests should run. The test-stable and test-unix-nightly jobs are rewritten to consume these parameters, run on fixed self-hosted Linux runners, and execute conditionally based on the scope selection.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: separating a lightweight smoke matrix run on push from a full matrix available on demand.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the motivation, implementation details, scope boundaries, and trigger behavior.
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.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-ci.yml:
- Around line 31-40: The workflow currently relies on default GITHUB_TOKEN
permissions; add an explicit least-privilege permissions block to harden the
workflow and the affected jobs (notably the prepare job that exposes outputs
stable_python and run_nightly and the other test jobs referenced). For example,
add a top-level permissions section (or per-job permissions for prepare and the
test jobs) granting only the minimal scopes needed (e.g., contents: read,
actions: read, checks: write if tests report statuses) and remove/override
default broad permissions; ensure any job that needs extra rights explicitly
requests them rather than inheriting defaults.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ddae71c1-8441-4019-861d-b0397df623f5

📥 Commits

Reviewing files that changed from the base of the PR and between 822aca1 and 1ff6f32.

📒 Files selected for processing (1)
  • .github/workflows/test-ci.yml

Comment on lines 31 to +40
jobs:
# Resolve the test scope from the trigger:
# push -> smoke (cheap per-commit signal on master)
# workflow_dispatch -> the scope chosen by the operator (defaults to full)
# Expanding coverage later (new Python versions, etc.) is a one-line edit to the JSON below.
prepare:
runs-on: ubuntu-latest
outputs:
stable_python: ${{ steps.scope.outputs.stable_python }}
run_nightly: ${{ steps.scope.outputs.run_nightly }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add explicit least-privilege permissions for this workflow/jobs.

The new prepare + refactored test jobs run with default token permissions because no permissions block is declared. This weakens CI hardening and is flagged in the changed regions. Please set explicit minimal permissions (workflow-level and/or per-job).

Suggested hardening patch
 name: Full Comfy CI Workflow Runs
 
+permissions:
+  contents: read
+
 on:
   push:
     branches:
       - master
       - release/**

Also applies to: 56-57, 76-77

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-ci.yml around lines 31 - 40, The workflow currently
relies on default GITHUB_TOKEN permissions; add an explicit least-privilege
permissions block to harden the workflow and the affected jobs (notably the
prepare job that exposes outputs stable_python and run_nightly and the other
test jobs referenced). For example, add a top-level permissions section (or
per-job permissions for prepare and the test jobs) granting only the minimal
scopes needed (e.g., contents: read, actions: read, checks: write if tests
report statuses) and remove/override default broad permissions; ensure any job
that needs extra rights explicitly requests them rather than inheriting
defaults.

Source: Linters/SAST tools

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