diff --git a/README.md b/README.md index 4b23131..2bd82bf 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/patch-it-dev/patch-it-plugins.svg)](https://pkg.go.dev/github.com/patch-it-dev/patch-it-plugins) [![Go version](https://img.shields.io/github/go-mod/go-version/patch-it-dev/patch-it-plugins)](go.mod) [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-3f5bf0)](LICENSE) -[![Plugins](https://img.shields.io/badge/plugins-23-3f5bf0)](docs/plugins.md) +[![Plugins](https://img.shields.io/badge/plugins-24-3f5bf0)](docs/plugins.md) [![Docs](https://img.shields.io/badge/docs-docs.patch--it.dev-3f5bf0)](https://docs.patch-it.dev) [![Discussions](https://img.shields.io/github/discussions/patch-it-dev/patch-it-plugins)](https://github.com/patch-it-dev/patch-it-plugins/discussions) diff --git a/docs/plugins.json b/docs/plugins.json index b76eb94..a54ff56 100644 --- a/docs/plugins.json +++ b/docs/plugins.json @@ -1,7 +1,7 @@ { "_comment": "Generated from the plugin registry and docs/plugins.md by `make plugins-json` (go run ./cmd/list-plugins). Don't edit by hand.", "$schema": "./plugins.schema.json", - "count": 23, + "count": 24, "plugins": [ { "id": "algolia-ingestion", @@ -123,6 +123,16 @@ "status": "live", "provider_page": "providers/mongodb-atlas.md" }, + { + "id": "newrelic", + "provider": "New Relic", + "layer": "sdk", + "watches": "Members removed in the New Relic Python agent 11.0.0", + "format": "removedmembers", + "source_url": "https://github.com/newrelic/docs-website/blob/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "status": "live", + "provider_page": "providers/newrelic.md" + }, { "id": "numpy", "provider": "NumPy", diff --git a/docs/plugins.md b/docs/plugins.md index 7e479fd..5797161 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -32,6 +32,7 @@ The table between the `plugins:start` and `plugins:end` markers is also publishe | [`redis`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/redis.md) | Redis | runtime | Commands removed entirely from Redis's own command catalog between two snapshots | `catalog` | [redis/redis-doc `commands.json`](https://github.com/redis/redis-doc/blob/master/commands.json) | live | | [`cloudflare`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/cloudflare.md) | Cloudflare | API | REST API operations Cloudflare deprecates, breaking on their end-of-life date when it gives one | `feed` | [Cloudflare API deprecations (RSS)](https://developers.cloudflare.com/fundamentals/api/reference/deprecations/index.xml) | live | | [`posthog`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/posthog.md) | PostHog | SDK | Members removed in the posthog Python SDK 8.0.0 | `removedmembers` | [posthog-python 7.x to 8.0 migration guide](https://github.com/PostHog/posthog-python/blob/posthog-v8.0.0/docs/migration-7.x-to-8.0.md) | live | +| [`newrelic`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/newrelic.md) | New Relic | SDK | Members removed in the New Relic Python agent 11.0.0 | `removedmembers` | [Python agent 11.0.0 release notes](https://github.com/newrelic/docs-website/blob/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx) | live | ## The columns @@ -46,4 +47,4 @@ The table between the `plugins:start` and `plugins:end` markers is also publishe | Source | The provider's own public page or file the plugin reads. Every event links back to it. | | Status | `live`: in the code on `main`. patch-it's hosted ingestion service runs it daily from the next release, which is cut automatically. `planned`: accepted, not written yet. `paused`: in the code but deliberately switched off, with the reason in the row. | -Some plugins read one pinned release (`anthropic` 1.0.0, `numpy` 2.0.0, `posthog` 8.0.0, `textual` 0.86.0, `urllib3` 2.0.0): a newer release of the same package is a new entry in that plugin, not a new row, unless it changes the format. +Some plugins read one pinned release (`anthropic` 1.0.0, `newrelic` 11.0.0, `numpy` 2.0.0, `posthog` 8.0.0, `textual` 0.86.0, `urllib3` 2.0.0): a newer release of the same package is a new entry in that plugin, not a new row, unless it changes the format. diff --git a/plugins/removedmembers/markdown.go b/plugins/removedmembers/markdown.go index e1c3869..dc44fdb 100644 --- a/plugins/removedmembers/markdown.go +++ b/plugins/removedmembers/markdown.go @@ -14,6 +14,8 @@ var ( // "§, §, and §" (each § a code span). nameList = regexp.MustCompile(`^§(?:(?:,| and|, and| or|, or) §)*$`) delimCell = regexp.MustCompile(`^:?-{3,}:?$`) + // A cell that is only a link around one code span: "[`name`](url)". + linkedSpan = regexp.MustCompile("^\\[(`[^`]+`)\\]\\([^()\\s]*\\)$") ) // parseMarkdown reads a Markdown pipe table: the first one under the heading @@ -24,7 +26,8 @@ var ( // cell is nothing but code spans naming members ("`A`, `B`"). A cell of prose // ("The `backoff` dependency") or a span that isn't a name code writes // ("`gzip=True`") drops the whole row; a name in g.EnvVars drops that name. The replacement is the second cell -// only when it's exactly one code span naming a member. +// only when it's exactly one code span naming a member, or a link around one; +// g.Paths applies to it as to the removed names. func parseMarkdown(page []byte, g Guide) ([]Removal, error) { lines := strings.Split(strings.ReplaceAll(string(page), "\r\n", "\n"), "\n") inFence := false @@ -88,6 +91,10 @@ func parseMarkdown(page []byte, g Guide) ([]Removal, error) { continue } repl := soleName(cells[1], g.Module) + replPath := repl + if p, ok := g.Paths[repl]; ok { + replPath = p + } for _, n := range names { r := Removal{Member: n, Guideline: guideline, Excerpt: excerpt} if p, ok := g.Paths[n]; ok { @@ -99,7 +106,7 @@ func parseMarkdown(page []byte, g Guide) ([]Removal, error) { case g.StillWork[n] != "": r.Dropped = g.StillWork[n] case repl != "" && repl != n: - r.Replacement = repl + r.Replacement = replPath } out = append(out, r) } @@ -181,10 +188,15 @@ func memberNames(cell, module string) (names []string, why string) { } // soleName is the cell's one name when the cell is exactly one code span -// naming a member, or "". +// naming a member, or a link around one ("[`name`](url)": New Relic's +// release notes link each replacement to its docs page), or "". func soleName(cell, module string) string { + cell = strings.TrimSpace(cell) + if l := linkedSpan.FindStringSubmatch(cell); l != nil { + cell = l[1] + } m := codeSpan.FindStringSubmatch(cell) - if m == nil || m[0] != strings.TrimSpace(cell) { + if m == nil || m[0] != cell { return "" } n, ok := cleanName(m[1], module) diff --git a/plugins/removedmembers/newrelic.go b/plugins/removedmembers/newrelic.go new file mode 100644 index 0000000..842197d --- /dev/null +++ b/plugins/removedmembers/newrelic.go @@ -0,0 +1,90 @@ +package removedmembers + +// NewRelic11 is New Relic's release note for the Python agent 11.0.0 (the +// `newrelic` package on PyPI), in newrelic/docs-website at commit +// f0b4f817bf9a7b76a78e26609369a8a7ce764c8e: that repo has no tags, so the +// commit stands in for one. Its "Removed features" section's first table, +// | Legacy API | Replacement API |: "The following APIs have been removed". +// Checked 2026-11-19. +// +// 11.0.0 is yanked on PyPI ("Issues with server-side configuration"); +// 11.0.1 has the same public API (newrelic/agent.py and newrelic/api/log.py +// are byte-identical at v11.0.0 and v11.0.1). The version stays 11.0.0, the +// release that made the change. +// +// Names are kept as code writes them after `import newrelic`: the table +// writes them bare, and Paths gives each its module. Every row was checked +// against the agent's code (newrelic/newrelic-python-agent, Apache-2.0) at +// v10.17.0, the release before, and v11.0.0. The six functions were +// re-exported by newrelic/agent.py, the documented way to call the agent's +// API (`import newrelic.agent`), and are gone from it and from their +// newrelic.api modules in 11.0.0. NewRelicLogHandler was only ever +// newrelic.api.log's, never re-exported by newrelic.agent. +// +// Rename or removal: the client applies a renamed_symbol as a rename, so only +// a drop-in replacement is one (DropIns). Its 8 rows: +// +// - `add_custom_parameter` | [`add_custom_attribute`](…): renamed_symbol +// agent.add_custom_parameter -> agent.add_custom_attribute. At v10.17.0 +// add_custom_parameter(key, value) only warns and returns +// add_custom_attribute(key, value), which newrelic.agent exports too. +// - `add_custom_parameters` | [`add_custom_attributes`](…): renamed_symbol +// agent.add_custom_parameters -> agent.add_custom_attributes, the same: +// add_custom_parameters(items) returns add_custom_attributes(items). +// - `accept_distributed_trace_payload` | [`accept_distributed_trace_headers`](…): +// removed_symbol. It takes New Relic's own trace payload (what +// create_distributed_trace_payload made); the replacement takes the +// request's headers (traceparent, tracestate, newrelic). Same argument +// positions, different data. +// - `create_distributed_trace_payload` | [`insert_distributed_trace_headers`](…): +// removed_symbol. It takes nothing and returns the payload; the +// replacement fills a list of headers passed in. +// - `get_browser_timing_footer` | The functionality of this has been wrapped +// into [`get_browser_timing_header()`](…): removed_symbol, prose. At +// v10.17.0 the footer already returns "" (and warns); renaming it to the +// header would put the header in a page twice. +// - `record_exception` | [`notice_error()`](…): removed_symbol. +// record_exception(exc, value, tb, params, ignore_errors, application) +// maps to notice_error(error=(exc, value, tb), attributes=params, +// ignore=ignore_errors, application=application): different arguments. +// - `NewRelicLogHandler` | `NewRelicLogForwardingHandler`: removed_symbol +// api.log.NewRelicLogHandler. The old handler takes a license key, a host +// and proxy settings and sends logs itself; the new one takes none of +// them and hands records to the agent's log forwarding. +// - `lambda_handler` & `LambdaHandlerWrapper` | These APIs have moved to the +// [`newrelic-lambda`](…) package: dropped (logged), as "&" isn't one of +// the list separators the reader takes. Both were in newrelic.agent at +// v10.17.0 and are gone at v11.0.0 (newrelic/api/lambda_handler.py with +// them), but the replacement is another package, which a symbol event +// can't say. +// +// 7 events. The section's second table, | Legacy Setting | Replacement +// Setting |, lists configuration settings (newrelic.ini keys), not members +// of the package: only the section's first table is read, so it never is. +var NewRelic11 = Guide{ + Package: "newrelic", + Module: "newrelic", + Release: "11.0.0", + Tag: "f0b4f817bf9a7b76a78e26609369a8a7ce764c8e", + Repo: "newrelic/docs-website", + Path: "src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + Section: "Removed features", + Format: FormatMarkdown, + Header: "Legacy API", + Doc: "release notes", + // The cells link to docs.newrelic.com by path ("/docs/agents/…"). + LinkBase: "https://docs.newrelic.com", + Paths: map[string]string{ + "accept_distributed_trace_payload": "agent.accept_distributed_trace_payload", + "add_custom_parameter": "agent.add_custom_parameter", + "add_custom_parameters": "agent.add_custom_parameters", + "create_distributed_trace_payload": "agent.create_distributed_trace_payload", + "get_browser_timing_footer": "agent.get_browser_timing_footer", + "record_exception": "agent.record_exception", + "NewRelicLogHandler": "api.log.NewRelicLogHandler", + // The two drop-in replacements, in newrelic.agent at v10.17.0. + "add_custom_attribute": "agent.add_custom_attribute", + "add_custom_attributes": "agent.add_custom_attributes", + }, + DropIns: []string{"agent.add_custom_parameter", "agent.add_custom_parameters"}, +} diff --git a/plugins/removedmembers/newrelic_test.go b/plugins/removedmembers/newrelic_test.go new file mode 100644 index 0000000..9102714 --- /dev/null +++ b/plugins/removedmembers/newrelic_test.go @@ -0,0 +1,251 @@ +package removedmembers + +import ( + "os" + "path/filepath" + "slices" + "strings" + "testing" + + "github.com/patch-it-dev/patch-it-plugins/event" + "github.com/patch-it-dev/patch-it-plugins/kit/kittest" +) + +// An excerpt of the release note at commit f0b4f817 (fetched 2026-11-19): the +// "Removed features" heading and its two tables, every kept line unchanged. +const newrelicSource = "testdata/python-agent-110000-f0b4f817.mdx" + +func TestNewRelicRegistersItself(t *testing.T) { + kittest.Registered(t, Plugin{Guide: NewRelic11}) +} + +// The golden test: the saved excerpt in, every event out. +func TestNewRelicGolden(t *testing.T) { + kittest.Golden(t, "testdata/golden/newrelic-11.0.0.json", newrelicIngest(t)) +} + +// Each of the "Legacy API" table's 8 rows, decided: a rename only for the two +// drop-in replacements (same arguments, and the old function only called the +// new one at v10.17.0); a removal, with the replacement in the hint, for the +// rest. +func TestNewRelicEachRowOfTheTable(t *testing.T) { + type want struct { + change event.PackageChange + replacement string + } + got := map[string]want{} + hints := map[string]string{} + for _, e := range newrelicIngest(t) { + if len(e.Subject.Symbols) != 1 { + t.Fatalf("%v: one symbol per event", e.Subject.Symbols) + } + if e.API != "newrelic" || e.Version != "11.0.0" || e.Subject.Ecosystem != "pypi" || e.Subject.Package != "newrelic" || + e.ChangeType != event.ChangeTypeBreaking || !strings.HasPrefix(e.SourceExcerpt, "Removed features\n | Legacy API ") || + !strings.HasSuffix(e.MigrationHint, "(newrelic's release notes for 11.0.0)") { + t.Errorf("%+v", e) + } + got[e.Subject.Symbols[0]] = want{e.Subject.Change, e.Subject.Replacement} + hints[e.Subject.Symbols[0]] = e.MigrationHint + } + removed := want{change: event.PackageRemovedSymbol} + expect := map[string]want{ + "agent.add_custom_parameter": {event.PackageRenamedSymbol, "agent.add_custom_attribute"}, + "agent.add_custom_parameters": {event.PackageRenamedSymbol, "agent.add_custom_attributes"}, + // One name each, but not drop-ins: different data or arguments. + "agent.accept_distributed_trace_payload": removed, + "agent.create_distributed_trace_payload": removed, + "agent.record_exception": removed, + "api.log.NewRelicLogHandler": removed, + // Prose: "wrapped into get_browser_timing_header()". + "agent.get_browser_timing_footer": removed, + } + if len(got) != len(expect) { + t.Errorf("%d events, want %d: %v", len(got), len(expect), got) + } + for sym, w := range expect { + if g, ok := got[sym]; !ok || g != w { + t.Errorf("%s: %+v, want %+v", sym, g, w) + } + } + // The removals still say what to use, in the guide's own words. + for sym, use := range map[string]string{ + "agent.record_exception": "`notice_error()`", + "api.log.NewRelicLogHandler": "`NewRelicLogForwardingHandler`", + } { + if !strings.Contains(hints[sym], use) { + t.Errorf("%s: hint %q doesn't name %s", sym, hints[sym], use) + } + } + // Every DropIns entry is a member the table removes: a typo would quietly + // turn its rename into a removal. + for _, d := range NewRelic11.DropIns { + if got[d].change != event.PackageRenamedSymbol { + t.Errorf("DropIns %q: not a rename (%+v)", d, got[d]) + } + } +} + +// The pinned drop test. The lambda row (two names joined by "&", moved to +// another package) and the section's settings table must give no event. Each +// is shown to be there and to read as names once its rule is off, so the test +// isn't vacuous. +func TestNewRelicDropsWhatIsNotARemovedMember(t *testing.T) { + var symbols []string + for _, e := range newrelicIngest(t) { + symbols = append(symbols, e.Subject.Symbols...) + symbols = append(symbols, e.Subject.Replacement) + } + page := string(kittest.Read(t, newrelicSource)) + + // The lambda row: read, and dropped. + rs, err := Parse([]byte(page), NewRelic11) + if err != nil { + t.Fatal(err) + } + var dropped []string + for _, r := range rs { + if r.Dropped != "" { + dropped = append(dropped, r.Member) + } + } + if !slices.Equal(dropped, []string{"`lambda_handler` & `LambdaHandlerWrapper`"}) { + t.Errorf("dropped %q, want only the lambda row", dropped) + } + // With "&" read as "and", it would be two removals. + asList := strings.Replace(page, "`lambda_handler` & `LambdaHandlerWrapper`", "`lambda_handler` and `LambdaHandlerWrapper`", 1) + if asList == page { + t.Fatal("no lambda row in the saved release note") + } + if names := readNames(t, asList, NewRelic11); !slices.Contains(names, "lambda_handler") || !slices.Contains(names, "LambdaHandlerWrapper") { + t.Errorf("with \"and\", the lambda row reads as %v: its drop proves nothing", names) + } + + // The settings table, read as if it were the APIs table (the APIs table + // cut out, its header named): its rows would be renames such as + // strip_exception_messages.whitelist -> .allowlist, wrong events about + // newrelic.ini keys. Only "the section's first table" keeps it out. + start := strings.Index(page, " | Legacy API") + end := strings.Index(page, "* Removes various deprecated settings") + if start < 0 || end < start { + t.Fatal("the saved release note's shape changed") + } + g := NewRelic11 + g.Header = "Legacy Setting" + settings, err := Parse([]byte(page[:start]+page[end:]), g) + if err != nil { + t.Fatal(err) + } + read := map[string]string{} + for _, r := range settings { + if r.Dropped == "" { + read[r.Member] = r.Replacement + } + } + if read["strip_exception_messages.whitelist"] != "strip_exception_messages.allowlist" || len(read) != 10 { + t.Errorf("the settings table reads as %v: its drop proves nothing", read) + } + for name := range read { + if slices.Contains(symbols, name) { + t.Errorf("an event names %q, a setting", name) + } + } + for _, name := range []string{"lambda_handler", "LambdaHandlerWrapper", "agent.lambda_handler", "agent.LambdaHandlerWrapper", "ssl"} { + if slices.Contains(symbols, name) { + t.Errorf("an event names %q", name) + } + } +} + +// A replacement cell that is a Markdown link around one code span is read as +// that name; a link inside prose, or around more than a code span, isn't. +func TestSoleNameReadsALinkedName(t *testing.T) { + for cell, want := range map[string]string{ + "`new_fn`": "new_fn", + "[`new_fn`](/docs/new-fn)": "new_fn", + " [`acme.new_fn()`](https://x.test/a) ": "new_fn", + "[`new_fn`](/docs/new-fn#anchor)": "new_fn", + "Use [`new_fn`](/docs/new-fn)": "", + "[`new_fn`](/docs/new-fn) instead": "", + "[the `new_fn` API](/docs/new-fn)": "", + "[`new_fn`]": "", + "[`x=1`](/docs/x)": "", + "[`a`](/a) and [`b`](/b)": "", + } { + if got := soleName(cell, "acme"); got != want { + t.Errorf("soleName(%q) = %q, want %q", cell, got, want) + } + } +} + +// Without DropIns every one-replacement row is a rename, as NumPy's are; with +// it, only the listed ones. Paths applies to the replacement as to the name. +func TestDropInsLimitsRenames(t *testing.T) { + page := strings.Join([]string{ + "## Removed", + "| Removed | Use instead |", + "| --- | --- |", + "| `old_a` | [`new_a`](/a) |", + "| `old_b` | `new_b` |", + }, "\n") + g := Guide{Package: "acme", Module: "acme", Release: "2.0.0", Repo: "acme/acme", Path: "MIGRATION.md", + Section: "Removed", Format: FormatMarkdown, Header: "Removed", + Paths: map[string]string{"old_a": "mod.old_a", "new_a": "mod.new_a"}} + run := func(g Guide) map[string]string { + out := map[string]string{} + for _, e := range kittest.Ingest(t, Plugin{Guide: g}, kittest.Pages{g.URL(): writeTemp(t, page)}) { + out[e.Subject.Symbols[0]] = string(e.Subject.Change) + " " + e.Subject.Replacement + } + return out + } + if got := run(g); got["mod.old_a"] != "renamed_symbol mod.new_a" || got["old_b"] != "renamed_symbol new_b" { + t.Errorf("no DropIns: %v", got) + } + g.DropIns = []string{"mod.old_a"} + if got := run(g); got["mod.old_a"] != "renamed_symbol mod.new_a" || got["old_b"] != "removed_symbol " { + t.Errorf("DropIns mod.old_a: %v", got) + } +} + +func writeTemp(t *testing.T, page string) string { + t.Helper() + f := filepath.Join(t.TempDir(), "guide.md") + if err := os.WriteFile(f, []byte(page), 0o644); err != nil { + t.Fatal(err) + } + return f +} + +func readNames(t *testing.T, page string, g Guide) []string { + t.Helper() + rs, err := Parse([]byte(page), g) + if err != nil { + t.Fatal(err) + } + var names []string + for _, r := range rs { + if r.Dropped == "" { + names = append(names, r.Member) + } + } + return names +} + +// newrelicIngest runs the plugin over the saved excerpt. +func newrelicIngest(t *testing.T) []event.EventV2 { + t.Helper() + return kittest.Ingest(t, Plugin{Guide: NewRelic11}, kittest.Pages{NewRelic11.URL(): newrelicSource}) +} + +// The hint is shown in a pull request or an issue, where a site-relative link +// breaks: LinkBase makes the guide's links absolute, and leaves the rest. +func TestAbsoluteLinks(t *testing.T) { + g := Guide{LinkBase: "https://docs.newrelic.com/"} + in := "Replacement API: [`notice_error()`](/docs/x/notice_error), see [here](https://example.test/y)" + want := "Replacement API: [`notice_error()`](https://docs.newrelic.com/docs/x/notice_error), see [here](https://example.test/y)" + if got := g.absoluteLinks(in); got != want { + t.Errorf("got %q, want %q", got, want) + } + if got := (Guide{}).absoluteLinks(in); got != in { + t.Errorf("no LinkBase changed the hint: %q", got) + } +} diff --git a/plugins/removedmembers/removedmembers.go b/plugins/removedmembers/removedmembers.go index 9aa4080..5dc6ccb 100644 --- a/plugins/removedmembers/removedmembers.go +++ b/plugins/removedmembers/removedmembers.go @@ -13,7 +13,7 @@ // opens as an issue: precision over recall. // // A guide's table is an RST simple table (NumPy) or a Markdown pipe table -// (PostHog, markdown.go). A Markdown row may list several members in one cell; +// (PostHog, New Relic, markdown.go). A Markdown row may list several members in one cell; // each is its own event, as each NumPy row is. A row the reader can't read as // members of the package (prose, an argument value, an environment variable) // is dropped and logged, never guessed at. @@ -24,6 +24,7 @@ import ( "fmt" "log" "regexp" + "slices" "strings" "github.com/patch-it-dev/patch-it-plugins/event" @@ -33,6 +34,7 @@ import ( func init() { plugin.Register(Plugin{Guide: NumPy2}) plugin.Register(Plugin{Guide: PostHog8}) + plugin.Register(Plugin{Guide: NewRelic11}) } // Guide is one package's guide to one release. @@ -73,7 +75,26 @@ type Guide struct { // it by, after Module ("EVENTS_ENDPOINT" -> "request.EVENTS_ENDPOINT"), // checked by hand against the package at the release before. A guide's // cell can list names that share a prefix only the first one spells out. + // It applies to a removed name and to a replacement alike. Paths map[string]string + // DropIns, when set, are the only removed members (as the events name + // them, after Paths) whose one replacement is a drop-in: it existed in the + // release before, at the same path, with the same call signature and + // behavior, checked by hand against the code. Only they become a + // renamed_symbol, which the client applies as a rename; every other row + // with one replacement is a removed_symbol, the replacement in the + // migration hint (the guide's own cell). nil leaves it to the table: every + // row with one replacement is a rename (NumPy's guide says each works on + // 1.x), unless NewReplacements. + DropIns []string + // Doc is what the hint calls the source: "'s for + // ". "" is "migration guide". + Doc string + // LinkBase makes the guide's site-relative links absolute in the hint + // ("](/docs/…)" -> "](/docs/…)"): the hint is shown outside the + // vendor's site, in a pull request or an issue, where a relative link + // breaks. "" leaves links as written. + LinkBase string // StillWork are names the table lists as removed but the same guide says // still work or have no effect: no event, with the guide's reason. StillWork map[string]string @@ -94,6 +115,13 @@ func (g Guide) tag() string { return "v" + g.Release } +func (g Guide) doc() string { + if g.Doc != "" { + return g.Doc + } + return "migration guide" +} + func (g Guide) header() string { if g.Header != "" { return g.Header @@ -239,7 +267,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) if g.Effect != "" { desc = fmt.Sprintf("%s.%s was removed in %s %s: %s.", g.Module, r.Member, g.Package, g.Release, g.Effect) } - if r.Replacement != "" && !g.NewReplacements { + if r.Replacement != "" && !g.NewReplacements && (g.DropIns == nil || slices.Contains(g.DropIns, r.Member)) { subject.Change, subject.Replacement = event.PackageRenamedSymbol, r.Replacement } e := event.EventV2{ @@ -249,7 +277,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) Breaking: true, Subject: subject, Description: desc, - MigrationHint: fmt.Sprintf("%s (%s's migration guide for %s)", r.Guideline, g.Package, g.Release), + MigrationHint: fmt.Sprintf("%s (%s's %s for %s)", g.absoluteLinks(r.Guideline), g.Package, g.doc(), g.Release), SourceURL: g.URL(), SourceExcerpt: r.Excerpt, Confidence: 1.0, @@ -269,3 +297,12 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) Baselines: []plugin.Spec{plugin.Baseline(g.Package, g.Release, g.tag(), g.URL(), page, false, now)}, }, nil } + +// absoluteLinks prefixes LinkBase to every Markdown link target in s that +// starts with "/". +func (g Guide) absoluteLinks(s string) string { + if g.LinkBase == "" { + return s + } + return strings.ReplaceAll(s, "](/", "]("+strings.TrimSuffix(g.LinkBase, "/")+"/") +} diff --git a/plugins/removedmembers/testdata/README.md b/plugins/removedmembers/testdata/README.md index 9ca57db..eed475a 100644 --- a/plugins/removedmembers/testdata/README.md +++ b/plugins/removedmembers/testdata/README.md @@ -6,3 +6,4 @@ The golden files under `golden/` are what the plugin stores from them (`go test |---|---|---|---|---| | `numpy_2_0_migration_guide-v2.0.0.rst` | https://github.com/numpy/numpy/blob/v2.0.0/doc/source/numpy_2_0_migration_guide.rst | 2026-11-04 | BSD-3-Clause (NumPy), kept whole | "The table below provides replacements for the removed members:" | | `migration-7.x-to-8.0-posthog-v8.0.0.md` | https://github.com/PostHog/posthog-python/blob/posthog-v8.0.0/docs/migration-7.x-to-8.0.md (commit 6edff41425188056e48f6119457dc9bc0669ca99) | 2026-11-19 | MIT (the repo's LICENSE is the MIT text, with two copyright lines, so GitHub's detector says NOASSERTION; PyPI says MIT), kept whole, byte for byte | "8.x.x removes these options and APIs:" (Fix removed APIs), with rows such as "\| `CaptureV1Error` \| `CaptureError` \|" | +| `python-agent-110000-f0b4f817.mdx` | https://github.com/newrelic/docs-website/blob/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx (the repo has no tags; the file's latest commit) | 2026-11-19 | Excerpt for testing; © New Relic, CC BY-NC-SA 4.0. Kept: the "## Removed features" heading, the bullets that introduce its two tables, the "Legacy API" table and the "Legacy Setting" table (lines 30-31 and 36-66 of 136), every line unchanged. Left out: the front matter, "Notes", the Python 3.7 bullet, and the "Deprecated features", "New features", "Bug fixes" and "Support statement" sections. The plugin finds the same 8 rows and 7 events in the excerpt as in the full file | "The following APIs have been removed:", with rows such as "\| `record_exception` \| [`notice_error()`](/docs/agents/python-agent/python-agent-api/notice_error) \|" | diff --git a/plugins/removedmembers/testdata/golden/newrelic-11.0.0.json b/plugins/removedmembers/testdata/golden/newrelic-11.0.0.json new file mode 100644 index 0000000..4d1544f --- /dev/null +++ b/plugins/removedmembers/testdata/golden/newrelic-11.0.0.json @@ -0,0 +1,165 @@ +[ + { + "id": 1, + "fingerprint": "sha256:a2f86cae07b29326ca93be5f66515f27d1040d5f189e103911dd93ba739e0b96", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "removed_symbol", + "symbols": [ + "agent.accept_distributed_trace_payload" + ] + }, + "description": "`agent.accept_distributed_trace_payload` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: [`accept_distributed_trace_headers`](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/acceptdistributedtraceheaders-python-agent-api) (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `accept_distributed_trace_payload` | [`accept_distributed_trace_headers`](/docs/agents/python-agent/python-agent-api/acceptdistributedtraceheaders-python-agent-api) |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 2, + "fingerprint": "sha256:dfc0f5f20b000248f48960b089533d37b2a98857ab86b34ef58bbadc2a79a331", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "renamed_symbol", + "symbols": [ + "agent.add_custom_parameter" + ], + "replacement": "agent.add_custom_attribute" + }, + "description": "`agent.add_custom_parameter` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: [`add_custom_attribute`](https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/addcustomattribute-python-agent-api) (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `add_custom_parameter` | [`add_custom_attribute`](/docs/apm/agents/python-agent/python-agent-api/addcustomattribute-python-agent-api) |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 3, + "fingerprint": "sha256:76b3c3353469c9b8fa468e742f019b0a625fba73be37263cec6db0c8a616a512", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "renamed_symbol", + "symbols": [ + "agent.add_custom_parameters" + ], + "replacement": "agent.add_custom_attributes" + }, + "description": "`agent.add_custom_parameters` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: [`add_custom_attributes`](https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/addcustomattributes-python-agent-api) (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `add_custom_parameters` | [`add_custom_attributes`](/docs/apm/agents/python-agent/python-agent-api/addcustomattributes-python-agent-api) |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 4, + "fingerprint": "sha256:cc82dac7778ed8efcd9e407d06f00b5bd3180f3c7d471363c6b5b0f55feaa6fa", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "removed_symbol", + "symbols": [ + "agent.create_distributed_trace_payload" + ] + }, + "description": "`agent.create_distributed_trace_payload` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: [`insert_distributed_trace_headers`](https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/insertdistributedtraceheaders-python-agent-api) (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `create_distributed_trace_payload` | [`insert_distributed_trace_headers`](/docs/apm/agents/python-agent/python-agent-api/insertdistributedtraceheaders-python-agent-api) |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 5, + "fingerprint": "sha256:c8d9b51b7477b5f17f7cd121463061fe58b21ebc7deeb51d64087eb84569b20a", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "removed_symbol", + "symbols": [ + "agent.get_browser_timing_footer" + ] + }, + "description": "`agent.get_browser_timing_footer` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: The functionality of this has been wrapped into [`get_browser_timing_header()`](https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/getbrowsertimingheader-python-agent-api) (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `get_browser_timing_footer` | The functionality of this has been wrapped into [`get_browser_timing_header()`](/docs/apm/agents/python-agent/python-agent-api/getbrowsertimingheader-python-agent-api) |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 6, + "fingerprint": "sha256:67f424f610fbafc21776c15219e51662c6f8b21d12db8039a104afe6a6ca6138", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "removed_symbol", + "symbols": [ + "agent.record_exception" + ] + }, + "description": "`agent.record_exception` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: [`notice_error()`](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/notice_error) (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `record_exception` | [`notice_error()`](/docs/agents/python-agent/python-agent-api/notice_error) |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 7, + "fingerprint": "sha256:8940a71ce47a561fd62c949d2b0ba691cd8b7f7d0a5fa8366dc5d56d411bfbf2", + "api": "newrelic", + "version": "11.0.0", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "package_release", + "ecosystem": "pypi", + "package": "newrelic", + "change": "removed_symbol", + "symbols": [ + "api.log.NewRelicLogHandler" + ] + }, + "description": "`api.log.NewRelicLogHandler` was removed in newrelic 11.0.0.", + "migration_hint": "Replacement API: `NewRelicLogForwardingHandler` (newrelic's release notes for 11.0.0)", + "source_url": "https://raw.githubusercontent.com/newrelic/docs-website/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx", + "source_excerpt": "Removed features\n | Legacy API | Replacement API |\n |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `NewRelicLogHandler` | `NewRelicLogForwardingHandler` |", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + } +] diff --git a/plugins/removedmembers/testdata/python-agent-110000-f0b4f817.mdx b/plugins/removedmembers/testdata/python-agent-110000-f0b4f817.mdx new file mode 100644 index 0000000..796b394 --- /dev/null +++ b/plugins/removedmembers/testdata/python-agent-110000-f0b4f817.mdx @@ -0,0 +1,33 @@ +## Removed features + +* Removes various deprecated APIs + + * The following APIs have been removed: + + | Legacy API | Replacement API | + |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `accept_distributed_trace_payload` | [`accept_distributed_trace_headers`](/docs/agents/python-agent/python-agent-api/acceptdistributedtraceheaders-python-agent-api) | + | `add_custom_parameter` | [`add_custom_attribute`](/docs/apm/agents/python-agent/python-agent-api/addcustomattribute-python-agent-api) | + | `add_custom_parameters` | [`add_custom_attributes`](/docs/apm/agents/python-agent/python-agent-api/addcustomattributes-python-agent-api) | + | `create_distributed_trace_payload` | [`insert_distributed_trace_headers`](/docs/apm/agents/python-agent/python-agent-api/insertdistributedtraceheaders-python-agent-api) | + | `get_browser_timing_footer` | The functionality of this has been wrapped into [`get_browser_timing_header()`](/docs/apm/agents/python-agent/python-agent-api/getbrowsertimingheader-python-agent-api) | + | `record_exception` | [`notice_error()`](/docs/agents/python-agent/python-agent-api/notice_error) | + | `NewRelicLogHandler` | `NewRelicLogForwardingHandler` | + | `lambda_handler` & `LambdaHandlerWrapper` | These APIs have moved to the [`newrelic-lambda`](/docs/serverless-function-monitoring/aws-lambda-monitoring/instrument-lambda-function/sdk-based-instrumentation/#python) package. | + +* Removes various deprecated settings + + * The following settings have been removed: + + | Legacy Setting | Replacement Setting | + |-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `transaction_tracer.capture_attributes` | [`transaction_tracer.attributes.enabled`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#cfg-tt-attributes-enabled) | + | `error_collector.capture_attributes` | [`error_collector.attributes.enabled`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#cfg-error-attributes-enabled) | + | `browser_monitoring.capture_attributes` | [`browser_monitoring.attributes.enabled`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#cfg-browser-attributes-enabled) | + | `analytics_events.enabled` | [`transaction_events.enabled`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#transaction-events-enabled) | + | `analytics_events.capture_attributes` | [`transaction_events.attributes.enabled`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#cfg-events-attributes-enabled) | + | `error_collector.ignore_errors` | [`error_collector.ignore_classes`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#error-ignore) | + | `strip_exception_messages.whitelist` | [`strip_exception_messages.allowlist`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#strip_exception_messages_allowlist) | + | `ssl` | This is now hardcoded to `true` so it has been removed as a setting option. | + | `ignored_params` | Use `newrelic.attributes.exclude = request.parameters.{name}` instead. Add each request parameter key to the `newrelic.attributes.exclude` list, delimited by commas. Be sure to prepend the key with `request.parameters`. | + | `agent_limits.merge_stats_maximum` | This is now completely ignored in favor of serverside config. | diff --git a/providers/README.md b/providers/README.md index daadf28..9e5821f 100644 --- a/providers/README.md +++ b/providers/README.md @@ -24,6 +24,7 @@ One page per plugin id: `providers/.md`. Start from [`_template.md`](_templ | [anthropic.md](anthropic.md) | `anthropic` | `migrationguide` | | [numpy.md](numpy.md) | `numpy` | `removedmembers` | | [posthog.md](posthog.md) | `posthog` | `removedmembers` | +| [newrelic.md](newrelic.md) | `newrelic` | `removedmembers` | | [textual.md](textual.md) | `textual` | `changelog` | | [urllib3.md](urllib3.md) | `urllib3` | `changelog` | | [github-actions.md](github-actions.md) | `github-actions` | `feed` | diff --git a/providers/newrelic.md b/providers/newrelic.md new file mode 100644 index 0000000..37b1a9e --- /dev/null +++ b/providers/newrelic.md @@ -0,0 +1,54 @@ +# New Relic (`newrelic`) + +## What it watches + +Functions and classes removed from New Relic's Python agent (the `newrelic` package) in 11.0.0: `newrelic.agent.record_exception`, `newrelic.agent.add_custom_parameter`, `newrelic.api.log.NewRelicLogHandler`, and others. Code that uses one breaks on the upgrade. The plugin emits one event per member, pinned to that release. + +Format plugin: `removedmembers` (`plugins/removedmembers`), reading a Markdown table. + +## Why this source + +- **Source:** [`python-agent-110000.mdx`](https://github.com/newrelic/docs-website/blob/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx) in newrelic/docs-website at commit `f0b4f817bf9a7b76a78e26609369a8a7ce764c8e` (2026-04-22, the file's latest commit). The plugin reads the raw file at that commit, because the repo has no tags. Checked on 2026-11-19. © New Relic, CC BY-NC-SA 4.0. +- **Why this one:** these are New Relic's own release notes for the agent's 11.0.0. Their "Removed features" section has a table of the APIs that 11.0.0 removed, with what to use instead. A commit never changes, so the URL is its own citation. 11.0.0 is a version a repo pins. +- **Alternatives considered:** + - **The REST API v2 spec**, (OpenAPI 3.0.1, 58 operations on 43 paths, fetched 2026-11-19). New Relic serves it only live and doesn't commit it anywhere, so there's no release to pin or replay. Its deprecations aren't machine-readable: it has 0 `deprecated: true` flags. Instead, 12 operation descriptions say "This endpoint will be deprecated after", 11 of them "2024/01" and 1 "2027/01". New Relic's own end-of-life notice for REST API v2 (below) contradicts those dates for 10 of the 12: it retires them on 2027-07-31. It keeps the other 2, on `/alerts_location_failure_conditions/policies/*`, as "Not impacted". + - **NerdGraph**, New Relic's GraphQL API. GraphQL schema changes don't fit patch-it's change-event contract, whose subjects are REST operations, models, package releases and CI runtimes. + - **The end-of-life notices**, `src/content/eol/` in newrelic/docs-website (29 notices from 2020/05 to 2026/10, read at `219285f0d25db0d4e8127fcf9a9c3279c8bbc9b9`): + - In 4 of the 29, `eolEffectiveDate` changed after the notice was first committed. One notice moved a month later, then two more months. One notice lost its date, which came back nine months later. + - One notice (the file `eol-chrome-140-node-22-synthetics.md`, whose text is about the Node.js 16 and Chrome 134 synthetics runtimes) was retitled "Update Forthcoming" and now points to a later notice. + - Only 1 of the 29 names REST operations, `eol-07-31-26-rest-api-v2.md`. The others are about agents, runtimes, images and product features, which have no operation or symbol to cite. + - **The Node.js agent's release notes** (newrelic/node-newrelic `NEWS.md`): it removed only 1 public API method in its last 8 majors, from v6.0.0 to v14.0.0 (`setIgnoreTransaction`, in v7.0.0). That's not enough to justify a plugin. +- **Quote:** "The following APIs have been removed:" (Removed features), with rows such as "| `add_custom_parameter` | [`add_custom_attribute`](/docs/apm/agents/python-agent/python-agent-api/addcustomattribute-python-agent-api) |". + +## How the provider announces changes + +- Package versions (SemVer). The Python agent releases about monthly. 11.0.0 shipped on 2025-09-25 and was yanked from PyPI ("Issues with server-side configuration"). 11.0.1 (2025-10-06) has the same public API: `newrelic/agent.py` and `newrelic/api/log.py` are byte-identical at v11.0.0 and v11.0.1. The events say 11.0.0, the release that made the change. +- **Forced on a fresh install** for an unpinned or open pin (`newrelic>=10`), otherwise when the team upgrades. +- Removals are deprecated first. At v10.17.0 every removed function warns with a `DeprecationWarning`; for the two distributed-trace functions the warning is in the `Transaction` method, so it fires only inside a transaction. + +## What the plugin reads and ignores + +- It reads the first table under "Removed features", `| Legacy API | Replacement API |`. The table writes names bare. The plugin writes them as code reaches them after `import newrelic`: `agent.record_exception` (the functions were re-exported by `newrelic.agent`) and `api.log.NewRelicLogHandler` (never in `newrelic.agent`). +- It emits `renamed_symbol` only for a drop-in replacement, because the patch-it client applies a rename as is. A drop-in has the same arguments and behavior and already existed in `newrelic.agent` at v10.17.0 (the `DropIns` field). Every other row is a `removed_symbol`, with the "Replacement API" cell in the hint. The plugin reads a replacement written as a Markdown link around a code span (`[`name`](url)`) as that name. The 8 rows, checked against the agent's code (newrelic/newrelic-python-agent, Apache-2.0) at v10.17.0 and v11.0.0: + + | Row | Event | + |---|---| + | `add_custom_parameter` → `add_custom_attribute` | `renamed_symbol` `agent.add_custom_parameter` → `agent.add_custom_attribute`. At v10.17.0, `add_custom_parameter(key, value)` only warns and returns `add_custom_attribute(key, value)` | + | `add_custom_parameters` → `add_custom_attributes` | `renamed_symbol` `agent.add_custom_parameters` → `agent.add_custom_attributes`. Same reason: `(items)` → `(items)` | + | `accept_distributed_trace_payload` → `accept_distributed_trace_headers` | `removed_symbol`. It takes New Relic's trace payload, and the replacement takes the request's headers | + | `create_distributed_trace_payload` → `insert_distributed_trace_headers` | `removed_symbol`. It takes nothing and returns a payload. The replacement fills a list of headers you pass it | + | `get_browser_timing_footer` → "wrapped into `get_browser_timing_header()`" | `removed_symbol`. The cell is prose, and at v10.17.0 the footer already returns `""`. Renaming it would put the header in a page twice | + | `record_exception` → `notice_error()` | `removed_symbol`. The arguments differ: `(exc, value, tb, params, ignore_errors)` vs `(error=(exc, value, tb), attributes=, ignore=)` | + | `NewRelicLogHandler` → `NewRelicLogForwardingHandler` | `removed_symbol` `api.log.NewRelicLogHandler`. The old handler takes a license key, host and proxy settings and sends logs itself. The new one takes none of them | + | `lambda_handler` & `LambdaHandlerWrapper` → moved to the `newrelic-lambda` package | Dropped and logged. The names are joined by "&", which the reader doesn't take as a list, and the replacement is another package | + + That gives 7 events. +- It ignores the section's second table, `| Legacy Setting | Replacement Setting |`. It lists `newrelic.ini` settings, not package members, and it isn't the section's first table. It also ignores the rest of the note: the "Deprecated features" settings, Python 3.7 support, and the new instrumentation. + +## Known gaps + +- **`lambda_handler` and `LambdaHandlerWrapper`** were both in `newrelic.agent` at v10.17.0 and are gone at v11.0.0, along with `newrelic/api/lambda_handler.py`. They get no event (see above). +- **The same functions reached another way** get no event: the `newrelic.api.transaction` and `newrelic.api.time_trace` definitions, and the methods of the same names on `Transaction` (`add_custom_parameter`, `record_exception`…). All were removed in 11.0.0 too. +- **The removed settings** (`ssl`, `error_collector.ignore_errors`, `strip_exception_messages.whitelist`…). They're configuration, not code, and change events have no subject for them. +- New Relic's REST API v2 end of life (2027-07-31) and NerdGraph (see above). +- New Relic's other agents, and later majors of the Python agent: each is a new entry in this plugin.