feat: publish secure dynamic repository metrics - #3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c4f7e2960
ℹ️ 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".
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write |
There was a problem hiding this comment.
Stop using the contents-only token for traffic metrics
On every watch, schedule, or manual execution, this permission block restricts GITHUB_TOKEN to repository contents, but the /traffic/views and /traffic/clones calls in fetch_snapshot() require read access to the repository Administration permission. Those requests therefore return 403 Resource not accessible by integration, terminating the renderer before the SVG can be pushed to the metrics branch.
Useful? React with 👍 / 👎.
|
|
||
|
|
||
| class RepositoryMetricsTests(unittest.TestCase): | ||
| def test_svg_is_white_privacy_safe_and_contains_requested_metrics(self) -> None: |
There was a problem hiding this comment.
Register the renderer tests in the repository checks
This new test module is not executed by any configured CI or release check: scripts/check.py runs selected named root-level suites and only performs discovery in package-specific and tests/e2e directories, so neither unit, contract, nor release loads tests.test_repository_metrics. Consequently, renderer regressions can pass every required repository check despite this test file existing; add the module to an appropriate check tier.
AGENTS.md reference: AGENTS.md:L22-L26
Useful? React with 👍 / 👎.
Summary
metricsbranch without embedding a long-lived tokenValidation
./scripts/trove-python scripts/check.py contract./scripts/trove-python -m unittest tests.test_repository_metrics -v./scripts/trove-python scripts/privacy_scan.py .actionlint .github/workflows/repository-metrics.yml