-
Notifications
You must be signed in to change notification settings - Fork 10
github actions: Add automated CLK rebase workflow #838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add a new GitHub Actions workflow to automate the process of rebasing CLK kernel branches against upstream stable releases. The workflow: - Triggers on workflow_dispatch or repository_dispatch - Performs rebase using lt_rebase.sh from kernel-src-tree-tools - Builds the kernel (with virtme-ng compatible configuration tweaks) - Runs kernel selftests in a virtme-ng vm - Creates a pull request with build logs, test results, and config changes - Tracks test pass rates across rebase iterations Also modifies sync.yml to trigger the rebase workflow via repository_dispatch when stable branches receive updates, creating an end-to-end automation pipeline for keeping CLK branches synchronized with upstream stable releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive automation for rebasing CLK kernel branches against upstream stable releases. The workflow integrates with the existing sync workflow to create an end-to-end pipeline that automatically detects stable branch updates, performs rebases, builds and tests kernels, and creates pull requests with detailed results.
Changes:
- Modified sync.yml to detect when stable branches are updated and trigger the rebase workflow via repository_dispatch
- Added clk-rebase.yml workflow that performs automated rebasing, kernel building with virtme-ng configuration, selftest execution, and PR creation with test results and metrics tracking
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| .github/workflows/sync.yml | Added logic to detect changes after rebase and trigger CLK rebase workflow for stable branches via repository_dispatch API |
| .github/workflows/clk-rebase.yml | New comprehensive workflow that automates CLK kernel branch rebasing, building, testing, and PR creation with metrics tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| curl -L \ | ||
| -X POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| https://api.github.com/repos/${{ github.repository }}/dispatches \ | ||
| -d "{\"event_type\":\"stable-branch-updated\",\"client_payload\":{\"branch\":\"${{ matrix.branch }}\"}}" |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repository_dispatch API call doesn't check for errors. If the curl command fails (e.g., network issues, authentication problems), the workflow will continue silently without triggering the rebase workflow. Consider adding error handling to check the HTTP response status or use the -f flag with curl to fail on HTTP errors, combined with proper error checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a terrible idea
| # Create the PR | ||
| gh pr create \ | ||
| --title "[CIQ ${CLK_VERSION}] Rebase to v${STABLE_VERSION}" \ | ||
| --body-file /tmp/pr_body.md \ | ||
| --base ${CLK_NEXT_BRANCH} \ | ||
| --head ${TMP_CLK_NEXT_BRANCH} \ | ||
| --reviewer bmastbergen | ||
|
|
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gh pr create command doesn't handle the case where a PR from TMP_CLK_NEXT_BRANCH to CLK_NEXT_BRANCH already exists. If the workflow runs multiple times before a PR is merged, subsequent runs will fail at this step with an error about a PR already existing. Consider adding logic to check for existing PRs and either update them or skip PR creation with a message.
| # Create the PR | |
| gh pr create \ | |
| --title "[CIQ ${CLK_VERSION}] Rebase to v${STABLE_VERSION}" \ | |
| --body-file /tmp/pr_body.md \ | |
| --base ${CLK_NEXT_BRANCH} \ | |
| --head ${TMP_CLK_NEXT_BRANCH} \ | |
| --reviewer bmastbergen | |
| # Check for an existing open PR from TMP_CLK_NEXT_BRANCH to CLK_NEXT_BRANCH | |
| EXISTING_PR_NUMBER=$(gh pr list \ | |
| --base "${CLK_NEXT_BRANCH}" \ | |
| --head "${TMP_CLK_NEXT_BRANCH}" \ | |
| --state open \ | |
| --json number \ | |
| --jq '.[0].number' || true) | |
| if [ -n "${EXISTING_PR_NUMBER}" ]; then | |
| echo "Found existing PR #${EXISTING_PR_NUMBER} from ${TMP_CLK_NEXT_BRANCH} to ${CLK_NEXT_BRANCH}; updating title and body." | |
| gh pr edit "${EXISTING_PR_NUMBER}" \ | |
| --title "[CIQ ${CLK_VERSION}] Rebase to v${STABLE_VERSION}" \ | |
| --body-file /tmp/pr_body.md | |
| else | |
| echo "No existing PR from ${TMP_CLK_NEXT_BRANCH} to ${CLK_NEXT_BRANCH}; creating a new one." | |
| gh pr create \ | |
| --title "[CIQ ${CLK_VERSION}] Rebase to v${STABLE_VERSION}" \ | |
| --body-file /tmp/pr_body.md \ | |
| --base ${CLK_NEXT_BRANCH} \ | |
| --head ${TMP_CLK_NEXT_BRANCH} \ | |
| --reviewer bmastbergen | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a terrible idea
shreeya-patel98
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
|
@bmastbergen what do you think about making this work with the Kernel CI Workflow instead of having it's own PR creation or testing steps? |
@shreeya-patel98 Yea, eventually this should probably morph into using that. But I've actually been wondering if both the clk-rebase workflow and our build-and-test workflows shouldn't be converted over to use kt. For this workflow that could be as simple as something like 'kt checkout clk-6.12 && kt vm clk-6.12 --test'. And then use a common PR creation workflow. In the future..... |
| # need some config tweaks for vng | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VSOCKETS | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_VSOCKETS | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_VSOCKETS_COMMON | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_9P | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_9P_FD | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_9P_VIRTIO | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_FAILOVER | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_BLK_DEV_SD | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_SCSI_VIRTIO | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_NET | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_FAILOVER | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_CONSOLE | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_I6300ESB_WDT | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_BALLOON | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_MMIO | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_FUSE_FS | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_FS | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_OVERLAY_FS | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NETFS_SUPPORT | ||
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_9P_FS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just enable these by default?
I'm not found of 9P so I'm not keep on providing support BUT VIRTIO stuff seems pretty much like an easy win, and OVERLAY_FS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did wonder about just enabling these things by default. I'm not 100% we need all of these for our particular usecase, this is just all of the configs the vng turns on if I use it to create the config. TODO: investigate what is actually necessary here
PlaidCat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
Add a new GitHub Actions workflow to automate the process of rebasing CLK kernel branches against upstream stable releases. The workflow:
Also modifies sync.yml to trigger the rebase workflow via repository_dispatch when stable branches receive updates, creating an end-to-end automation pipeline for keeping CLK branches synchronized with upstream stable releases.