Skip to content

[WIP] github-actions: Add branch-name suffixes for skipping CI stages#1302

Draft
shreeya-patel98 wants to merge 1 commit into
mainfrom
shreeya_skip_stages
Draft

[WIP] github-actions: Add branch-name suffixes for skipping CI stages#1302
shreeya-patel98 wants to merge 1 commit into
mainfrom
shreeya_skip_stages

Conversation

@shreeya-patel98

@shreeya-patel98 shreeya-patel98 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Add a closed-vocabulary suffix mechanism so users can control which kernelCI stages run, set entirely at push time via the branch name — no commit-message markers that survive into git history.

Supported suffixes (stackable in any order):
-no-kselftest skip kselftest execution + comparison
-no-ltp skip LTP execution + comparison
-no-tests skip both kselftest and LTP
-no-pr run full pipeline but don't create the PR
-pr-only skip build/boot/tests, only create the PR

Examples:
{shreeya}_ciqlts9_2-no-ltp skip LTP only
{shreeya}_ciqlts9_2-no-tests-no-pr skip tests AND skip PR creation
{shreeya}_ciqlts9_2-pr-only just open PR, no build/test

Trigger workflow parses suffixes by repeatedly stripping known tokens from the end of the branch name; the stripped form (head_ref_base) is saved alongside the un-stripped head_ref. Downstream base-branch regex extraction uses head_ref_base so suffix-bearing branches correctly resolve to a VALID_BASES entry; PR-list queries use the un-stripped head_ref to find the actual remote branch.

Build/boot get an explicit if: pr_only != 'true' gate. test-* and compare-* jobs auto-skip in pr_only mode via their existing skip_kselftests / skip_ltp / build.result == success conditions. create-pr gains an if clause that accepts skipped build/boot in pr_only mode and skips entirely in no_pr mode.

The existing commit-message markers ([skip ci], [skip kselftests], [skip ltp]) continue to work alongside the new suffix mechanism; deprecating them is left for a follow-up.

Backward-compatible: branches without suffixes have head_ref_base == head_ref, so all existing flows behave identically.

Copilot AI review requested due to automatic review settings June 8, 2026 12:17

Copilot AI 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.

Pull request overview

Adds a branch-name suffix mechanism to control which kernelCI stages run (and whether a PR is created), by parsing a closed set of suffix tokens in the trigger workflow and propagating derived metadata (including a suffix-stripped head_ref_base) to downstream jobs. This enables push-time control without commit-message markers persisting in history.

Changes:

  • Parse branch suffix tokens in the trigger workflow and emit pr_only, no_pr, and head_ref_base as metadata.
  • Update the main multiarch workflow to use head_ref_base for base-branch extraction and add pr_only/no_pr gating (including allowing PR creation when build/boot are intentionally skipped).
  • Extend PR body generation script to support an abbreviated “CI skipped” mode.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/kernel-build-and-test-multiarch.yml Propagates/uses head_ref_base, adds pr_only/no_pr gating, and adjusts PR creation + PR body argument handling.
.github/workflows/kernel-build-and-test-multiarch-trigger.yml Implements branch-suffix parsing and writes new metadata outputs for downstream stages.
.github/scripts/create-pr-body-multiarch.sh Adds --ci-skipped to render an abbreviated PR body for -pr-only runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +105 to +108
PR_ONLY=false
NO_PR=false
SKIP_CI_RAW="${PUSH_REF:-$HEAD_REF}"
while :; do
Comment on lines +1345 to 1349
# In pr_only mode the build/boot jobs are skipped, so no artifacts exist.
# Skip downloads to avoid failing on missing artifacts.
- name: Download kernel compilation logs (x86_64)
if: steps.detect_arch.outputs.has_x86_64 == 'true'
if: steps.detect_arch.outputs.has_x86_64 == 'true' && needs.pre-setup.outputs.pr_only != 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
@shreeya-patel98 shreeya-patel98 marked this pull request as draft June 8, 2026 12:27
Add a closed-vocabulary suffix mechanism so users can control which
kernelCI stages run, set entirely at push time via the branch name —
no commit-message markers that survive into git history.

Supported suffixes (stackable in any order):
  -no-kselftest   skip kselftest execution + comparison
  -no-ltp         skip LTP execution + comparison
  -no-tests       skip both kselftest and LTP
  -no-pr          run full pipeline but don't create the PR
  -pr-only        skip build/boot/tests, only create the PR

Examples:
  {shreeya}_ciqlts9_2-no-ltp           skip LTP only
  {shreeya}_ciqlts9_2-no-tests-no-pr   skip tests AND skip PR creation
  {shreeya}_ciqlts9_2-pr-only          just open PR, no build/test

Trigger workflow parses suffixes by repeatedly stripping known tokens
from the end of the branch name; the stripped form (head_ref_base) is
saved alongside the un-stripped head_ref. Downstream base-branch
regex extraction uses head_ref_base so suffix-bearing branches
correctly resolve to a VALID_BASES entry; PR-list queries use the
un-stripped head_ref to find the actual remote branch.

Build/boot get an explicit `if: pr_only != 'true'` gate. test-* and
compare-* jobs auto-skip in pr_only mode via their existing
skip_kselftests / skip_ltp / build.result == success conditions.
create-pr gains an `if` clause that accepts skipped build/boot in
pr_only mode and skips entirely in no_pr mode.

The existing commit-message markers ([skip ci], [skip kselftests],
[skip ltp]) continue to work alongside the new suffix mechanism;
deprecating them is left for a follow-up.

Backward-compatible: branches without suffixes have head_ref_base ==
head_ref, so all existing flows behave identically.

Signed-off-by: Shreeya Patel <spatel@ciq.com>
Copilot AI review requested due to automatic review settings June 10, 2026 13:12

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +1548 to +1551
# FIXME: revert to origin/main before merging — pointing at shreeya_skip_stages
# so testing picks up the --ci-skipped flag handling that isn't on main yet.
git fetch --depth=1 --no-tags origin shreeya_skip_stages
git checkout origin/shreeya_skip_stages -- .github/scripts/create-pr-body-multiarch.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants