Skip to content

fix(resolve): try Archive/ on every configured repo for @version - #487

Closed
jjjermiah wants to merge 9 commits into
r-lib:mainfrom
jjjermiah:main
Closed

jjjermiah wants to merge 9 commits into
r-lib:mainfrom
jjjermiah:main

Conversation

@jjjermiah

Copy link
Copy Markdown

version-pinned refs used to only work for cran named repos

type_cran_resolve_version() previously only ever probed the CRAN mirror's
src/contrib/Archive/<pkg>/<pkg>_<version>.tar.gz path when resolving a
version-pinned ref (pkg@version) that isn't in the current PACKAGES index.
config$get("cran-mirror") resolves to getOption("repos")["CRAN"] specifically

  • the one repo entry literally named "CRAN" - so any other configured
    CRAN-like repo (e.g. an internal RDepot/Bioconductor-alike server that moves
    superseded versions into its own Archive/ the same way CRAN does) was never
    consulted, even though it follows the identical layout.

type_cran_resolve_archive() now tries the CRAN mirror's Archive first (same
as before, preserving the common case and avoiding extra network calls), then
recurses through every other repo in options("repos"), deduping by
trailing-slash-normalized URL.

  • Falls through to the existing resolve_from_metadata() catch-all if none of them have it. Only affects the version-pinned resolution path;
  • type_cran_resolve_current() (latest-version resolution) is untouched.

Collapses what was originally 3 helper functions (build URL list, resolve
list recursively, reverse-match winning URL back to a repo name) into 1
recursive helper that attaches RemoteRepos metadata directly from the repo
it just resolved against, instead of resolving output URL back to a source

jjjermiah and others added 9 commits September 15, 2026 17:33
…d refs

type_cran_resolve_version() previously only ever probed the CRAN mirror's
src/contrib/Archive/<pkg>/<pkg>_<version>.tar.gz path when resolving a
version-pinned ref (pkg@version) that isn't in the current PACKAGES index.
config$get("cran-mirror") resolves to getOption("repos")["CRAN"] specifically
- the one repo entry literally named "CRAN" - so any other configured
CRAN-like repo (e.g. an internal RDepot/Bioconductor-alike server that moves
superseded versions into its own Archive/ the same way CRAN does) was never
consulted, even though it follows the identical layout.

type_cran_resolve_archive() now tries the CRAN mirror's Archive first (same
as before, preserving the common case and avoiding extra network calls), then
recurses through every other repo in options("repos"), deduping by
trailing-slash-normalized URL. Falls through to the existing
resolve_from_metadata() catch-all if none of them have it. Only affects the
version-pinned resolution path; type_cran_resolve_current() (latest-version
resolution) is untouched.

Collapses what was originally 3 helper functions (build URL list, resolve
list recursively, reverse-match winning URL back to a repo name) into 1
recursive helper that attaches RemoteRepos metadata directly from the repo
it just resolved against, instead of resolving output URL back to a source.

Added a testthat case: version absent from the primary/CRAN Archive but
present in a second configured repo's Archive now resolves successfully
instead of failing through to resolve_from_metadata(). Verified against the
pre-existing 7 snapshot failures in test-type-cran.R (mirror URL trailing-
slash formatting drift, unrelated to this change, reproduced identically on
unmodified main) to confirm no regression.
Archive lookup deduplicated slash-normalized keys but kept the original
URLs, producing //src/contrib paths for repos with trailing slashes.
Normalize stored URLs before deduplication and archive construction.

Add a trailing-slash regression test and update URL and RemoteRepos
expectations to the normalized form. Focused tests pass 30 expectations.

[RND-13214](https://onepinnacle.atlassian.net/browse/RND-13214)
Every PR check failed because the upstream sysreq database changed
Chrome's install commands. A frozen snapshot of live DB rows cannot
tell whether pkgdepends resolved an archive correctly. Check that the
three named entries exist and their command fields have valid shapes.

CI run 39795518497 shows the same snapshot failure on Linux, macOS
and Windows. Local sysreq tests reached the new assertions, then hit
unrelated existing fake-API and command-output failures; PR CI must
confirm the full matrix.
An empty configured CRAN mirror and repository list left the archive
candidate set empty. Indexing the first repository then threw before
the promise's metadata fallback was installed. Route that case
straight to metadata resolution.

Validated with a regression using empty repos and a mocked metadata
resolver. Oracle reproduced the original failure and approved the fix.
Other local type-cran snapshot differences reflect installed test
dependency versions; the full CI matrix remains the gate.
RND-13214: Resolve pinned versions from all configured repository archives
Coverage passed on the PR's warm R cache but failed 17 assertion
snapshots on main with a cold cache. The test process uses asciicast,
whose child attaches pkgdepends by name. Install the local package,
not only its dependencies, and rotate the cache key to prove the fix
without an already-installed copy.

Validated: identical PR and merge trees; main coverage 41326289104
failed with missing assert_that, while PR 41324877685 passed. YAML
parsed and git diff --check clean. The cold GitHub run is the gate.
fix(ci): install pkgdepends for cold-cache coverage runs
Coverage tests now pass from a cold cache on main, but the job still
fails afterward: the workflow always calls uncovr::codecov() on push,
and the repository has no CODECOV_TOKEN. Keep running uncovr::test()
and upload only when a token exists. Remove the unused event setting.

Validated against main run 41328505941: tests complete and the upload
raises "No Codecov token". Workflow YAML parses; git diff --check clean.
fix(ci): skip Codecov upload without a token
@jjjermiah

Copy link
Copy Markdown
Author

Superseded by #488, which is rebased on main and opened from a topic branch.

@jjjermiah jjjermiah closed this Nov 9, 2026
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.

1 participant