Skip to content

ci: decouple verify-groups from test matrix#562

Merged
xdustinface merged 1 commit intov0.42-devfrom
ci/decouple-tests
Mar 19, 2026
Merged

ci: decouple verify-groups from test matrix#562
xdustinface merged 1 commit intov0.42-devfrom
ci/decouple-tests

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Mar 18, 2026

Move group listing into build-and-test.yml so test jobs start immediately instead of waiting for verify-groups to complete. verify-groups still runs in parallel as a validation guard.

Summary by CodeRabbit

  • Chores
    • Updated CI build workflow to use a fixed set of test groups (core, spv, wallet, ffi, rpc) instead of dynamic matrix generation.
    • Enhanced configuration validation to ensure hardcoded test groups remain synchronized with defined group settings.
    • Simplified workflow structure by decoupling downstream test jobs from dynamically generated inputs.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.35%. Comparing base (d5bec1e) to head (f9cedd1).
⚠️ Report is 11 commits behind head on v0.42-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##           v0.42-dev     #562      +/-   ##
=============================================
+ Coverage      66.13%   66.35%   +0.21%     
=============================================
  Files            311      311              
  Lines          64757    64976     +219     
=============================================
+ Hits           42829    43116     +287     
+ Misses         21928    21860      -68     
Flag Coverage Δ
core 75.13% <ø> (ø)
ffi 37.53% <ø> (+0.39%) ⬆️
rpc 28.28% <ø> (ø)
spv 81.10% <ø> (+0.29%) ⬆️
wallet 65.93% <ø> (+0.44%) ⬆️
see 65 files with indirect coverage changes

@xdustinface
Copy link
Collaborator Author

@CodeRabbit review

@xdustinface xdustinface marked this pull request as draft March 18, 2026 18:42
Move group listing into `build-and-test.yml` so test jobs start
immediately instead of waiting for `verify-groups` to complete.
`verify-groups` still runs in parallel as a validation guard.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

The PR transitions CI configuration from dynamic matrix generation to a static hardcoded approach. The verification script now validates that the hardcoded matrix in the workflow matches the expected group keys. The workflow_call input for groups is removed, and downstream jobs no longer receive dynamically generated group matrices.

Changes

Cohort / File(s) Summary
CI Verification Script
.github/scripts/ci_config.py
Updated verify_groups to parse the workflow file, extract the hardcoded group: [...] matrix list, and validate it matches keys from ci-groups.yml. Now enforces consistency between static matrix and configuration file.
Workflow Configuration
.github/workflows/build-and-test.yml, .github/workflows/rust.yml
Replaced dynamic matrix input with static list ["core", "spv", "wallet", "ffi", "rpc"]. Removed groups workflow_call input. Renamed verify-execution job to verify-groups and eliminated downstream needs dependencies and group matrix passing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hardcoded groups, now bright and clear,
No dynamic whimsy to fear!
The matrix stands static and true,
While verification keeps all aligned, through and through.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: decoupling the verify-groups job from the test matrix to improve CI workflow parallelization.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/decouple-tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@xdustinface xdustinface marked this pull request as ready for review March 19, 2026 04:06
@xdustinface
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@xdustinface
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
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.

🧹 Nitpick comments (2)
.github/workflows/rust.yml (1)

48-55: Re-check required GitHub checks after this rename/decoupling.

This PR makes the verification job independent from the OS jobs and also changes the check GitHub reports for that guard. If branch protection or merge-queue rules still reference the previous verification check, merges can hang on a missing status; if they only require the OS jobs, a failing Verify Test Groups run stops being a hard gate. Please update the required checks alongside this change.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/rust.yml around lines 48 - 55, The GitHub workflow
renamed/decoupled the verification job to "verify-groups" (name: "Verify Test
Groups", step invoking python .github/scripts/ci_config.py verify-groups), so
update any branch protection rules, required status checks, and merge-queue
rules that referenced the old verification check to reference this new check
name; locate references in repository/project settings and CI configuration
dashboards and replace the old check identifier with "Verify Test Groups" (or
the workflow identifier "verify-groups") so branch protection and merge queues
correctly reflect the new guard.
.github/scripts/ci_config.py (1)

99-117: Parse build-and-test.yml as YAML instead of regex.

This works with the current inline list, but it will false-fail on valid YAML refactors like block-sequence syntax or on an earlier unrelated group: key. Since pyyaml is already in use here, reading jobs.test.strategy.matrix.group directly is more robust.

♻️ Proposed refactor
-    try:
-        with open(workflow_file) as f:
-            content = f.read()
-    except FileNotFoundError:
-        github_error(f"Workflow file not found: {workflow_file}")
-        return 1
-
-    match = re.search(r'group:\s*\[([^\]]+)\]', content)
-    if not match:
-        github_error(f"No hardcoded group matrix found in {workflow_file}")
-        return 1
-
-    actual = sorted(
-        name.strip().strip('"').strip("'") for name in match.group(1).split(",")
-    )
+    workflow = load_yaml(workflow_file)
+    try:
+        actual = sorted(workflow["jobs"]["test"]["strategy"]["matrix"]["group"])
+    except (KeyError, TypeError):
+        github_error(f"No hardcoded group matrix found in {workflow_file}")
+        return 1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/scripts/ci_config.py around lines 99 - 117, The current check reads
.github/workflows/build-and-test.yml into content and uses
re.search('group:\s*\[([^\]]+)\]') to extract the hardcoded matrix which will
break on valid YAML refactors; instead parse the file with the project's YAML
loader (pyyaml) and read jobs -> test -> strategy -> matrix -> group to get the
actual list. Replace the regex block that computes actual (and the
FileNotFoundError handling) with YAML load of workflow_file, validate the
presence of jobs.test.strategy.matrix.group, coerce that node to a list of
strings, and then sort/compare to the expected groups variable; preserve
github_error(...) usage for missing or malformed nodes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/scripts/ci_config.py:
- Around line 99-117: The current check reads
.github/workflows/build-and-test.yml into content and uses
re.search('group:\s*\[([^\]]+)\]') to extract the hardcoded matrix which will
break on valid YAML refactors; instead parse the file with the project's YAML
loader (pyyaml) and read jobs -> test -> strategy -> matrix -> group to get the
actual list. Replace the regex block that computes actual (and the
FileNotFoundError handling) with YAML load of workflow_file, validate the
presence of jobs.test.strategy.matrix.group, coerce that node to a list of
strings, and then sort/compare to the expected groups variable; preserve
github_error(...) usage for missing or malformed nodes.

In @.github/workflows/rust.yml:
- Around line 48-55: The GitHub workflow renamed/decoupled the verification job
to "verify-groups" (name: "Verify Test Groups", step invoking python
.github/scripts/ci_config.py verify-groups), so update any branch protection
rules, required status checks, and merge-queue rules that referenced the old
verification check to reference this new check name; locate references in
repository/project settings and CI configuration dashboards and replace the old
check identifier with "Verify Test Groups" (or the workflow identifier
"verify-groups") so branch protection and merge queues correctly reflect the new
guard.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bdca7d52-5040-49a0-b15c-b3815b4d8962

📥 Commits

Reviewing files that changed from the base of the PR and between b144e22 and f9cedd1.

📒 Files selected for processing (3)
  • .github/scripts/ci_config.py
  • .github/workflows/build-and-test.yml
  • .github/workflows/rust.yml

@github-actions github-actions bot added the ready-for-review CodeRabbit has approved this PR label Mar 19, 2026
@xdustinface xdustinface merged commit 2e3da5c into v0.42-dev Mar 19, 2026
37 of 38 checks passed
@xdustinface xdustinface deleted the ci/decouple-tests branch March 19, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review CodeRabbit has approved this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant