Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
38 changes: 21 additions & 17 deletions R/get_latest_versions_remote.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-get_latest_versions_remote.R
Original file line number Diff line number Diff line change
@@ -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"))
})
Loading