Repository navigation
feat(docs): an entry in the guide for each loss code, linked from the notices that give it - #3134
Conversation
… notices that give it A new guide page, Data loss codes, has an entry for each code, anchored by its id: what happened, where it is said and what to do. It replaces the command line guide's table, and a test keeps it in step with the codes. The Messages pane shows a notice's code with a link to its entry, and Copy diagnostics gives both. A strict run gives each code's address, Python's DataLossWarning has it as `url`, and the Assistant can read the page. Part of opengeos#2371.
…re service answers as the data guide does
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| # Data loss codes | ||
|
|
||
| RustGIS never drops or changes data silently. A notice says what happened, how much and where. | ||
| A notice that reports a loss also carries one of the codes on this page. Each notice links to its |
There was a problem hiding this comment.
This says every notice that reports a loss carries one of the codes, but lines 12-13 say not every loss has a code yet. Say "with a code" here so the two agree:
| A notice that reports a loss also carries one of the codes on this page. Each notice links to its | |
| A notice that reports a loss with a code also carries one of the codes on this page. Each notice links to its |
Category: quality
There was a problem hiding this comment.
The page's next paragraph says not every loss has a code yet, so a reader isn't misled; the wording is left for the release quality pass.
| for row in rows { | ||
| let id = row.trim_start_matches("| `").split('`').next().unwrap_or_default(); | ||
| assert!(LossCode::from_id(id).is_some(), "docs/cli.md lists `{id}`, which is not a loss code"); | ||
| for heading in headings { |
There was a problem hiding this comment.
The per-code check finds each heading by its first match (guide.split(...).nth(1)), so a second ### dropped.ring`` heading would pass silently. Pinning the heading count to the number of codes catches a duplicate. Every heading is already checked to be a code, so equal counts mean one heading per code:
| for heading in headings { | |
| assert_eq!(headings.len(), LossCode::ALL.len(), "docs/user-guide/loss-codes.md should have one heading for each code"); | |
| for heading in headings { |
Category: quality
There was a problem hiding this comment.
A duplicate heading would need someone to write one by hand, and the anchor would still resolve to the first; pinning the count is left for the release quality pass.
|
|
||
|
|
||
| # The guide's page of loss codes (rustgis_data::loss::GUIDE), an entry for each code. | ||
| _LOSS_GUIDE = "https://rustgis.app/user-guide/loss-codes/" |
There was a problem hiding this comment.
The guide's address is written out again here, apart from rustgis_data::loss::GUIDE on the Rust side. The two match today, so this is not a defect. But if the Rust constant moves, Python keeps the old page, and the Python test (test_session.py) pins the same literal, so it would not catch the drift. Consider reading the address from the built package or having a test compare the two.
Category: quality
There was a problem hiding this comment.
The two match today. The Python test checks the address it gives against a literal, not against the Rust constant, so a move on the Rust side alone wouldn't fail it. Deriving the address from the Rust constant is left for the release quality pass.
Code reviewI found no bugs, crash paths, security problems or silent-loss gaps in this PR. The findings are documentation and test-precision nits. Three of them are posted as inline comments. Nothing was run: this environment has no build or test tooling, so the checks below come from reading the code. No earlier review threads exist on this PR, so none were left alone. BugsNone found. What I checked:
SecurityNone found. PerformanceNone of note. Quality
AGENTS.mdNo rule breaks found. Checked: the new strings use Change sizeCompared: the whole PR against main (merge base 006faa2 to PR head a7cc28b).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Each loss code now has an entry in the guide, and the notices that give a code link to it, the way an error code links to its page elsewhere.
#dropped.ring). Each entry says what happened, where you see it (the readers, writers, tools and commands that say it) and what to do. "What to do" is the code's ownactiontext.LossCode::doc_url()gives a code's address (rustgis_data::loss::GUIDE+#+ id). The surfaces use it:Loss: <code> (<address>)line under the entryrustgis-cli run --strict--allowwith an unknown code names the pageDataLossWarning.urllossesalready carries each code'saction, and an address per entry would spend the output budget. The page says how codes are addressed, and the Assistant can read it.Record::loss), so the pane and the report can give it.Testing
the_guide_lists_every_codenow reads the new page. Every code needs its anchored heading, and its "What to do" must match the registry. Every heading must be a code. The test also checks thatdoc_urlpoints at the anchor.a_loss_keeps_its_code_and_the_report_gives_its_guide_entry(diagnostics).--strictintegration test checks the address. The Python test checksurl.assumed.null-markerand the export case ofdropped.zmwere checked by hand.Surfaces
UI evidence
The Messages pane after Calculate Field writes 1.5 into a whole-number field.
Related issue
Part of #2371.
Summary by CodeRabbit