Skip to content

Validation report - #377

Merged
shajoezhu merged 4 commits into
mainfrom
validation_report
Sep 22, 2026
Merged

shajoezhu merged 4 commits into
mainfrom
validation_report

Conversation

@shajoezhu

@shajoezhu shajoezhu commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

  • Adds a "Validation report" entry to the pkgdown navbar, resolved per documentation version. (Validation report #377)

pkgdown builds one static site per version, so a hardcoded link would freeze at whichever report was current when it was written. pkgdown/extra.js reads the version from the navbar and points the link at the newest report at or below it. Versions older than the first report drop the item entirely. _pkgdown.yml keeps a static href as the fallback for readers with JavaScript disabled.

Reports currently exist for 0.5.11 and 0.5.12, so a 0.5.13 site links to the 0.5.12 report.

Also in this PR: DESCRIPTION moves to Version: 0.5.13 / Date: 2026-09-15 and the NEWS.md heading follows. v0.5.13 was tagged and released on 2026-09-15 but main was left at 0.5.12.9003, so this brings the branch back in line with the published release. Flagging it because it is not implied by the PR title.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Unit Tests Summary

  1 files    9 suites   13s ⏱️
 59 tests  59 ✅ 0 💤 0 ❌
436 runs  436 ✅ 0 💤 0 ❌

Results for commit 8b89f3c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename             Stmts    Miss  Cover    Missing
-----------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
R/format_value.R       272       6  97.79%   117, 235, 278, 290, 566, 574
R/generics.R           142      16  88.73%   148, 286-290, 492, 504, 535, 565, 673, 686, 707-714, 766, 784, 788, 790
R/labels.R              55       7  87.27%   51, 57, 66, 107, 133, 142, 146
R/matrix_form.R        702      35  95.01%   134, 174, 411, 531-532, 624, 638-641, 659, 690, 780-781, 795-800, 830-833, 893-894, 988-989, 1044, 1096, 1262, 1360, 1408, 1411, 1415
R/mpf_exporters.R      289      28  90.31%   2, 102-112, 157, 193, 238, 241, 246, 427-433, 437, 440, 444, 494, 573
R/page_size.R           42       1  97.62%   219
R/pagination.R         770      56  92.73%   327-330, 435-450, 540, 595, 600, 641, 679-690, 766, 878-879, 901-910, 1051, 1054, 1275, 1312-1316, 1333-1341, 1422, 1562-1563, 1579-1580, 1594-1595
R/tostring.R           783      66  91.57%   88, 296, 351, 421, 454, 462, 498, 555-558, 594, 660-663, 669-673, 676-679, 686-691, 774-775, 915-916, 981-988, 1038-1042, 1111, 1164, 1183-1187, 1198, 1216, 1233, 1248, 1346, 1389, 1434, 1520, 1559, 1613, 1620
R/utils.R                3       0  100.00%
R/zzz.R                 17       6  64.71%   28-33
TOTAL                 3075     221  92.81%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 8b89f3c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

findLink() scanned every anchor on the page, so a vignette using the words
"validation report" as link text would have been rewritten instead of the
navbar item. Scope it to the navbar.

closest() and remove() are the only ES6-era APIs in an otherwise strict ES5
file; replace them with equivalents so the target is consistent.

pickReport() now takes the maximum eligible report rather than the last match,
so REPORTS no longer has to be kept sorted, and the header comment notes that
the static fallback in _pkgdown.yml needs updating alongside it.
@Melkiades

Copy link
Copy Markdown
Contributor

@shajoezhu I pushed 8b89f3c to this branch and filled in the description, since it was empty and the PR also carries the 0.5.13 version sync. Shout if you would rather I had left either alone.

Three small things in extra.js:

  • findLink() scanned every anchor on the page, so a vignette linking the words "validation report" would have been rewritten instead of the navbar item. Scoped it to the navbar.
  • closest() and remove() were the only ES6-era DOM calls in an otherwise strict ES5 file. Swapped for equivalents so the target is consistent.
  • pickReport() took the last match, so it silently depended on REPORTS being sorted ascending. It now takes the maximum instead. I also corrected the header comment: adding a version to REPORTS does need one other change, the static href in _pkgdown.yml that no-JS readers get.

Checked the logic with REPORTS both sorted and deliberately reversed, same results throughout: 0.5.10 no link, 0.5.11 and 0.5.12 their own, 0.5.13 and 0.6.0 to 0.5.12. Also confirmed against the live nesttemplate navbar that .navbar small really does hold the version, and that the 0.5.13 report is a 404 so stopping REPORTS at 0.5.12 is right.

Nice approach, resolving per version is the right call given pkgdown builds a site per tag.

One I left alone for you to decide: 0.5.11-rc1 resolves to the 0.5.11 report, because parseInt("rc1") is NaN and becomes 0, so the rc compares equal to the release. The rc doc sites are real, so it is reachable. Pointing an rc at its eventual release report seemed more useful than no link, but happy to change it.

Melkiades added a commit to pharmaverse/rtables that referenced this pull request Sep 21, 2026
findLink() scanned every anchor on the page, so a vignette using the words
"validation report" as link text would have been rewritten instead of the
navbar item. Scope it to the navbar.

closest() and remove() are the only ES6-era APIs in an otherwise strict ES5
file; replace them with equivalents so the target is consistent.

pickReport() now takes the maximum eligible report rather than the last match,
so REPORTS no longer has to be kept sorted, and the header comment notes that
the static fallback in _pkgdown.yml needs updating alongside it.

Mirrors the same fixes on pharmaverse/formatters#377.
@shajoezhu
shajoezhu enabled auto-merge (squash) September 22, 2026 06:47

@Melkiades Melkiades left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thanks Joe

@shajoezhu
shajoezhu merged commit 79188e3 into main Sep 22, 2026
30 checks passed
@shajoezhu
shajoezhu deleted the validation_report branch September 22, 2026 07:34
Melkiades added a commit to pharmaverse/tern that referenced this pull request Sep 22, 2026
findLink() scanned every anchor on the page, so a vignette using the words
"validation report" as link text would have been rewritten instead of the
navbar item. Scope it to the navbar.

closest() and remove() are the only ES6-era APIs in an otherwise strict ES5
file; replace them with equivalents so the target is consistent.

pickReport() now takes the maximum eligible report rather than the last match,
so REPORTS no longer has to be kept sorted, and the header comment notes that
the static fallback in _pkgdown.yml needs updating alongside it.

Mirrors the same fixes on pharmaverse/formatters#377 and pharmaverse/rtables#1122.
Melkiades added a commit to pharmaverse/rlistings that referenced this pull request Sep 22, 2026
findLink() scanned every anchor on the page, so a vignette using the words
"validation report" as link text would have been rewritten instead of the
navbar item. Scope it to the navbar.

closest() and remove() are the only ES6-era APIs in an otherwise strict ES5
file; replace them with equivalents so the target is consistent.

pickReport() now takes the maximum eligible report rather than the last match,
so REPORTS no longer has to be kept sorted, and the header comment notes that
the static fallback in _pkgdown.yml needs updating alongside it.

Mirrors the same fixes on pharmaverse/formatters#377 and pharmaverse/rtables#1122.
shajoezhu added a commit to pharmaverse/tern that referenced this pull request Sep 26, 2026
**What changes are proposed in this pull request?**

* Adds a "Validation report" entry to the pkgdown navbar, resolved per
documentation version. (#1533)

pkgdown builds one static site per version, so a hardcoded link would
freeze at whichever report was current when it was written.
`pkgdown/extra.js` reads the version from the navbar and points the link
at the newest report at or below it. Doc versions older than the first
report drop the item entirely. `_pkgdown.yml` keeps a static href as the
fallback for readers with JavaScript disabled.

Only 0.9.11 currently has a report, so 0.9.11 and later resolve to it
and earlier doc versions get no navbar item.

`DESCRIPTION` also swaps `RoxygenNote: 8.0.0` for
`Config/roxygen2/version: 8.1.0`, which is unrelated to the navbar link.

Same change as pharmaverse/formatters#377 and pharmaverse/rtables#1122.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Melkiades <11279768+Melkiades@users.noreply.github.com>
Co-authored-by: Davide Garolini <davide.garolini@roche.com>
shajoezhu added a commit to pharmaverse/rtables that referenced this pull request Sep 26, 2026
**What changes are proposed in this pull request?**

* Adds a "Validation report" entry to the pkgdown navbar, resolved per
documentation version. (#1122)

pkgdown builds one static site per version, so a hardcoded link would
freeze at whichever report was current when it was written.
`pkgdown/extra.js` reads the version from the navbar and points the link
at the newest report at or below it. Doc versions older than the first
report drop the item entirely. `_pkgdown.yml` keeps a static href as the
fallback for readers with JavaScript disabled.

Only 0.6.16 currently has a report, so 0.6.16 and later resolve to it
and earlier doc versions get no navbar item.

Same change as pharmaverse/formatters#377.

---------

Co-authored-by: Melkiades <11279768+Melkiades@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants