chore: improve product labeling for issues and changelogs - #33394
Open
mvvmm wants to merge 4 commits into
Open
Conversation
mvvmm
marked this pull request as ready for review
September 11, 2026 16:32
mvvmm
requested review from
a team,
MohamedH1998,
ahaywood and
colbywhite
as code owners
September 11, 2026 16:32
Contributor
Review
👉 Fix in your agent 👈Fix the following review findings in PR #33394 (https://github.com/cloudflare/cloudflare-docs/pull/33394).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.
---
## Code Review
### Warnings (1)
#### CR-ce3d3f6bd344 · Overly broad error handling
- **File:** `bin/generate-labeler.ts` line 82
- **Issue:** The bare `catch {}` around `loadYaml` treats every failure — including YAML parse errors (js-yaml throws `YAMLException` on malformed input) and non-ENOENT read errors — as "No directory entry", then silently drops the changelog label rule for that folder. A typo in a directory YAML would produce a misleading warning and silently omit labels from the generated labeler.yml.
- **Fix:** Only skip on file-not-found (e.g., check `error.code === 'ENOENT'` or use `readFile` with a null-handling helper); rethrow any other error so parse problems fail loudly instead of being masked.
### Suggestions (1)
#### CR-9c0f0f6685b6 · Unhandled URL parse error
- **File:** `bin/generate-labeler.ts` line 49
- **Issue:** `new URL(url).pathname` throws a TypeError on malformed absolute URLs (e.g., `https://` with no host). Since `firstUrlSegment` is also applied to `productLink` values in release-notes YAML and directory entry URLs, one malformed URL in the data crashes the whole generator instead of skipping that entry.
- **Fix:** Guard the URL conversion (e.g., wrap in try/catch and fall back to the raw string, or validate with `URL.canParse` before constructing).
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (1)
Suggestions (1)
ConventionsNo convention issues found. Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://chore-improve-product-labeling.previews.developers.cloudflare.com (commit 82cc056)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
Collaborator
Author
|
/rebase |
- readDir now fails loudly instead of returning [] on error, so a missing/renamed primary input dir aborts instead of silently dropping product rules and overwriting labeler.yml - refuse to write labeler.yml when no rules were generated - merge special rule globs with any existing rule instead of overwriting, so a future docs dir named changelog/email-routing wouldn't silently replace the special rule Regenerating also picks up src/assets/images/sandbox/** for product:sandbox (previously missed due to a stale working tree).
mvvmm
force-pushed
the
chore/improve-product-labeling
branch
from
September 11, 2026 17:31
137bf67 to
5ada10d
Compare
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
|
Preview URL: https://82cc0563.preview.developers.cloudflare.com |
- firstUrlSegment now normalizes absolute URLs via new URL().pathname, so an absolute entry.url/productLink no longer yields a bogus 'https:' segment - share the changelog folder alias map between content and image changelog mappings instead of only applying it to images - skip (with a warning) changelog folders that have no directory entry or no entry.url instead of crashing the generator
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
Improves product labeling across issues and PRs:
product:label, so/API/...producesproduct:apiinstead of creating a separateproduct:APIlabel.product:_headersandproduct:_redirects— those map root config files, not products.product:workers) and the existingproduct:changeloglabel.bin/generate-labeler.ts(pnpm run generate:labeler) that regenerates.github/labeler.ymlfrom the content collections. The labeler header previously claimed the file was generated but no generator was committed.The changelog mapping is derived from
src/content/directory/*.yamlentry.urlfirst segments (e.g. Zero Trust sub-products likeaccess,gateway,casbmap tocloudflare-one).Behavior note: deriving release-notes from
productLinkalso adds three previously-unlabeled release-notes files (workers.yaml,workflows.yaml,zaraz.yaml) to their product rules — a change to those files previously got no product label.