Skip to content

[COVAL-4730] Repair weekly CLI API parity automation - #108

Merged
callumreid merged 3 commits into
mainfrom
callum/coval-4730-weekly-cli-parity
Aug 12, 2026
Merged

[COVAL-4730] Repair weekly CLI API parity automation#108
callumreid merged 3 commits into
mainfrom
callum/coval-4730-weekly-cli-parity

Conversation

@callumreid

Copy link
Copy Markdown
Contributor

Summary

  • expose the newly published POST /metrics/{metric_id}/duplicate API as coval metrics duplicate
  • fail early with actionable diagnostics when the weekly PR or Homebrew publishing credentials are missing or unauthorized
  • refresh the live API coverage snapshot and prepare CLI v0.7.0 for release after merge
  • document the Monday parity workflow, credential recovery, and end-to-end CLI publishing procedure

Root cause

The scheduled workflow ran on August 3 and August 10, but REGEN_PR_TOKEN evaluated as empty, so peter-evans/create-pull-request stopped with Input 'token' not supplied. The secret record exists, but its presence does not prove that Actions receives a usable value. The latest run detected POST /metrics/{metric_id}/duplicate and then failed before it could open the rolling parity PR.

The release audit also found that GitHub release v0.6.0 exists while the Homebrew formula is still v0.5.0: HOMEBREW_TAP_TOKEN authenticated as a user without push access and the release failed with HTTP 403. This PR adds a permission preflight so future releases fail before building artifacts.

Validation

  • actionlint .github/workflows/*.yml
  • python -m unittest scripts/test_audit_api_coverage.py scripts/test_release_automation.py (31 passed)
  • ruff check scripts
  • ruff format --check scripts
  • python scripts/audit_api_coverage.py --write-markdown api-coverage-report.md (PASS: 119/175; 56 reviewed gaps)
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test (131 passed)
  • python scripts/release_version.py --expected-tag v0.7.0

Required out-of-band recovery

Before this is marked ready, replace REGEN_PR_TOKEN with a fine-grained token scoped to coval-ai/cli (Contents and Pull requests read/write), and replace HOMEBREW_TAP_TOKEN with one scoped to coval-ai/homebrew-tap (Contents read/write). Then manually dispatch the weekly parity workflow. Recovering the stale Homebrew v0.6.0 formula requires a separate explicit release dispatch; this PR does not dispatch, merge, tag, or publish anything.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@callumreid, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cdfa145-dcdc-417f-a528-3ce1aff9714f

📥 Commits

Reviewing files that changed from the base of the PR and between 124568e and e86806b.

📒 Files selected for processing (1)
  • .github/workflows/api-parity-audit.yml

Walkthrough

Added MetricsClient::duplicate and the metrics duplicate CLI command with integration coverage. Added credential and permission checks for REGEN_PR_TOKEN and HOMEBREW_TAP_TOKEN. Updated the package version, installation and release documentation, and API coverage records.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: repairing the weekly CLI API parity automation.
Description check ✅ Passed The description directly explains the CLI addition, credential checks, coverage refresh, release preparation, and documentation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@callumreid
callumreid marked this pull request as ready for review August 12, 2026 19:43

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/api-parity-audit.yml:
- Around line 48-56: Update the “Verify rolling PR credential” step to perform a
non-mutating API authorization check for REGEN_PR_TOKEN after validating it is
non-empty, confirming the token has contents: write and pull-requests: write
access to coval-ai/cli. Fail immediately with a clear error if the token is
revoked or lacks either permission, before create-pull-request runs.

In `@README.md`:
- Around line 251-253: Update the workflow verification instructions around gh
workflow run and gh run watch to capture the dispatched run URL/ID and pass that
run ID explicitly to gh run watch. Derive expected_version and expected_tag from
Cargo.toml, query the corresponding release with gh release view, and require
grep -F "version \"$expected_version\"" so the checked release matches the
expected version.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 4229ce8a-7061-4976-b6d0-be942dd76158

📥 Commits

Reviewing files that changed from the base of the PR and between dbd123a and 172f417.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .github/workflows/api-parity-audit.yml
  • .github/workflows/release.yml
  • Cargo.toml
  • README.md
  • api-coverage-report.md
  • api-coverage.toml
  • src/client/mod.rs
  • src/commands/metrics.rs
  • tests/cli_tests.rs

Comment thread .github/workflows/api-parity-audit.yml
Comment thread README.md Outdated

@borgesius borgesius left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trusting

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/api-parity-audit.yml:
- Around line 67-71: Define shared curl options for connection and total
transfer timeouts in the workflow, then apply them to each GitHub API call at
the repository, pull-request, and diff request sites. Reuse the same timeout
configuration consistently across all three calls, including the existing
api_headers arguments.
- Around line 91-93: Update both write-probe failure branches in the workflow to
classify non-422 responses before reporting missing permissions, using the HTTP
status, rate-limit headers, and a sanitized GitHub error body to distinguish
rate limiting, policy restrictions, and authorization failures. Preserve the
expected 422 handling, and apply identical classification behavior to both probe
paths rather than treating every non-422 response as insufficient access.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 12609726-24da-4ebc-9184-7600970209f6

📥 Commits

Reviewing files that changed from the base of the PR and between 172f417 and 124568e.

📒 Files selected for processing (2)
  • .github/workflows/api-parity-audit.yml
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

Comment thread .github/workflows/api-parity-audit.yml Outdated
Comment thread .github/workflows/api-parity-audit.yml
@callumreid
callumreid merged commit a3b753b into main Aug 12, 2026
7 checks passed
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