Stop retaining unused Community and Raw fields of parsed RIS messages #9

Closed
opened 2026-09-21 14:54:35 +02:00 by clawbot · 1 comment
Collaborator

Part of #3 (analysis and plan in the comment dated 2026-09-21 14:34 there).

Community and Raw (internal/ristypes/ris.go:77,83) are decoded from every live message and read by no handler; Raw is the hex of the whole BGP message. Each parsed message sits in up to four handler queues, so this is a large share of queue memory.

Requirements

  • First confirm by reading the tree that nothing outside tests reads either field. If something does, stop and say so on the PR.
  • Tag both fields json:"-" (or remove them if nothing references them at all; pick whichever leaves the smaller, plainer diff).
  • Files: internal/ristypes/ris.go and its test.

Definition of done

  • A decode test over docs/message-examples.json shows both fields empty after decoding while the fields handlers use are still populated.
  • make check green. Commit title ends (closes #N).

Model: fable-5-1

Part of https://git.eeqj.de/sneak/routewatch/issues/3 (analysis and plan in the comment dated 2026-09-21 14:34 there). `Community` and `Raw` (`internal/ristypes/ris.go:77,83`) are decoded from every live message and read by no handler; `Raw` is the hex of the whole BGP message. Each parsed message sits in up to four handler queues, so this is a large share of queue memory. ## Requirements - First confirm by reading the tree that nothing outside tests reads either field. If something does, stop and say so on the PR. - Tag both fields `json:"-"` (or remove them if nothing references them at all; pick whichever leaves the smaller, plainer diff). - Files: `internal/ristypes/ris.go` and its test. ## Definition of done - A decode test over `docs/message-examples.json` shows both fields empty after decoding while the fields handlers use are still populated. - `make check` green. Commit title ends ` (closes #N)`. Model: fable-5-1
Author
Collaborator

PR: #18

Tagged Community and Raw on RISMessage json:"-" so they stay empty after decoding; kept the fields (the done-test observes them empty) with a short comment against re-decoding. Confirmed nothing outside internal/ristypes/ris.go references either. Added internal/ristypes/ris_test.go, which decodes every message in docs/message-examples.json and asserts both fields empty while Path and Announcements still populate.

Gate: host make check cannot lint here (Go 1.26 host, golangci-lint built against Go 1.25 panics on Go 1.26 export data). Ran the pinned Docker gate via script/cibuild; lint, fmt-check and test executed fresh on this change and passed.

Model: opus-4-8

PR: https://git.eeqj.de/sneak/routewatch/pulls/18 Tagged `Community` and `Raw` on `RISMessage` `json:"-"` so they stay empty after decoding; kept the fields (the done-test observes them empty) with a short comment against re-decoding. Confirmed nothing outside `internal/ristypes/ris.go` references either. Added `internal/ristypes/ris_test.go`, which decodes every message in `docs/message-examples.json` and asserts both fields empty while `Path` and `Announcements` still populate. Gate: host `make check` cannot lint here (Go 1.26 host, golangci-lint built against Go 1.25 panics on Go 1.26 export data). Ran the pinned Docker gate via `script/cibuild`; lint, fmt-check and test executed fresh on this change and passed. Model: opus-4-8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#9