[WIP] github-actions: Add branch-name suffixes for skipping CI stages#1302
Draft
shreeya-patel98 wants to merge 1 commit into
Draft
[WIP] github-actions: Add branch-name suffixes for skipping CI stages#1302shreeya-patel98 wants to merge 1 commit into
shreeya-patel98 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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, andhead_ref_baseas metadata. - Update the main multiarch workflow to use
head_ref_basefor base-branch extraction and addpr_only/no_prgating (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 |
601e0f2 to
fc087dc
Compare
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>
fc087dc to
1c92f5f
Compare
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 |
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.
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-ltpskip LTP only{shreeya}_ciqlts9_2-no-tests-no-prskip tests AND skip PR creation{shreeya}_ciqlts9_2-pr-onlyjust open PR, no build/testTrigger 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 anifclause 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.