CI: route CI architecture by branch pattern#4678
CI: route CI architecture by branch pattern#4678tenfyzhong wants to merge 1 commit intopingcap:masterfrom
Conversation
Signed-off-by: tenfyzhong <tenfy@tenfy.cn>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
📝 WalkthroughWalkthroughThe PR consolidates CI architecture routing by branch pattern across GitHub Actions workflows. Branch patterns are extended to support Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/check_and_build.yaml (1)
34-72:⚠️ Potential issue | 🔴 CriticalRemove
matrix.task.architecturefrom the job-levelifcondition; the matrix context is not available at this stage.The job-level
if(lines 35–43) is evaluated beforestrategy.matrixis expanded, somatrix.task.architecturecauses GitHub Actions to fail with an "Unrecognized named-value" error. Thematrixcontext is only available in step-levelifconditions, not job-level ones.Split this into separate
classic_buildandnextgen_buildjobs with branch guards using only thegithubcontext, or move the architecture-specific logic into step-levelifconditions wherematrixis available.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/check_and_build.yaml around lines 34 - 72, The job-level if uses matrix.task.architecture which is unavailable at job-evaluation time; remove matrix references from the job-level if on "Mac OS Build - ${{ matrix.task.name }}" and either (A) split this into two jobs (e.g., classic_build and nextgen_build) that each use only the github context in their job-level if guards, or (B) keep a single matrix job but simplify the job-level if to use only github.* and move the architecture-specific conditions (matrix.task.architecture == 'classic' / 'nextgen') into step-level ifs (e.g., on the "$ {{ matrix.task.name }}" step) where the matrix context is valid.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.github/workflows/check_and_build.yaml:
- Around line 34-72: The job-level if uses matrix.task.architecture which is
unavailable at job-evaluation time; remove matrix references from the job-level
if on "Mac OS Build - ${{ matrix.task.name }}" and either (A) split this into
two jobs (e.g., classic_build and nextgen_build) that each use only the github
context in their job-level if guards, or (B) keep a single matrix job but
simplify the job-level if to use only github.* and move the
architecture-specific conditions (matrix.task.architecture == 'classic' /
'nextgen') into step-level ifs (e.g., on the "$ {{ matrix.task.name }}" step)
where the matrix context is valid.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9cfcfc10-8cc2-4e66-b7f4-632da930eb77
📒 Files selected for processing (3)
.github/workflows/check_and_build.yaml.github/workflows/pr_build_and_test.yaml.github/workflows/pr_build_and_test_classic.yaml
💤 Files with no reviewable changes (1)
- .github/workflows/pr_build_and_test_classic.yaml
|
/check-issue-triage-complete |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3AceShowHand, lidezhu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest-required |
What problem does this PR solve?
Issue Number: close #4677
What is changed and how it works?
This PR unifies branch-to-architecture routing in GitHub Actions workflows:
check_and_build.yamlto handle all three branch patterns:master: classic + next-genrelease-[0-9].[0-9]*: classic onlyrelease-nextgen-[0-9]*: next-gen onlypr_build_and_test.yamlwith clear job-level conditions.pr_build_and_test_classic.yamlworkflow.Check List
Tests
ruby -e "require 'yaml'; YAML.load_file('.github/workflows/check_and_build.yaml'); YAML.load_file('.github/workflows/pr_build_and_test.yaml')"git diff --check -- .github/workflows/check_and_build.yaml .github/workflows/pr_build_and_test.yamlQuestions
Will it cause performance regression or break compatibility?
No performance impact. Workflow routing behavior is intentionally updated to match the required branch rules.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note
Summary by CodeRabbit