Skip to content

fix(go-pr-analysis): expose normalize_to_filter for component path collapsing - #627

Merged
bedatty merged 1 commit into
developfrom
fix/go-pr-analysis-normalize-to-filter
Jul 28, 2026
Merged

fix(go-pr-analysis): expose normalize_to_filter for component path collapsing#627
bedatty merged 1 commit into
developfrom
fix/go-pr-analysis-normalize-to-filter

Conversation

@bedatty

@bedatty bedatty commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

go-pr-analysis.yml calls the changed-paths composite, which already supports normalize-to-filter, but never wired the input up. As a result matrix.app.working_dir was always the path_level-trimmed directory of each changed file rather than the filter_paths entry that owns it.

Consequence: a PR whose changes sit deeper than path_level segments inside a filtered component — and that touches no shared_paths entry — spawns one matrix entry per changed subdirectory, rooted at that subdirectory. There is no Makefile and no testable package there, so:

  1. the tests job logs No packages found after filtering /tests/ and /api/ and writes no coverage.txt;
  2. Upload coverage artifact warns No files were found with the provided path: <subdir>/coverage.txt;
  3. every Coverage (<app>) job then fails with Unable to download artifact(s): Artifact not found for name: coverage-<app>.

Real occurrence in plugin-br-pix-switch (failed run) — the detected matrix was:

[{"name":"plugin-br-pix-switch-dict","working_dir":"apps/dict/components/hub/api/bootstrap"},
 {"name":"plugin-br-pix-switch-dict","working_dir":"apps/dict/components/hub/api/docs"},
 {"name":"plugin-br-pix-switch-dict","working_dir":"apps/dict/components/hub/api/services/command"}]

instead of the single apps/dict/components/hub/api component that is declared in filter_paths. Earlier PRs on the same repo were green only because they happened to touch a shared_paths entry (Makefile), which makes changed-paths build the matrix straight from filter_paths.

This PR:

  • adds the normalize_to_filter input to go-pr-analysis.yml and forwards it to the composite;
  • forwards the same input through the go-pr-validation.yml umbrella so callers can opt out;
  • documents it in docs/go-pr-analysis-workflow.md and docs/go-pr-validation.md.

Default is true, matching frontend-pr-analysis.yml, which already exposes this exact input for this exact failure mode.

Known adjacent issue, deliberately out of scope

The coverage artifact is keyed as coverage-${{ matrix.app.name }}, and several components of the same app share one matrix.app.name (it is extracted from the path_level segments). Their uploads therefore collide, and each Coverage job grades whichever component uploaded last. Keying the artifact per component is not part of this PR because it would surface a second latent problem at the same time: components with no unit-testable package produce no coverage.txt, which yields coverage=0 and trips Check coverage threshold — today masked by exactly that collision. Fixing it requires deciding whether "no coverage produced" is a skip or a failure, so it belongs in its own PR. A follow-up issue will be opened.

Type of Change

  • feat: New workflow or new input/output/step in an existing workflow
  • fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)
  • perf: Performance improvement (e.g. caching, parallelism, reduced steps)
  • refactor: Internal restructuring with no behavior change
  • docs: Documentation only (README, docs/, inline comments)
  • ci: Changes to self-CI (workflows under .github/workflows/ that run on this repo)
  • chore: Dependency bumps, config updates, maintenance
  • test: Adding or updating tests
  • BREAKING CHANGE: Callers must update their configuration after this PR

Breaking Changes

None for callers' configuration — the input is additive and every existing input keeps its default.

Behavior does change for monorepo callers that set filter_paths: working_dir is now the filter_paths entry instead of the deeper trimmed directory, and near-duplicate matrix entries for subdirectories of the same component collapse into one. That is the intended fix. A caller that depends on the previous behavior can restore it with normalize_to_filter: false.

Testing

  • YAML syntax validated locally (yamllint -c .yamllint.yml, plus a full YAML parse of both workflows — only pre-existing line-length/comments warnings)
  • Triggered a real workflow run on a caller repository using @this-branch or the beta tag
  • Verified all existing inputs still work with default values
  • Confirmed no secrets or tokens are printed in logs
  • Checked that unrelated workflows are not affected (frontend-pr-analysis.yml already had this input; no other workflow reads the go matrix)

Caller repo / workflow run: to be validated on LerianStudio/plugin-br-pix-switch PR #341 once this branch is available as a ref/tag — that PR is the failing case above.

Related Issues

N/A

…llapsing

The changed-paths composite already supports normalize-to-filter, but
go-pr-analysis never wired it up, so working_dir was always the
path_level-trimmed directory of each changed file. A change deeper than
path_level segments inside a filtered component spawned a matrix entry
rooted at that subdirectory, where no Makefile and no testable package
exist: the tests job produced no coverage.txt, the upload found no file,
and the coverage job failed with "Artifact not found".

Default to true, mirroring frontend-pr-analysis.yml, which already
exposes the same input for the same failure mode. go-pr-validation
forwards it so umbrella callers can opt out.
@bedatty
bedatty requested a review from a team as a code owner July 28, 2026 13:15
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 13 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 97877f7e-dbe3-4aa6-b8ef-d12dc426aa54

📥 Commits

Reviewing files that changed from the base of the PR and between 18bf26f and 008f4c7.

📒 Files selected for processing (4)
  • .github/workflows/go-pr-analysis.yml
  • .github/workflows/go-pr-validation.yml
  • docs/go-pr-analysis-workflow.md
  • docs/go-pr-validation.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/go-pr-analysis-normalize-to-filter

Comment @coderabbitai help to get the list of available commands.

@lerian-studio lerian-studio added size/XS PR changes < 50 lines documentation Improvements or additions to documentation workflow Changes to one or more reusable workflow files golang Changes to Go-related workflows validate Changes to PR validation composite actions (src/validate/) labels Jul 28, 2026
@lerian-studio

Copy link
Copy Markdown
Contributor

🔍 PR Validation Summary

✅ PR Mergeable — no blocking failures

Check Status Blocking
Source Branch ✅ success yes
PR Title ✅ success yes
PR Description ✅ success yes
PR Size ✅ success no
Auto Labels ✅ success no
PR Metadata ✅ success no

🔍 View workflow run

@lerian-studio

Copy link
Copy Markdown
Contributor

🔍 Lint Analysis

Check Files Scanned Status
YAML Lint 2 file(s) ✅ success
Action Lint 2 file(s) ✅ success
Pinned Actions 2 file(s) ✅ success
Markdown Link Check 2 file(s) ✅ success
Spelling Check 4 file(s) ✅ success
Shell Check 2 file(s) ✅ success
README Check 2 file(s) ✅ success
Composite Schema no changes ⏭️ skipped
Deployment Matrix no changes ⏭️ skipped

🔍 View full scan logs

@lerian-studio

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis Results

Languages analyzed: actions

✅ No security issues found.


🔍 View full scan logs | 🛡️ Security tab

@bedatty
bedatty merged commit 43a7ec7 into develop Jul 28, 2026
19 checks passed
@github-actions
github-actions Bot deleted the fix/go-pr-analysis-normalize-to-filter branch July 28, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation golang Changes to Go-related workflows size/XS PR changes < 50 lines validate Changes to PR validation composite actions (src/validate/) workflow Changes to one or more reusable workflow files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants