Skip to content

Warn about the catalog only when the catalog changed - #570

Merged
Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-build-warning-only-for-catalog
Oct 29, 2026
Merged

Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-build-warning-only-for-catalog

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?

Stops the Build catalog workflow from warning "Generated files are out of date" on every push to master.

After #565, the publish step rebuilds the catalog and resource stats, tries a direct push, and, when master rejects it, reports what is out of date. The rebuild always changes resource-stats.json, because that file is stamped with the time it was rendered (generatedAt), and its content is published through the weekly traffic pull request. So every run since #565 has warned, including the last three on master. The warning also made the new Friday housekeeping email report a rebuild as due every week.

I reproduced it on current master: a CI-equivalent rebuild changes only resource-stats.json (generatedAt and one resource that gained stats since the last weekly pull request). catalog.json, sitemap.xml, feed.xml, and r/ come out identical.

What changed

  • build-catalog.yml: when the direct push is rejected, the step warns only if catalog.json, sitemap.xml, feed.xml, or r/ changed. A stats-only difference is a notice ("Only resource stats changed. They are published by the weekly traffic pull request") and the step ends without writing the alarming summary. The step still tries the direct push first, so nothing changes if the policy is ever relaxed.
  • test-traffic-workflow.js: a check that the stats-only notice comes before the warning and that the step is classified by catalog files.
  • tools/catalog-build/README.md and CHANGELOG.md: describe the rule.

How it was tested

I ran the extracted step in a throwaway repository against remotes that reject and accept pushes:

  • Catalog files changed, push rejected: warning, summary listing the files, exit 0.
  • Only resource-stats.json changed, push rejected: notice only, no summary, exit 0.
  • Push accepted: commits and pushes as before.

npm run check passes.

Related issues

Follows #565. Part of the revamp tracked in #482.

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 (simulated all three push outcomes, see above)
  • Files over 5 MB were avoided

See CONTRIBUTING.md for details.

The Build catalog publish step rebuilt resource-stats.json on every push and warned that generated files were out of date, because the file is stamped with the render time and the weekly traffic pull request owns its content. It now reports a stats-only difference as a notice and warns only when catalog.json, sitemap.xml, feed.xml, or r/ changed. Adds a regression check and documents the behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@soyalejolopez
Alejandro Lopez (soyalejolopez) merged commit e51691d into microsoft:master Oct 29, 2026
5 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