You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0ae218f
Browse filesBrowse the repository at this point in the historyBrowse files
ADFA-5548: Fix ten issues from the review of PR #36
Two of these stopped the workflow working at all.
The zip uploaded to Drive held a member called documentation-android.db,
because `zip -j` drops the directory but keeps the basename and the staging
file was named after this doc set. Every reader of that artifact looks for
documentation.db exactly: this workflow's own download step, the daily
docdb-regression-test run, and build-kotlin-docs. One live run would have
broken all three until someone re-uploaded by hand. The local workflow
already renamed before writing; the hosted one now does too.
And "Run the unit tests" ran pytest without anything installing it.
setup-python provides a clean interpreter, so the runner image's own packages
are not on that path, and the job would have died at step 6 of 14 -- before
converting a single page.
The rest:
- load_android_json_db.py checks up front that the database has every table
it writes. Two of them, DocumentationDatabaseVersion and LastChange, are
touched only by record_version at the very end, and nothing in this
repository creates either, so a database without them lost the whole load
-- 90 seconds locally, a quarter of an hour in CI -- to a "no such table"
at the finish. Same fail-fast the media optimizer does for its content
types. record_version and the preflight both have tests now; record_version
had none at all, its two tables being absent from the fixture.
- The Slack baton is a pair again. "Grabbing baton" fired unconditionally
while "Dropping baton" was gated on dry_run being false -- and dry_run
defaults to true, so the ordinary dispatch took a baton nothing ever
dropped. Both halves are now gated on dry_run, and the release keys off the
acquire's own conclusion under always(), so an early failure cannot strand
it either.
- The WIF token asks for drive.readonly as well as drive.file. drive.file
covers only files the app itself created, and the step after it downloads a
database it did not. docdb-regression-test.yaml already asks for both
against the same file.
- build-android-docs and build-kotlin-docs share one concurrency group,
`documentation-db`. Both do download-modify-upload against the same Drive
file, and per-workflow groups let them interleave, so whichever uploaded
second silently discarded the other's work. This is the one change here
outside the Android tree, and it is one line: a group only serialises
runs that name it.
- The red-link legend moved into a pageFooter() macro that all three
templates call. reference() colours links on every page kind, but only
class.peb explained what red meant -- a package summary or an index showed
the colour with no legend. Verified by rendering one of each and grepping.
- A test pins _MEMBER_KINDS, _MEMBER_ORDER and _PLURALS against each other.
describe_tally silently drops a kind missing from the order while still
reporting it as data, and count_label raises KeyError for one missing from
the plurals, after the whole corpus has been converted.
- HtmlLinks.java and rewrite_document said they mirrored each other. They do
not: the Python side also folds each path to the case the database spells
it with, for the StrictMode/strictmode pages. Both comments now say what
each does and why they differ.
- Dropped the "raw" key from the loader's stats, which was initialised and
never touched again.
Not fixed here: build-kotlin-docs.yaml has the same baton asymmetry and the
same drive.file-only scope. Those are that workflow's to fix and are already
addressed on fix/ADFA-4737; the concurrency group above is the only thing
this PR needed from it.
Tests: 164 Python (12 new) and 9 Java, all passing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: ProcessDocs/AndroidDocs/AndroidDocsToJson/renderer/src/main/java/org/appdevforall/docs/android/HtmlLinks.java
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,14 @@
17
17
*
18
18
* It happens here rather than in a Pebble filter so that the templates need no filter of their
19
19
* own: the database stores one self-contained template per row and evaluates it against the
20
-
* page's JSON, with no opportunity to register anything. The same swap is implemented in
21
-
* `load_android_json_db.py` for the same reason.
20
+
* page's JSON, with no opportunity to register anything.
21
+
*
22
+
* `load_android_json_db.py`'s `rewrite_link` does the corresponding job for the database, and is
23
+
* deliberately NOT identical: it also folds each path to the case the database spells it with,
24
+
* because the database holds pages the scrape spelled two ways (`StrictMode/` and `strictmode/`)
25
+
* and a link has to name the row that exists. There is no such second spelling here - this
26
+
* renderer writes the HTML tree itself, mirroring the JSON tree's own paths - so the swap below
27
+
* is the whole job. Change one and the other does not automatically need the same change.
0 commit comments