chore(ci): replace Codecov with GitHub-native coverage reporting#335
Merged
rhuanbarreto merged 12 commits intoMay 24, 2026
Merged
Conversation
Codecov was unreliable and required an external service. Replace it with inline lcov parsing that posts coverage as a GitHub Actions job summary and a sticky PR comment via the gh CLI. - Parse lcov.info with awk for line coverage stats - Write per-directory breakdown to job summary - Post/update sticky PR comment (non-fork PRs only) - Remove codecov.yml config and codecov-action references - Simplify test:coverage script (drop JUnit reporter) - Switch release workflow to validate (no coverage needed) Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Contributor
Code Coverage
Full HTML report available in workflow artifacts. Per-directory breakdown
|
Deploying archgate-cli with
|
| Latest commit: |
c99e80c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7de37d5f.archgate-cli.pages.dev |
| Branch Preview URL: | https://chore-replace-codecov-with-g.archgate-cli.pages.dev |
Generate an interactive HTML coverage report via genhtml (lcov) and upload it as a GitHub Actions artifact (30-day retention). The PR comment and job summary now link to the artifact for detailed per-file coverage inspection. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
- Filter lcov.info to src/* via lcov --extract before genhtml, fixing permission errors from test temp dir paths (../../../tmp/...) - Use gh pr comment --edit-last instead of the issues REST API, which returned 404 because pull-requests:write does not cover it - Read coverage stats from the filtered lcov-src.info Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Add 19 tests exercising the check command's action handler via parseAsync(), covering: no project root, no rules, load errors, ExitPromptError re-throw, output format selection (console/JSON/CI), --verbose/--staged/--adr option forwarding, file arguments, agent context auto-JSON, exit code propagation, and telemetry tracking. Split into check-action.test.ts to stay within the 500-line limit. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Add 9 tests exercising the upgrade command's action handler via parseAsync(), covering: successful binary download and replace, telemetry tracking (success and failure), version comparison (already up-to-date, null fetch), unsupported platform, download failure with manual hint, ExitPromptError re-throw, and plugin update offer. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Add --coverage to the Windows smoke test and upload its lcov as an artifact. Move coverage reporting to a dedicated job that downloads both platform lcov files, normalizes Windows backslash paths, merges them with lcov --add-tracefile, and generates a combined HTML report. The PR comment and job summary now show merged cross-platform coverage with a "Platforms" row indicating which platforms contributed. If Windows coverage is unavailable (skipped/failed), the report gracefully falls back to Linux-only data. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
genhtml needs the source files to generate line-level coverage annotations in the HTML report. The coverage job was missing a checkout step, causing "does not exist" errors. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
The upgrade test hooks were imported via `import(...?t=${Date.now()})`
to get a "fresh module instance", but upgrade.ts has no module-level
state — all functions read process.execPath and env vars at call time.
The cache-bust created separate module instances that Bun's coverage
instrumenter couldn't attribute back to the source file, silently
dropping coverage from 17+ tests.
Switch to static imports in both upgrade.test.ts and
plugin/shared.test.ts. Also narrow discriminated union types that the
cache-bust was silently bypassing (returned `any`), and update the
JSDoc comment on the test hook exports.
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Add 12 tests covering the previously untested tryInstallPlugin function (0% → covered), exercising: no credentials, cursor marketplace URL, vscode auto-install, claude/copilot/opencode with CLI available/unavailable, and install failure fallback paths. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Add coverage notes explaining why private environment detection functions (detectCiProvider, detectShell, detectLocale) and PostHog SDK init/capture internals show 0% coverage: tests run with ARCHGATE_TELEMETRY=0 so the client is never initialized. These are validated via the PostHog dashboard, not unit tests. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Add skipComments: true to the max-lines rule in .oxlintrc.json so that comments and JSDoc blocks don't count toward the 500-line limit. Code documentation should never be penalized by line budget. Restores the full JSDoc on detectCiProvider that was trimmed to fit. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coverage/lcov.infowithawkfor per-directory line coverage stats, posts viaghCLIcodecov.ymlconfig and allcodecov-actionreferences from both workflowstest:coveragescript by dropping the JUnit reporter (was only used for Codecov test results)validate:coveragetovalidate(coverage is a PR concern, not a release concern)Cleanup note
The
CODECOV_TOKENsecret in GitHub repo settings (Settings > Secrets and variables > Actions) can be removed — it is no longer referenced.Test plan
bun run validate(no coverage step)