Skip to content

ci: use matrix object (path + name) for module matrix - #170

Merged
davidcollom merged 3 commits into
mainfrom
ci/coverage-baseline
Oct 9, 2026
Merged

davidcollom merged 3 commits into
mainfrom
ci/coverage-baseline

Conversation

@davidcollom

Copy link
Copy Markdown
Owner

Problem

The last CI run on main (workflow ci.yaml) fails before any step runs. GitHub's workflow parser rejects the file:

Invalid workflow file: .github/workflows/ci.yaml#L1
Line 171, Col 17): Unexpected symbol: '|'. Located at position 15 within expression: matrix.module | replace('/', '-')

The workflow runs die in a single millisecond (created_at == updated_at, 0 jobs, no logs) because the workflow file fails to load — GitHub's expression parser does not allow | (pipe) on matrix.* references inside ${{ }}.

Fix

The CI matrix now uses matrix objects instead of bare strings. Each entry is { path, name }:

  • All go tooling (working-directory, go vet, go test, etc.) references matrix.module.path.
  • The coverage artifact name is derived from matrix.module.name (already hyphen-safe — module names use - not /).
  • No ${{ matrix.module | replace(...) }} expressions remain in the workflow.

This sidesteps the parser restriction entirely (no pipes inside ${{…}}) while keeping the matrix shape clean.

Verification

Validated locally before pushing:

  • Parsed the workflow file with PyYAML to confirm it is syntactically valid YAML.
  • Ran go vet ./... and go test ./... against pkg/utils with the new working-directory value to confirm the per-module commands still work end-to-end.

Tracking the CI run on this PR to confirm the green build on the merged result.

Copilot AI lite review requested due to automatic review settings October 9, 2026 13:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T13:34:45.998002Z bf88f79 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Replace the bare matrix string entries with objects that carry both a
Go module path (used for 'go test', coverage files, cache key) and an
artifact-safe name (used in the coverage-artifact upload). This removes
the need for any string replacement / pipe filter in expressions, and
makes adding a new module a single - { path, name } line.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Correct the CI matrix path from pkg/argo/rollouts to pkg/argo/roll.

1 open finding
What changed in this PR

Refactors CI module matrices to use {path, name} objects and expands REST config tests.

Changes:

  • Replaces pipe-based matrix expressions.
  • Adds coverage artifact generation.
  • Adds kubeconfig success and error-path tests.
  • CI references nonexistent pkg/argo/rollouts instead of pkg/argo/roll.
File Summary
.github/​workflows/​ci.yaml Updates module matrices and coverage handling; contains an incorrect module path.
pkg/​utils/​restconfig_test.go Adds REST config loading and invalid-path tests.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yaml
- { path: pkg/velero, name: pkg-velero }
- { path: pkg/argo/cd, name: pkg-argo-cd }
- { path: pkg/argo/events, name: pkg-argo-events }
- { path: pkg/argo/rollouts, name: pkg-argo-rollouts }

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf88f799dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yaml
- { path: pkg/velero, name: pkg-velero }
- { path: pkg/argo/cd, name: pkg-argo-cd }
- { path: pkg/argo/events, name: pkg-argo-events }
- { path: pkg/argo/rollouts, name: pkg-argo-rollouts }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Point the matrix at the existing rollout module

Use pkg/argo/roll here, as registered in go.work:15 and .github/modules.json:12; there is no pkg/argo/rollouts directory. I checked the exact fmt command, and gofmt -l pkg/argo/rollouts exits with status 2 and no such file or directory. Because the same nonexistent path appears in all five matrices, the prerequisite fmt/vet/lint jobs fail, the dependent test job is skipped, and the actual rollout module is no longer checked.

Useful? React with 👍 / 👎.

@davidcollom
davidcollom force-pushed the ci/coverage-baseline branch from bf88f79 to 7abdc7e Compare October 9, 2026 13:34
The Argo Rollouts module is the project's full name; the short
'roll' was always a placeholder. Rename the directory, update the
Go module path in go.mod, and update go.work to point at the new
location.

Also updates NewArgoRolloutsClient to the variable-indirection
pattern (var = func) so tests can inject a fake clientset. This
matches the pattern used in pkg/argo/events and pkg/argo/workflows
and is a prerequisite for the rollout test file.

The CI matrix on ci/coverage-baseline already references
'pkg/argo/rollouts'; this commit makes the module path actually
exist on disk so the matrix path resolves.
Copilot AI lite review requested due to automatic review settings October 9, 2026 13:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Update .github/modules.json and address or document the breaking Go module import-path change.

2 open findings

🧠 Review effort: Lite

Comment thread .github/workflows/ci.yaml
- { path: pkg/velero, name: pkg-velero }
- { path: pkg/argo/cd, name: pkg-argo-cd }
- { path: pkg/argo/events, name: pkg-argo-events }
- { path: pkg/argo/rollouts, name: pkg-argo-rollouts }
@davidcollom
davidcollom enabled auto-merge (squash) October 9, 2026 13:52
@davidcollom
davidcollom disabled auto-merge October 9, 2026 13:52
@davidcollom
davidcollom merged commit 1b6b8c6 into main Oct 9, 2026
65 checks passed
@davidcollom
davidcollom deleted the ci/coverage-baseline branch October 9, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants