Skip to content

CI: route CI architecture by branch pattern#4678

Open
tenfyzhong wants to merge 1 commit intopingcap:masterfrom
tenfyzhong:workflow/ci-arch-routing-4677
Open

CI: route CI architecture by branch pattern#4678
tenfyzhong wants to merge 1 commit intopingcap:masterfrom
tenfyzhong:workflow/ci-arch-routing-4677

Conversation

@tenfyzhong
Copy link
Copy Markdown
Collaborator

@tenfyzhong tenfyzhong commented Apr 1, 2026

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:

  • Update check_and_build.yaml to handle all three branch patterns:
    • master: classic + next-gen
    • release-[0-9].[0-9]*: classic only
    • release-nextgen-[0-9]*: next-gen only
  • Consolidate PR CI logic into pr_build_and_test.yaml with clear job-level conditions.
  • Remove duplicated pr_build_and_test_classic.yaml workflow.

Check List

Tests

  • No code
  • Manual test (YAML validation):
    • 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.yaml

Questions

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

None

Summary by CodeRabbit

  • Chores
    • Updated continuous integration workflows to support new release branch patterns and reorganized build and test matrix configurations for improved workflow management.

Signed-off-by: tenfyzhong <tenfy@tenfy.cn>
@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed labels Apr 1, 2026
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

The PR consolidates CI architecture routing by branch pattern across GitHub Actions workflows. Branch patterns are extended to support release-nextgen-*, the main PR workflow is refactored to split execution by architecture (classic vs nextgen) using job-level conditionals, and a separate classic workflow file is removed in favor of unified, branch-based routing logic.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Consolidation
.github/workflows/check_and_build.yaml, .github/workflows/pr_build_and_test.yaml
Extended branch patterns to include release-nextgen-[0-9]*. Refactored PR workflow to split three jobs (check, classic_build_and_test, nextgen_build_and_test) with architecture routing via branch-based conditionals and matrix task execution. Expanded mac_build matrix with classic and nextgen variants, each with corresponding build commands.
Workflow Deletion
.github/workflows/pr_build_and_test_classic.yaml
Removed entire classic-only PR workflow file, consolidating its logic into the unified pr_build_and_test.yaml with branch-conditional job selection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • pingcap/ticdc#4396: Implements equivalent CI-level changes splitting PR build workflows by target branch pattern with architecture routing via job conditionals.

Suggested labels

lgtm, approved, size/M

Suggested reviewers

  • lidezhu
  • 3AceShowHand

Poem

🐰 With workflows now unified by branch,
Classic and nextgen each find their perch,
No more duplication to maintain,
Just conditionals routing the CI chain,
Hopping forward with cleaner design! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template structure with Issue Number, problem statement, change explanation, tests section, and release note. All required sections are completed.
Linked Issues check ✅ Passed All acceptance criteria from issue #4677 are met: master runs both architectures, release-[0-9].[0-9]* runs classic only, release-nextgen-[0-9]* runs next-gen only, and workflows are centralized.
Out of Scope Changes check ✅ Passed All changes are scoped to GitHub Actions workflow files and directly address the objectives: modifying check_and_build.yaml, consolidating pr_build_and_test.yaml, and removing pr_build_and_test_classic.yaml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'CI: route CI architecture by branch pattern' accurately captures the main objective of the changeset, which consolidates branch-to-architecture routing across multiple GitHub Actions workflows.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ti-chi-bot ti-chi-bot Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 1, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 | 🔴 Critical

Remove matrix.task.architecture from the job-level if condition; the matrix context is not available at this stage.

The job-level if (lines 35–43) is evaluated before strategy.matrix is expanded, so matrix.task.architecture causes GitHub Actions to fail with an "Unrecognized named-value" error. The matrix context is only available in step-level if conditions, not job-level ones.

Split this into separate classic_build and nextgen_build jobs with branch guards using only the github context, or move the architecture-specific logic into step-level if conditions where matrix is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1858556 and cc21de3.

📒 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

@tenfyzhong tenfyzhong changed the title workflow: route CI architecture by branch pattern CI: route CI architecture by branch pattern Apr 2, 2026
@tenfyzhong
Copy link
Copy Markdown
Collaborator Author

/check-issue-triage-complete

@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Apr 2, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 21, 2026

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [3AceShowHand,lidezhu]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 21, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 21, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-02 04:15:39.844857827 +0000 UTC m=+411345.050217874: ☑️ agreed by lidezhu.
  • 2026-04-21 10:34:46.917526945 +0000 UTC m=+2075692.122887002: ☑️ agreed by 3AceShowHand.

@tenfyzhong
Copy link
Copy Markdown
Collaborator Author

/retest-required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Unify CI architecture routing by branch pattern

3 participants