Skip to content

add the cloudflare plugin - #108

Merged
brandonphelps1212 merged 3 commits into
mainfrom
cloudflare-plugin
Nov 19, 2026
Merged

brandonphelps1212 merged 3 commits into
mainfrom
cloudflare-plugin

Conversation

@brandonphelps1212

Copy link
Copy Markdown
Contributor

What this changes

Adds the cloudflare plugin, a new reader (CloudflareAPI) in the feed format plugin. Part of #67 (I10.4 · Watch Cloudflare), under #13.

  • Source: Cloudflare's API deprecations page, read as its RSS feed. It holds every announcement since 2020 (50 items). Events cite a Wayback Machine snapshot (kit.Cite), like the other feeds.
  • Reports: one api_operation event per operation an item lists under "Deprecated APIs:".
    • breaking, dated by the end of life, only when the item gives a full "End of life date:" and says the endpoints stop ("will no longer be available").
    • deprecation otherwise, dated by the deprecation date, else the item's publication date.
    • Operations are normalized to METHOD /path/{param}; the oldest items write GET zones/:zone_identifier/....
  • Drops and logs:
    • items with no "Deprecated APIs:" list (behavior, field and cipher changes);
    • items that tell direct API callers no action is required;
    • list items that aren't one operation, or whose text after the operation is a sentence about a value rather than a name.
  • On the saved feed: 114 events from 27 items (5 breaking, 109 deprecations), and 27 logged drops.

Checklist

  • Added to docs/plugins.md: new cloudflare row with status paused, like vercel (see notes). I compared the registered plugins with the table.
  • Every commit is signed off (git commit -s, DCO)
  • Golden test over a real saved copy of the source (plugins/feed/testdata/golden/cloudflare.json), the whole feed as saved on 2026-11-19
  • testdata/README.md lists the file: URL, date fetched, license (CC BY 4.0), quote
  • Pinned drop tests:
    • "Gateway Audit SSH rules" lists two operations, but only one value of one field goes away.
    • The Radar summary and timeseries groups item has an end-of-life date, but says direct API callers need no action.
  • providers/cloudflare.md written from providers/_template.md, including Why this source
  • Fetches only through env.Get / kit/
  • go build ./... && go vet ./... && gofmt -l . && go test -race ./... pass locally, and so does scripts/leak_guard.py --all.
  • Nothing private: no credentials, internal hosts, private links, customer names

Notes for the reviewer

  • Why the deprecations page and not Cloudflare's OpenAPI spec (cloudflare/api-schemas). I measured the spec over 39 snapshots, 2024-11 to 2026-11:

    • 477 operations left the spec and only 38 had been deprecated first.
    • 17 came back later, and 141 were path-parameter renames.
    • Without credentials every route returns the same authentication error, so there's no way to check from outside whether a removed endpoint still answers.

    The spec's deprecation flags do agree with the page: 56 of the 58 page operations still in the spec are flagged. Spec-based deprecations (321 flagged) could be a follow-up plugin, once we decide how to avoid reporting the same operation twice from two sources.

  • Breaking is deliberately strict. Of the 11 items with an end-of-life date, only 2 say the endpoints stop. So AMP/SXG and Zero Trust Devices are deprecations even though they may well be shutdowns. An independent review caught the first version treating every end-of-life date as breaking, including 4 Radar endpoints whose item says API callers need no action.

  • Historical change: the Legacy Registrar Domain Management API, deprecated 2026-04-10 with end of life 2026-09-27. It's in the golden file and pinned by TestCloudflareRegistrarEndOfLife. Its operations left Cloudflare's spec in October 2026.

  • paused: like vercel, the plugin runs in the hosted ingestion service once it's in a tagged release, and the row moves to live then.

  • Client side: these events are api_operation, versioned by date (2026-09-27), because Cloudflare's API has no versions. The patch-it client reads an api_operation event's version as a package version, so it can't place them yet. It needs a rule for date-versioned API events, like the one model retirements have. That change belongs in patch-it, not here.

🤖 Generated with Claude Code

Reads Cloudflare's API deprecations page as RSS and emits one
api_operation event per operation an item lists under "Deprecated
APIs:". Breaking, dated by the end of life, only when the item gives a
full end-of-life date and says the endpoints stop; otherwise a
deprecation. Items with no operation list, items telling direct API
callers no action is required, and list items that aren't one operation
are dropped and logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 1m 57s —— View job


⚠️ Merge after fixes. The rules are all met and everything passes, but one condition can wrongly turn a deprecation into breaking, so it should be tightened before merge.

Thanks for this, @brandonphelps1212. The PR is well researched: the comparison with the OpenAPI spec, the strict test for breaking, and two realistic drop tests are just what this repo asks for.

Rules

Rule Status Evidence
Plugin list (Rule 1) ✅ The new cloudflare row in docs/plugins.md is inside the markers, uses absolute links, and has status paused with a reason (same as vercel). The table has 14 rows, and I counted 14 plugin.Register calls. plugins/all and TestRegistersItself pass.
Provider page ✅ providers/cloudflare.md follows the template. Why this source has the link, the date checked (2026-11-19), why it's the best source, the alternatives not used (api-schemas, changelog, SDKs) and a quote. It's also listed in providers/README.md.
Golden test + quote ✅ testdata/golden/cloudflare.json is built from the full saved feed. testdata/README.md has the URL, the fetch time, CC BY 4.0 and a quote. Each event's Excerpt has the item title, the date line and the list item, and cites the source through kit.Cite/Wayback.
Drop test ✅ Two pinned tests: TestCloudflareValueDeprecationIsNoOperation (Gateway audit_ssh) and TestCloudflareNoActionForAPICallersIsNoEvent (Radar summary).
Fetch only via env ✅ The reader is pure parsing inside feed. There's no net/http, filesystem or database access.
Nothing private (Rule 2) ✅ The code, tests, docs, commit message and PR body contain no credentials, internal names or private links. leak_guard.py --all is clean.
Contract fixtures ✅ contract/fixtures/ is untouched.

Bugs

  • cfStops matches any line in the item (inline comment on plugins/feed/readers.go:276). Lines returns list items as well as paragraphs. So "parameter will be removed" under Affected APIs: counts as "the endpoints stop".
    • The "Cloudflare Mirage" item in the saved feed has exactly such lines. It stays a deprecation today only because its end-of-life date has no day ("January 2026").
    • If Cloudflare writes a full date there, its two /settings/mirage operations become breaking. The quote given as evidence would then be about a Pagerules setting, not those endpoints.
    • The current golden output is correct. This is a latent wrong-breaking path, and precision over recall applies.
    • Suggested fix: match the stop sentence only in <p> text outside the lists, or require it to mention the endpoints or APIs. Pin it with a TestCloudflareDates case.
    • I found this by reading the code; I didn't run it, because the sandbox only allows read access outside the repo.

Verified

  • go build ./...: ok
  • go vet ./...: no output
  • gofmt -l .: no output
  • go test -race ./...: all 19 packages ok, including plugins/feed
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"
  • The commit is signed off and keeps its co-author trailer.

Non-blocking (optional)

  • cfDeprecatedList uses FindStringSubmatch, so it reads only the first "Deprecated APIs:" list in an item. That's fine for the feed as saved. A short comment saying so would help whoever meets an item with two lists.
  • As you note, an extended end of life produces a second event with the new date, and the old one isn't withdrawn. That's documented under Known gaps, so nothing more is needed here.

Comment thread plugins/feed/readers.go Outdated
eolLine = l
case depLine == "" && cfDeprecated.MatchString(l):
depLine = l
case stopLine == "" && cfStops.MatchString(l):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Precision: cfStops is checked against every line of the item, not just the sentence about the deprecated endpoints. Lines returns list items too, so a line under "Affected APIs:" (or "Deprecated behavior:") that says a parameter "will be removed" is enough to make every operation in the item breaking.

This can already happen with one item in the saved feed. "Cloudflare Mirage" has End of life date: January 2026, and its Affected APIs list says "GET /zones/{zone_id}/pagerules/settings - Mirage will be removed from available settings." Today it stays a deprecation only because Date can't read a date that has only a month. If Cloudflare changes the date to, say, "January 31, 2026", both /settings/mirage operations become breaking. The stopLine quoted as evidence would then be about a Pagerules setting, not those endpoints. (I found this by reading the code with that input. I didn't run it.)

A possible fix: look for the stop sentence only in <p> paragraphs outside the item's lists, e.g. run Lines on the HTML with every <ul>…</ul> removed. Or require the line to mention the endpoints/APIs ("endpoints", "APIs") the way the Registrar and Zone Settings items do. A unit case in TestCloudflareDates with a full EOL date plus an Affected APIs list item saying "parameter will be removed" would pin it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@brandonphelps1212

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 42s —— View job


✅ Ready to merge. c2f8b11 fixes the one blocking bug from the last review. Every rule in AGENTS.md is met.

Thanks for the quick fix, @brandonphelps1212. You did what the review asked and added test cases for both versions of the problem.

Rules

Rule Status Evidence
Plugin list (Rule 1) ✅ The cloudflare row in docs/plugins.md is between plugins:start and plugins:end, uses absolute links, and has status paused (same as vercel). c2f8b11 doesn't change the plugin's id, source or status, so the row is still accurate.
Provider page ✅ providers/cloudflare.md follows _template.md. Why this source has the link, the date checked (2026-11-19), why it's the best source, the alternatives not used and a quote. It's listed in providers/README.md.
Golden test, data row, drop test, source on every event ✅ The golden test runs over the whole saved feed. testdata/README.md has the URL, the date, CC BY 4.0 and a quote. There are two pinned drop tests: Gateway audit_ssh, and Radar "no action is required". Every event cites the source through kit.Cite and quotes the title, the date line and the stop sentence. c2f8b11 doesn't touch golden/cloudflare.json, which is right: the saved feed's output doesn't change (see below).
Fetch only through env / kit ✅ The reader only parses text inside plugins/feed. It doesn't use net/http, the filesystem or a database.
Precision over recall ✅ The breaking path now needs a full end-of-life date and a <p> paragraph that says something stops and mentions endpoints/APIs/operations (readers.go:283-288).
Nothing private (Rule 2) ✅ The code, tests, docs, both commit messages and the PR body have no credentials, internal names, private links or customer names.
Commits ✅ Both commits are signed off, have lowercase imperative subjects, and keep the co-author trailer.

Blocking bugs

None.

Checking the fix against the saved feed (by reading the code):

  • Mirage. All its "will be removed" lines are <li> items (lines 287-302 of the feed), so they can't count as the stop sentence any more. The new TestCloudflareDates case pins this, with a full end-of-life date.
  • Zone Settings batch and Registrar. Their stop sentences are in <p> and say "endpoints", so they still match. The two breaking items stay the same.
  • Privacy Pass. "the current public-facing API will be removed" now counts as a stop sentence. The item has no end-of-life line, so it stays a deprecation and the golden file is unchanged.
  • Nested lists. No <li><p> appears anywhere in the feed, so cfParagraph can't pick up a list item.

Non-blocking suggestions (optional)

  • cfEndpoints also accepts a bare "API". A paragraph can say something other than the endpoints is going away and still mention "API". The Service Key item (feed line 203) is an example: "Service Key authentication for the Cloudflare API is deprecated and will be removed on September 30, 2026." That item has no "Deprecated APIs:" list, so it's dropped today. But if a future item put a sentence like that next to an operation list and a full end-of-life date, its operations would become breaking.
    • A tighter option is to require the subject of the sentence to be the endpoints. For example, match (endpoints?|APIs?)\s+will (no longer be|be removed), or check that "endpoints"/"API" comes before the stop verb.
    • That would still match the Registrar, Zone Settings and Privacy Pass sentences. Fine to leave as a follow-up.
  • The new comment on cfDeprecatedList covers the first-list-only note from last time. Thanks.

Tests

I can only read the code here, so I didn't build or run the tests. CI_go runs go build, go vet, gofmt -l and go test -race ./... on this PR. CI_leak_guard covers the internal-names check.


Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@brandonphelps1212

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 44s —— View job


✅ Ready to merge. be86d69 makes the non-blocking change suggested last time: a stop sentence now counts only when the endpoints, API or operations are what stops. The output for the saved feed doesn't change, and every rule in AGENTS.md is still met.

Thanks, @brandonphelps1212. Turning the Service Key sentence into a test case was a good way to pin it.

Rules

Rule Status Evidence
Plugin list (Rule 1) ✅ The cloudflare row in docs/plugins.md is between plugins:start and plugins:end, uses absolute links and has status paused. be86d69 doesn't change the id, source, what's watched or the status, so the row is still accurate.
Provider page ✅ providers/cloudflare.md follows _template.md. Why this source has the link, the date checked (2026-11-19), why it's the best source, the alternatives not used and a quote.
Golden test, data row, drop test, source on every event ✅ The golden test runs over the whole saved feed, and testdata/README.md has its row. There are two pinned drop tests. Every event cites the source through kit.Cite with a quote. be86d69 leaves golden/cloudflare.json alone, which is right because the output doesn't change (see below).
Fetch only through env / kit ✅ The change is one regexp and one condition in readers.go. It adds no I/O.
Precision over recall ✅ cfStops (readers.go:237) now needs endpoints?/APIs?/operations? right before "will no longer be available/accessible/served" or "will be removed/shut down/turned off". That's stricter than before.
Nothing private (Rule 2) ✅ The diff, the commit message and the test strings are clean.
Commits ✅ All three commits are signed off, have lowercase imperative subjects and keep the co-author trailer.

Blocking bugs

None.

I checked the new regexp against the saved feed by reading it, without running it:

  • Zone Settings batch (feed line 63, "the batch endpoints will no longer be available") and Registrar (line 190, "the legacy endpoints will no longer be available") still match. They're the 5 breaking events in the golden file.
  • Privacy Pass (line 670, "the current public-facing API will be removed") still matches. It has no end-of-life line, so it stays a deprecation.
  • Service Key (line 203) and the Mirage list items (lines 287–302) no longer match. The new TestCloudflareDates cases pin both.
  • DNS record type (line 235, "via update operations will no longer be supported") doesn't match, because "supported" isn't one of the stop verbs. That's correct: the item is about a behavior, not about endpoints going away.

Non-blocking suggestions (optional)

  • A correction to my last review. I said no <li><p> appears in the feed. That was wrong: the DNS record type item (lines 225–233) has two list items with <p> inside them, so cfParagraph does match text inside lists. Since be86d69 it doesn't matter, because the stop sentence has to have the endpoints as its subject. The comment "Only a paragraph counts" is a little too strong, though. You could remove <ul>…</ul> before running cfParagraph, or just reword the comment. This is fine as a follow-up.
  • "API will be removed" can still have a different subject. For example, "Service Key authentication for the Cloudflare API will be removed" would match. Nothing in the feed says that, and the item would also need an operation list and a full end-of-life date before anything became breaking. So this is only something to keep in mind.

Tests

I can only read code here, so I didn't build or run anything. CI_go runs go build, go vet, gofmt -l and go test -race ./... on this PR, and CI_leak_guard runs the internal-names check.

@brandonphelps1212
brandonphelps1212 merged commit e06d7ba into main Nov 19, 2026
4 checks passed
@brandonphelps1212
brandonphelps1212 deleted the cloudflare-plugin branch November 19, 2026 16:37
@brandonphelps1212 brandonphelps1212 mentioned this pull request Nov 19, 2026
15 tasks
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.

1 participant