Skip to content

chore: small polish bundle (typos, dogfood, doc accuracy) - #101

Merged
VincentGuyader merged 4 commits into
masterfrom
chore/polish-bundle
May 5, 2026
Merged

chore: small polish bundle (typos, dogfood, doc accuracy)#101
VincentGuyader merged 4 commits into
masterfrom
chore/polish-bundle

Conversation

@VincentGuyader

Copy link
Copy Markdown
Member

Cosmetic / hygiene changes from the post-0.2.6 audit. No behavioural
changes for end users.
Bundled to avoid 6 micro-PRs for purely
stylistic stuff.

Changes

  • F3 R/dock_from_desc.R x2: length(packages_on_cran > 0) was
    a typo for length(packages_on_cran) > 0 (the parens encompassed
    the comparison). The buggy form happened to evaluate to the right
    truthy value because length(<bool_vec>) == length(<input_vec>),
    but the intent is now obvious. Same fix on packages_not_on_cran.
  • F4 R/dock_from_desc.R: drop fake-{glue} braces from
    stop("please install {pkgbuild}"). The string was not
    interpolated, so end users hitting that error saw the literal
    {pkgbuild} text.
  • F7 R/dockerignore.R: duplicate @export tag removed.
  • G1 R/dock_from_renv.R: dogfood the new dock$ARG(name, default = ...) form (added in feat(ARG): support an optional default value #91) instead of inlining the = via sprintf(). Identical Dockerfile output, just goes through the public API.
  • G2 R/dock_from_renv.R + NEWS.md 0.2.6 bullet: clarify that the PPM patch only fires on the official posit.co / rstudio.com PPM hosts. The previous wording suggested internal mirrors were "preserved on rewrite", but the PPM detection regex doesn't match them at all - they fall through and are simply left untouched (which is the correct outcome, just not via the rewrite branch).
  • G4 tests/testthat/test-dock_from_renv.R: tighten
    expect_false(any(grepl("remotes", ...))) to
    grepl("install\\.packages\\([^)]*remotes", ...) + a check for
    remotes::install_version. The previous form was brittle - any
    future incidental occurrence of the substring "remotes" anywhere
    in the generated Dockerfile (e.g. in a host name) would
    false-positive.

NOT in this bundle

Test plan

  • devtools::test() -> 150 PASS / 0 FAIL.
  • No new tests needed: 5 of the 6 changes are cosmetic / refactor with
    byte-identical output. G4 strengthens an existing test rather than
    adding one.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR bundles a set of small “polish” changes across the package: fixing a couple of minor typos in dock_from_desc(), tightening a brittle regression assertion, and improving documentation/comment accuracy around PPM handling and API usage.

Changes:

  • Fix two length(x > 0) typos in dock_from_desc() and correct a non-interpolated stop() string.
  • Dogfood the dock$ARG(name, default = ...) API in dock_from_renv(), and clarify PPM-host rewrite behavior in code comments + NEWS.md.
  • Remove a duplicate roxygen @export tag and tighten a brittle test regex to avoid substring-based false positives.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testthat/test-dock_from_renv.R Tightens “no remotes” assertions to check only real install patterns.
R/dockerignore.R Removes a duplicate roxygen @export tag.
R/dock_from_renv.R Uses dock$ARG(..., default=...) and clarifies PPM rewrite behavior in comments.
R/dock_from_desc.R Fixes length(...) > 0 typos and removes non-interpolated {pkgbuild} braces in a stop() message.
NEWS.md Adds a dev NEWS bullet for the polish bundle and clarifies PPM rewrite wording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread NEWS.md Outdated
@@ -1,5 +1,13 @@
# dockerfiler (development version)

- chore: small polish bundle (no behavioural changes for end users):
Comment thread NEWS.md Outdated
`packagemanager.rstudio.com` and internal mirrors) are preserved on
rewrite. Multi-entry `repos` vectors and non-PPM repos are left
are preserved as-is. The user's PPM scheme and host (so a
`packagemanager.rstudio.com` URL stays on rstudio.com) is preserved
@VincentGuyader
VincentGuyader force-pushed the chore/polish-bundle branch from 0753850 to ff89a7c Compare May 5, 2026 21:24
Cosmetic / hygiene changes surfaced by the post-0.2.6 audit. No
behavioural changes for end users.

- `R/dock_from_desc.R`: `length(packages_on_cran > 0)` was a typo
  for `length(packages_on_cran) > 0` (the parens encompassed the
  comparison). The buggy form happens to evaluate to the right
  truth value because `length(<bool_vec>) == length(<input_vec>)`,
  but the intent is now obvious. Same fix for the
  `packages_not_on_cran` site.
- `R/dock_from_desc.R`: drop fake-`{glue}` braces from
  `stop("please install {pkgbuild}")`; the message is not
  interpolated, the literal `{pkgbuild}` was reaching end users.
- `R/dock_from_renv.R`: use the new `dock$ARG("RENV_PATHS_CACHE",
  default = renv_paths_cache)` form (added in #91) instead of
  inlining the `=` via `sprintf()`. Internal dogfood of the new
  API.
- `R/dock_from_renv.R` + `NEWS.md` 0.2.6 bullet: clarify that the
  PPM patch only fires for URLs on the official `posit.co` /
  `rstudio.com` PPM hosts. The previous wording suggested
  internal mirrors were "preserved on rewrite", but they are not
  - they fall outside the PPM detection regex and are skipped
  entirely. Internal mirrors stay untouched (which is the correct
  outcome), just not via the rewrite branch.
- `R/dockerignore.R`: drop a duplicate `@export` tag.
- `tests/testthat/test-dock_from_renv.R`: tighten the regression
  assertion `expect_false(any(grepl("remotes", ...)))` to
  `grepl("install\\.packages\\([^)]*remotes", ...)` plus a check
  for `remotes::install_version`. The previous form was brittle
  (would false-positive on any incidental occurrence of the
  substring "remotes" elsewhere in the generated Dockerfile, e.g.
  in a future host name).

Tests: 150 PASS / 0 FAIL.
`{pkg}` is the convention used in roxygen and user-facing strings
across this codebase; the polish bundle had stripped them by mistake.
Update NEWS to drop the now-obsolete bullet item.
After rebasing on master (which renamed `(development version)` to
0.3.0 with subheadings), git auto-merge placed the polish-bundle
bullet under `## New features` because that's where the first
top-of-section bullet landed. The bullet's content is mostly
typo / dead-code / internal-form fixes, so move it under
`## Bug fixes` and drop the now-misleading `chore:` prefix.
"scheme and host ... is preserved" -> "are preserved" (compound
subject). Caught by Copilot review at the original HEAD; the
correction was deferred and is applied now.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/dock_from_desc.R
dock$RUN("R -e 'install.packages(\"remotes\")'")

if (length(packages_on_cran > 0)) {
if (length(packages_on_cran) > 0) {
@VincentGuyader
VincentGuyader merged commit 7310b32 into master May 5, 2026
10 checks passed
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