From bd05957a250ee509b57d6437e9c04c657d7801cf Mon Sep 17 00:00:00 2001 From: Colin Gillespie Date: Fri, 16 Oct 2026 14:19:34 +0100 Subject: [PATCH 1/2] fix: Read the Quarto minor releases from GitHub instead of a fixed list Each minor came from a hardcoded vector plus releases/latest, so when a new minor shipped the previous one dropped out of the list and showed as past EOL. The latest patch of each minor now comes from the newest 100 releases. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BEZ4ZUv51gFQjAe1WePbJF --- R/get_latest_versions_remote.R | 38 ++++++++++--------- .../test-get_latest_versions_remote.R | 4 ++ 2 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 tests/testthat/test-get_latest_versions_remote.R diff --git a/R/get_latest_versions_remote.R b/R/get_latest_versions_remote.R index 1ef17de..0fe6655 100644 --- a/R/get_latest_versions_remote.R +++ b/R/get_latest_versions_remote.R @@ -3,23 +3,7 @@ get_latest_versions_remote = function() { r = get_latest_versions_from_posit("r") py = get_uv_python_versions() - # Drop latest to get all releases - q = jsonlite::read_json( - "https://api.github.com/repos/quarto-dev/quarto-cli/releases/latest" - ) - quarto = c( - "1.0.38", - "1.1.189", - "1.2.475", - "1.3.450", - "1.4.557", - "1.5.57", - "1.6.43", - "1.7.34", - "1.8.27", - "1.9.38", - stringr::str_remove(q$name, "^v") - ) + quarto = get_quarto_versions() software_tibble = tibble::tibble( software = rep( @@ -35,6 +19,26 @@ get_latest_versions_remote = function() { dplyr::select(-"tmp_version") } +# The latest patch of each Quarto minor release. Most releases are prereleases, so the newest 100 +# reach back several minors; older minors come from the fixed list +get_quarto_versions = function() { + releases = jsonlite::read_json( + "https://api.github.com/repos/quarto-dev/quarto-cli/releases?per_page=100" + ) + stable = purrr::discard(releases, ~ isTRUE(.x$prerelease)) + tags = stringr::str_remove(purrr::map_chr(stable, "tag_name"), "^v") + old = c("1.0.38", "1.1.189", "1.2.475", "1.3.450", "1.4.557", "1.5.57", "1.6.43") + latest_patch_per_minor(c(tags, old)) +} + +latest_patch_per_minor = function(versions) { + versions = unique(versions[stringr::str_detect(versions, "^[0-9]+\\.[0-9]+\\.[0-9]+$")]) + parts = matrix(as.integer(stringr::str_split_fixed(versions, "\\.", 3)), ncol = 3) + newest_first = order(parts[, 1], parts[, 2], parts[, 3], decreasing = TRUE) + versions = versions[newest_first] + versions[!duplicated(parts[newest_first, 1:2, drop = FALSE])] +} + get_latest_versions_from_posit = function(type = c("r", "python")) { type = match.arg(type) url = glue::glue("https://cdn.posit.co/{type}/versions.json") diff --git a/tests/testthat/test-get_latest_versions_remote.R b/tests/testthat/test-get_latest_versions_remote.R new file mode 100644 index 0000000..de151a3 --- /dev/null +++ b/tests/testthat/test-get_latest_versions_remote.R @@ -0,0 +1,4 @@ +test_that("latest_patch_per_minor() keeps every minor when a new one ships", { + versions = c("1.11.2", "1.10.19", "1.10.3", "1.11.0", "1.9.38", "1.12.0-rc1") + expect_identical(latest_patch_per_minor(versions), c("1.11.2", "1.10.19", "1.9.38")) +}) From b312ec85c0f470fe4c759f41086c7a0d0a4393b0 Mon Sep 17 00:00:00 2001 From: Colin Gillespie Date: Fri, 16 Oct 2026 14:19:34 +0100 Subject: [PATCH 2/2] chore: Bump version to 0.7.5 --- DESCRIPTION | 2 +- NEWS.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e98b0c9..1d8e94d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: audit.base Title: Base package for Posit Checks -Version: 0.7.4 +Version: 0.7.5 Authors@R: person("Jumping", "Rivers", , "info@jumpingrivers.com", role = c("aut", "cre")) Description: Base package for sharing classes between posit audit diff --git a/NEWS.md b/NEWS.md index 192094f..e288637 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# audit.base 0.7.5 _2026-10-16_ + * fix: The Quarto version list comes from GitHub's releases, so a new minor release no longer marks the previous one as past EOL (#60) + # audit.base 0.7.4 _2026-10-16_ * fix: `get_uv_python_versions()` works before R 4.4, as `%||%` is imported from rlang. DESCRIPTION requires R 4.1.0 and imports jsonlite (#61)