Closed Bug 2068556 Opened 2 months ago Closed 2 months ago

Correct the build, cross-reference and lint guidance in the documentation skill

Categories

(Developer Infrastructure :: AI for Development, task)

task

Tracking

(firefox157 fixed)

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Four things the documentation skill either states misleadingly or leaves out. Each cost time while adding browser/components/sessionstore/docs/events.md (bug 2066123), so they are corrections with a case behind them rather than a reading of the Sphinx docs. Bug 2068546 covers a separate gap in the same file.

  • --no-autodoc is described only as a way to make builds faster ("skip Python/JS API generation for faster builds", "for faster iteration when not working on API docs"). It is also the only way to build a page at all while some other component's JSDoc is broken: sphinx-js analyzes every js_source_paths entry no matter which directory ./mach doc was scoped to, so one aborting error takes the whole build down and names a file the change never touched. A PathsTaken collision in browser/components/urlbar/content/UrlbarChildController.mjs aborted a build scoped to browser/components/sessionstore/docs. The skill should say that a build failure naming an unrelated JS file is not yours, and that --no-autodoc gets past it with only the generated API pages missing.
  • A {doc} role renders the target page's title as its link text, so a following noun duplicates it: in the {doc}api`` came out as "in the SessionStore API reference reference". The document cross-referencing section covers the path and extension rules but not what the reader ends up seeing, and this is invisible until the built page is read. Worth stating alongside the existing advice to build and check.
  • docs/config.yml categories are described as though each new page needs an entry ("Every documentation path must be assigned to a category. If a new doc path is not categorized here, the build fails"). The entries are directory prefixes, so a page added inside an already-listed tree needs no change: a new file under browser/components/sessionstore/docs is covered by the existing browser entry. As written, the skill sends a reader to edit a file that does not need editing.
  • Naming the linters matters for a docs-only change. ./mach lint <docs dir> with no -l exits non-zero with an AssertionError traceback out of mozlint/roller.py for linters that have nothing to check in a .md file, which reads as though the change broke something. ./mach lint -l codespell -l file-whitespace -l trojan-source <path> are the ones that apply, and file-whitespace is the one that actually catches things (a trailing blank line at end of file).

Verified in-tree rather than taken from the skill: conf.py passes the whole js_source_paths list to sphinx-js regardless of the build's scope, the categorization check compares tree indexes and only on a full build, and a bare mach lint over a docs directory exits non-zero with three linter failures and an assertion out of mozlint's roller.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4d0e4a9c547a https://hg.mozilla.org/integration/autoland/rev/04ca9f30328d Correct four things the documentation skill gets wrong about docs-only changes. r=ai4dev-reviewers,padenot DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
Blocks: 2071162
See Also: → sessionstore-docs
See Also: sessionstore-docs →
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: