Skip to content

Pause GitHub repository traffic collection - #572

Merged
Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-pause-github-traffic
Oct 29, 2026
Merged

Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-pause-github-traffic

Conversation

@soyalejolopez

Copy link
Copy Markdown
Member

Category

  • New resource (script, agent, guide, analytics, skill)
  • Update to an existing resource
  • Bug fix
  • Docs, site, or tooling

What's in this pull request?

Pauses the GitHub repository traffic step in the daily Collect Traffic Data workflow, so the run stops failing and issue #482 can close.

That step reads GitHub's traffic API (views, clones, referrers, popular paths, stars and forks), which needs a token with Administration read access. Organization policy limits fine-grained tokens to a few days, so the step has failed every day since 2026-07-22 and its alert issue (#482) has collected 100 daily "Still failing" comments. The data is not used by the site: card view counts come from Clarity (resource-stats.json records "views": "clarity"), and upvotes come from GitHub Discussions.

What changed

  • traffic-stats.yml: the GitHub traffic step now runs only when the repository variable COLLECT_GITHUB_TRAFFIC is true. When it is not, a notice step says collection is paused and how to resume. The Clarity and vote collection, staging, and weekly pull request are unchanged. A skipped step is neither a success nor a failure, so the existing conditions keep the run green when Clarity is healthy and still fail it when Clarity or staging is not. The alert step only fires on a failed GitHub step, so it stays quiet.
  • Resuming is reversible: set COLLECT_GITHUB_TRAFFIC to true and replace the TRAFFIC_TOKEN secret.
  • test-traffic-workflow.js: models the skipped state (it only knew success and failure), adds three combinations (paused with healthy Clarity stays green and persisted; paused with unhealthy Clarity or a staging failure still fails), and checks that the gate and the notice exist and that the notice is not an error.
  • traffic-data/README.md and CHANGELOG.md explain the pause and how to resume.

After merge: close #482. The daily run no longer comments on it.

Trade-off: GitHub keeps only 14 days of repository traffic, so views, clones and referrers are not recorded while paused. Clarity page analytics, which cover the GitHub Pages site, are unaffected.

Related issues

Closes #482 once merged and confirmed green.

Checklist

  • No private, customer-specific, or unlicensed content, and no secrets
  • README front matter is valid: npm ci --prefix tools/catalog-build && npm run check --prefix tools/catalog-build (passes)
  • version and updated were bumped (not applicable: no resource changed)
  • Installation and usage steps were tested (workflow conditions are covered by the updated test; the first real run happens after merge)
  • Files over 5 MB were avoided

See CONTRIBUTING.md for details.

The step needs a token with Administration read access, which organization policy expires every few days, so it failed daily and kept issue microsoft#482 open. It now runs only when the COLLECT_GITHUB_TRAFFIC repository variable is true and otherwise emits a notice. Clarity and vote collection, staging, and the weekly pull request are unchanged, and the workflow test now models a skipped step.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

⚠️ Traffic data collection is failing

2 participants