Repository navigation
docs: cite celeris symbols, not line numbers (configuration, middleware-traffic, websocket) - #104
Conversation
Refs #891 item 8 Refs #891 item 10
Refs #891 item 8 Refs #891 item 10
…eware-traffic and websocket Each path.go:N locator is now celeris/<path>.go (Symbol), looked up by blame to the celeris revision the line was written against and checked by declaration on celeris origin/main. Bare paths get the celeris/ prefix and their full repo path. The ratchet drops these three pages. Refs #891 item 8 Refs #891 item 10
…point at their own config files Refs #891 item 10
19a013a to
95bfa70
Compare
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 5
Warning This pull request changes a CodeRabbit configuration file. Because it comes from a fork or its author is not a repository collaborator, reviews use only the configuration from the target branch. The proposed configuration will take effect after it is merged. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
goceleris-docs | 20380a0 | Commit Preview URL Branch Preview URL |
Oct 19 2026, 10:57 AM |
…anges (failing first)
…d correct four mislabeled citations in configuration, middleware-traffic and websocket
…iguration and middleware-traffic
…ipt, the compression-level bullet names SetCompressionLevel
|
Merging with every required check green (build, coverage, CodeQL, codecov/patch, Workers Builds). The CodeRabbit review is advisory and had not finished. |
Replaces line-number celeris citations with symbol citations, in three pages. Draft. Stacked: PR 2 (#105) is based on this branch and PR 3 on PR 2. Base is goceleris/docs origin/main 7ecb763 (after #102).
#Nin this body means goceleris/celeris#N, except where it says goceleris/docs. The items are the checklist items of goceleris/celeris#891 numbered as the DOCSSITE PR does (item 8 and item 10 of the unticked list). The checklist issue stays open and its boxes are not ticked here.What changed
celeris/<path>.go(Symbol) in place ofpath.go:N[-M]. 165 of 515 locators on the site so far.celeris/prefix is the repository name and is kept. Bare citations in middleware-traffic.md (9) get the prefix and the full repository path (for exampleceleris/middleware/overload/config.go,celeris/observe/collector.go). Subdirectory-relative paths are expanded the same way.scripts/docs-symbol-citations.test.ts, run bybun test, which ci.yml already runs). It counts.go:Nlocators per page against an allowlist with exact counts, and it fails for a locator on any page that is not allowlisted, a count that drifts, or a continuation fragment on an unlisted page (shapes listed under Review round 1). This PR removes the three pages from the allowlist.How the symbols were chosen
git rev-list -1 --before). The declaration that covers the cited range in that revision was found with a go/ast tool, so fields (Config.MaxFormSize), methods (Conn.WriteMessage) and const-block entries (CompressionLevelDefault) are separate symbols. Doc comments are part of a declaration's span.WithDefaults)" after a locator), only the path is replaced, so there is no doubled name.doc.go30-32 and 41-44 in websocket.md, and idempotency.go 1-19 in middleware-traffic.md) have no declaration to name, so they cite the file only.Checks run in the first version (head 95bfa70, tree as 19a013a; current head and logs under Review round 1)
bun test scripts/docs-symbol-citations.test.tswith an empty allowlist fails on 20 pages (log work/test-failing-first.log in the lane).git checkoutof configuration.md (uncleaned) makes the page-offender test and the continuation test fail. Control B: oneceleris/middleware/websocket/conn.go:100line appended to websocket.md makes the offender test fail. Both restored; see work/controls-pr1.log.bun run validate,bun run build,bun run checkandbun testall exit 0bun testran 25 tests across 2 files. An earlier run on a610315 (logs ci-validate.log and siblings) also passed. verify_all.py on 19a013a: 177 citations on this tree, 0 bad (verify-all-pr1-final.log).config.go(Adaptive, Std) when the sentence was about bodylimit (Config.ContentLengthRequired) and idempotency (Config.Methods). Both corrected.lines? [0-9]+,line-number,line numberandL[0-9]+finds none.Review round 1 (head cb88174)
Refs #891 item 8. Findings of the first review, each with its evidence:
243-245(wrapped over two lines) and websocket.md:411and:985. Now symbols:Config.WithDefaultswithdefaultEngine;Conn.ReadMessagewithConn.ReadMessageReuse;Conn.SetReadDeadlinewithConn.SetWriteDeadline. The reviewer's grep, saved: work/r1/reviewer-grep-5a27611.log (7 lines on the old PR 3 head, 8 fragments counting the wrapped one). The same grep on the new head is empty, and.go:<digits>has 0 hits (work/r1/reviewer-grep-new-head.log).continuationLinesinscripts/docs-symbol-citations.test.ts) flags, on every page outside the allowlist: a backtickedN-Mrange or:N/:N-Mfragment after a.gopath on the same line; a comma list (x.go:1-2, 3-4); a wrapped line that starts withN-Mand a closing backtick (243-245)); and a wrapped line that starts with a backticked:NorN-Mright after a line that holds a.gopath. It does not flag a listen address such as:8080or:0unless that opens a line right after a.goline (reword such a line). A plain backticked number such as0is not flagged. Failing-first run: commit be14253 adds the detector and the new tests; before the page fixes it fails with configuration.md:116, websocket.md:131 and websocket.md:303 (work/r1/failing-first-pr1.log). Unit controls in the test file: eight leftover shapes must be flagged and:8080,:0, a bare backticked0and ordinary prose must not. Page controls (work/r1/controls-pr1.log): re-inserting:411in websocket.md fails the test, a wrapped:243` in configuration.md fails the test, restored and passing.Server.PauseAcceptfor the863-868range, which isServer.Collector(the sentence is aboutCollector()returning nil); it now citesConfig.DisableMetrics,NewandServer.Collector. middleware-traffic.md:507 citedConfig.StopContextforconfig.go:177, which isdefaultThresholds(stage table and thresholds): nowStageanddefaultThresholds. websocket.md:475 citedHub.Lenforhub.go:56, the doc comment ofHub(encode once per broadcast): nowHubandHub.Broadcast. websocket.md:637 citedConn.CloseHandler(the getter) forconn.go:1029, theCloseErrorcomment: nowConn.SetCloseHandlerandCloseError. The earlier statement in this body that863-868isServer.PauseAcceptwas wrong (I had looked it up on celeris main by hand, not at the revision of the docs line) and is corrected in the sections below.git log --reverse -S<text>on the page at 7ecb763) and re-resolves at that celeris revision. All 515 have an introducing commit; for 505 it is the same celeris revision as the blame resolution, for 10 it differs, and the top candidate differs for 1 (work/r1/introducing.log). The three wrong labels above are not in that diff: their blame and introducing revision agree, and the error was in the symbol I chose by hand where the automatic resolution had found nothing (hub.go, conn.go) or the wrong file (bareconfig.go). So this check alone does not discriminate. (2) work/r1/strict.py therefore compares the symbols that map.json cites against the declaration covering the range at the introducing revision. Of 515 rows, 498 cite symbols (17 are path-only), and 60 are flagged (work/r1/strict.log, work/r1/show.log). The control holds:Config.StopContext,Hub.LenandConn.CloseHandlerare among the flagged. Adjudication of the 60: 5 wrong, now corrected (the three above, plus middleware-traffic.md:577Thresholdsfor theDepthThresholdscomment, and middleware-traffic.md:496Controllerfor the overload.go package comment, now path-only); 6 correct as is (the const blocks ofStagex2,Protocol,EngineType,ClientPolicy, andConfig.Limitfor a sentence about theLimitfield whose locator pointed at theConfigtype comment); 49 name a symbol declared inside the cited range, of which three were widened because the range held more than one: middleware-traffic.md:721 nowErrBodyTooLargeandErrLengthRequired, engines.md capability sources (PR 3), performance.md:84Context.JSON(PR 2). (3) The nine continuation ranges that map.json does not carry were re-resolved at their introducing revisions (work/r1/contranges.log, contranges2.log):294-303isConfig.WithDefaults,317-326isresolveTimeout,279-284and276-278areConfig.WithDefaults,175-177isConfig.Validate,863-868isServer.Collector,243-245isConfig.WithDefaults,178-181isConfig.DisableMetrics,152-154isNew. configuration.md:58 now namesConfig.WithDefaultsandresolveTimeout.Config.OnConnectandConfig.OnDisconnect. The threeSources:lines (189, 342, 370) now name the fields of the old range (Config.ReadTimeout...Config.ShutdownTimeout; the three HTTP/2 fields;Config.DisableKeepAlive,Config.BufferSize,Config.SocketRecvBuf,Config.SocketSendBuf,Config.MaxConns). OtherConfigor<X>Configcitations that stay at type level (about 25 on the site) each head a field table for that type, and the type is the declaration that locates the table.Checks on head cb88174 (work/r1/):
bun run validate,bun run build,bun run checkandbun testexit 0 (ci-*-pr1-cb88174.log; 27 tests across 2 files);verify_all.py195 symbol citations, 0 bad (verify-all-pr1-cb88174.log). The checks above establish that a symbol exists in the cited file on celeris origin/main 13fa176 and that it covers the range at the introducing revision. They do not establish that a reader would pick the same symbol for the claim.Neighbours changed in the same pages
Newin one sentence ("singleflight.go:102-149, singleflight.go:143") are one citation now.294-303,317-326,276-278,863-868) are written as symbols or dropped, since they were line numbers too. The 863-868 range (server.go) isServer.Collectorat the revision of its docs line (this body first saidServer.PauseAccept; see Review round 1).Review round 2 (head 20380a0)
Refs #891 item 8. Merge of origin/main (0c840e2, #107) into this branch, then:
luaUndofor 'the script';luaUndois the refund script, the atomic token-bucket script isluaTokenBucket(//go:embed redisstore.lua). NowluaTokenBucket(withNew).SetCompressionLevel(range -2..9) but onlyConn.EnableWriteCompressionwas cited; both are named now.config.go:Nthat the first pass resolved against the rootconfig.go) were checked by hand against the middleware's own config.go; they are right in the pages. Every symbol on every page was checked to exist in its file on celeris main 13fa176.Checks on head 20380a0 (
bun install --frozen-lockfile,bun run validate,bun run build,bun run check,bun test): all exit 0, 27 tests (logs ci-*-pr1.log in the lane).Open points (not blocking)
Server.PauseAccepterror came from. They are now re-resolved at their introducing revisions (Review round 1).Refs #891 item 8
Refs #891 item 10