Skip to content

Prepare package for CRAN submission and open-source CI/CD - #1

Open
AleKoure wants to merge 13 commits into
mainfrom
cran-readiness
Open

Prepare package for CRAN submission and open-source CI/CD#1
AleKoure wants to merge 13 commits into
mainfrom
cran-readiness

Conversation

@AleKoure

@AleKoure AleKoure commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prepares bslibdash for CRAN submission and adds standard open-source
CI/CD tooling.

Changes

  1. Fix LICENSE to CRAN's required short MIT template
  2. Remove dead vendored assets (~700KB unused tests/lib/**) and a stray runtime log.sqlite
  3. Add DESCRIPTION metadata (URL/BugReports/testthat edition), align Language to en-GB
  4. Refactor sidebar_bslib.R to remove <<- (lintr compliance)
  5. Fix remaining lintr findings in tests/testthat; scope .lintr to package-shipped code
  6. Add GitHub Actions: R-CMD-check (macOS/Windows/Ubuntu, release/devel/oldrel), lintr, covr
  7. Add pkgdown site (reference index + deploy workflow) and README badge
  8. Add cran-comments.md for the CRAN submission

Validation

  • R CMD check --as-cran: 0 errors, 0 warnings, 0 notes
  • Full testthat suite: all passing
  • lintr::lint_package(): 0 lints
  • spelling::spell_check_package(): no errors

AleKoure and others added 11 commits August 21, 2026 16:09
CRAN requires the file referenced by 'License: MIT + file LICENSE' to
be the short 2-line YEAR/COPYRIGHT HOLDER template, with the full
license text living in LICENSE.md instead. The previous LICENSE also
had a copyright holder inconsistent with LICENSE.md and DESCRIPTION's
cph entry (Novartis Pharma AG).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- tests/lib/** (~700KB of vendored jquery/bootstrap3/datatables/
  crosstalk/highlight.js) is not referenced by any test in the suite
  and should not ship as part of the package sources.
- inst/shiny/examples/10_bslib_dashboard_page/.log/log.sqlite is a
  runtime log database produced by running the example app; it should
  never have been committed (the directory is already covered by
  .Rbuildignore, but was still tracked in git).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add URL and BugReports fields pointing at the GitHub repo/issues.
- Add Config/testthat/edition: 3, and bump the testthat Suggests
  requirement to >= 3.0.0 to match.
- Correct Language from en-US to en-GB: the roxygen/vignette prose
  consistently uses British spelling (colour, behaviour, customise,
  etc.), so the DESCRIPTION field was inconsistent with the actual
  content.
- Expand inst/WORDLIST with legitimate proper nouns, package names and
  technical terms so spelling::spell_check_package() is clean.
- man/bslibdash-package.Rd is regenerated by roxygen2 to include the
  new URL/BugReports links in its 'Useful links' section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the flush_nav() closure that mutated result/nav_buf via <<-
with an inline loop that reassigns local variables directly. Same
behaviour, verified against the full test-dashboard_sidebar.R suite
(63 passing tests), but avoids the superassignment operator flagged by
lintr's assignment_linter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Strip trailing whitespace, switch to double quotes, fix hanging
  indentation, and shorten an over-long test_that() label across
  tests/testthat/*.R.
- Collapse a multi-line \$-chain in test-dashboard_sidebar.R to a
  single line to sidestep an indentation_linter ambiguity around
  continued dollar-chains.
- Exclude inst/shiny/examples, tests/manual and vignettes from .lintr:
  these are demo/manual-only content, not checked by R CMD check, and
  don't warrant the same strict style enforcement as R/ and
  tests/testthat/.

After this commit, lintr::lint_package() returns zero lints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Standard r-lib/actions workflows (v2):
- R-CMD-check.yaml: runs R CMD check --as-cran on macOS-latest (release),
  windows-latest (release), and ubuntu-latest (devel/release/oldrel-1),
  on every push to main and every pull request.
- lint.yaml: runs lintr::lint_package() with LINTR_ERROR_ON_LINT=true
  using the project's .lintr config.
- test-coverage.yaml: runs covr::package_coverage() and uploads a
  cobertura report to Codecov.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- _pkgdown.yml defines a curated reference index (Page layout, Sidebar
  navigation, Body content, Cards and boxes, KPI tiles, Header widgets,
  Feedback and inputs, Theming, Package) covering all 33 documented
  .Rd topics — verified via tools::parse_Rd() that every topic's
  aliases are represented.
- pkgdown.yaml (r-lib/actions) builds and deploys the site to the
  gh-pages branch on push to main and on release.
- _pkgdown.yml is added to .Rbuildignore (not part of the built
  package).
- README gains an R-CMD-check badge alongside the existing lifecycle
  and license badges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Documents test environments (local Windows R 4.5.2, GitHub Actions
matrix, win-builder to be run before final submission) and confirms
R CMD check --as-cran results: 0 errors, 0 warnings, 0 notes. No
reverse dependencies exist since this is a new package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collapse the multi-line htmltools::tagQuery() chain into a single
line to satisfy lintr's indentation_linter, which was flagging
inconsistent continuation indentation on the chained \()/\()
calls.
Align LICENSE, LICENSE.md, and the DESCRIPTION cph entry with the
copyright holder GitHub used when the repository was initialized,
rather than the previously (incorrectly) substituted 'Novartis Pharma AG'.
Tighten the tone and structure to match tidyverse-style READMEs: add
an Installation section, a concise Features list, and a 'Getting
help' section. Replace vignette() calls with links to the pkgdown
site (articles + reference index) now that the site is the canonical
place to read documentation, instead of pointing at in-package
vignettes.
@AleKoure AleKoure self-assigned this Aug 21, 2026
bslibdash already powers a number of internal dashboards; the API is
mostly settled, so 'experimental' undersold its actual maturity.
@ardalanmirshani

Copy link
Copy Markdown
Collaborator

Review: CRAN readiness + CI/CD tooling (cran-readiness)

Verdict: Approve with minor comments. Every claim in the description checked out
when I reproduced it locally. There is one genuine blocker for the actual CRAN
submission (the documentation URLs 404) and a few small nits, none of which need to
hold up this PR.

How I tested

Reviewed cran-readiness against main (41 files: 6 added, 13 modified, 22 deleted)
on Windows, R 4.4.0.

Claim Result
LICENSE uses CRAN short MIT template Confirmed — YEAR / COPYRIGHT HOLDER only, with full text in LICENSE.md
Vendored tests/lib/** and log.sqlite removed Confirmed — tests/lib gone, ~4,100 deleted lines, log file untracked and off disk
DESCRIPTION metadata added Confirmed — URL, BugReports, Config/testthat/edition: 3, Language: en-GB
<<- removed from sidebar_bslib.R Confirmed — no <<- anywhere in R/
lintr::lint_package() → 0 lints Confirmed — no lints found
Full testthat suite passes Confirmed — 409 assertions pass, 0 failures, 1 skip image
GitHub Actions added Confirmed — R-CMD-check, lint, test-coverage, pkgdown
pkgdown site + README badge Confirmed — _pkgdown.yml with 10 reference sections
cran-comments.md added Confirmed
spelling::spell_check_package() → no errors Not reproduced — see below
R CMD check --as-cran → 0/0/0 Not reproduced locally — see below

Findings

1. Documentation URLs return 404 (should fix before submitting to CRAN)

R CMD check --as-cran flags this under CRAN incoming feasibility, and I confirmed
it independently:

URL Status
https://github.com/Novartis/bslibdash 200
https://novartis.github.io/bslibdash/ 404 (redirects to opensource.nibr.com)
https://opensource.nibr.com/bslibdash/ 404

This affects DESCRIPTION, man/bslibdash-package.Rd, and five links in README.md.
The redirect suggests Novartis GitHub Pages are served from opensource.nibr.com, but
that target isn't live either — presumably because the pkgdown workflow hasn't run on
main yet. CRAN reviewers do check these, so either deploy the site before submitting
or point the URLs somewhere that resolves. Not a reason to block the merge, since
merging is likely what publishes the site.

2. spell_check_package() reports one word

image

I get one hit, not zero: Novartis in bslibdash-package.Rd:68. inst/WORDLIST
contains Pharma but not Novartis. One line to fix.

3. My R CMD check result differs, but for environmental reasons

image

I got 1 error / 2 warnings / 4 notes rather than 0/0/0. I do not think this
contradicts the author — all of it traces to tooling missing on my machine, not to the
package:

  • ERROR + WARNING on the PDF manual — no LaTeX (pdflatex) installed
  • WARNING on PDF size — no qpdf
  • NOTEs for tidy not found, unverifiable system clock, leftover .tex

The only substantive NOTE is the URL one in item 1, plus the routine New submission
note. I'd treat the author's 0/0/0 as credible; the CI R-CMD-check matrix is the real
arbiter here.

4. Example apps in inst/shiny/examples all work

I loaded each app in a clean R subprocess, rendered its UI, then actually started it
with runApp() and requested the page over HTTP:

App UI renders Serves Notes
10_bslib_dashboard_page Yes (8.0 KB) 200 image
13_updatebox Yes (9.2 KB) 200 image
14_kitchen_sink Yes (112.1 KB) 200 image
15_edge_cases Yes (34.6 KB) 200 image
16_sidebar_auto_expand Yes (11.7 KB) 200 image

The 15_edge_cases warnings ("a non-HTML value was provided to icon", unknown icon
names including a literal truly-unknown-xyz123) are clearly the point of that app —
it exercises invalid input on purpose and degrades gracefully rather than erroring.

Worth flagging that this verification was all manual: tests/testthat/test-example-apps.R
is a stub whose only content is skip("shinytest2-based example app tests are deferred as a stretch goal."). So the examples have no automated coverage, and CI would not
catch an example app that breaks. Given the apps are the main onboarding path for new
users, a follow-up issue for even a minimal "each app's UI renders without error" test
would be worthwhile. Not in scope for this PR.

Minor suggestions

  • Add Novartis to inst/WORDLIST.
  • inst/shiny/examples/*/.log/ is removed from git but not in .gitignore (it is in
    .Rbuildignore, so it won't reach the tarball). Adding a .gitignore entry would
    stop log.sqlite from being re-committed by whoever next runs that example.
  • .lintr excludes inst/shiny/examples, so the example apps aren't linted. Reasonable
    for CRAN scope, though it does mean example code style drifts unchecked.

Summary

The cleanup is thorough and the CI setup is standard and sensible. Tests, lints, and all five example apps pass locally. Fix the WORDLIST entry, and make sure the pkgdown site is actually live before the CRAN submission goes out.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AleKoure

AleKoure commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Updated the WORDLIST. Holding the merge for your approval, merging publishes the website automatically and should resolve the URL issues; else we can revisit.

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