From 522aa074f89cf23de3d23c6444b5c3b334b241e5 Mon Sep 17 00:00:00 2001 From: Colin Gillespie Date: Wed, 24 Jan 2024 15:42:14 +0000 Subject: [PATCH] fix: Return distinct server headers (#21) --- DESCRIPTION | 2 +- NEWS.md | 3 +++ R/create_software_tibble.R | 2 ++ R/quarto-helpers.R | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a6a2dbf..be63198 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: audit.base Title: Base package for Posit Checks -Version: 0.6.10 +Version: 0.6.11 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 b432f1c..080c3fa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# audit.base 0.6.11 _2024-01-24_ +- fix: Return distinct server headers + # audit.base 0.6.10 _2023-10-19_ - fix: Add {serverHeaders} to Imports - feat: Update software versions diff --git a/R/create_software_tibble.R b/R/create_software_tibble.R index e619a4e..114047e 100644 --- a/R/create_software_tibble.R +++ b/R/create_software_tibble.R @@ -9,9 +9,11 @@ update_software_csv = function() { return(invisible(software)) } +# https://gitlab.com/jumpingrivers/services/de/spd/infrastructure-template/-/blob/5c584fced32a6fc8fd7b25b3ea78f6fb7a8bd7ca/template/ansible/scripts/versions.sh create_software_tibble = function() { r = get_latest_versions_from_posit("r") py = get_latest_versions_from_posit("python") + # 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", stringr::str_remove(q$name, "^v")) diff --git a/R/quarto-helpers.R b/R/quarto-helpers.R index c1a4eab..2335c02 100644 --- a/R/quarto-helpers.R +++ b/R/quarto-helpers.R @@ -12,7 +12,8 @@ get_quarto_server_header = function(out) { header_docs = purrr::map(.data$documentation, ~htmltools::a(href = .x, "(docs)")), message = purrr::map2(message, .data$header_docs, ~ gt::html(paste(.x, as.character(.y))))) %>% - dplyr::mutate(value = ifelse(is.na(.data$value), "-", .data$value)) + dplyr::mutate(value = ifelse(is.na(.data$value), "-", .data$value)) |> + dplyr::distinct() dplyr::select(headers, -"documentation", -"header_docs", -"primary_header") }