From 126222f3bb20bdf328aaa8a37b81fde387e53891 Mon Sep 17 00:00:00 2001 From: Diego H Date: Mon, 6 Oct 2025 10:27:40 +0000 Subject: [PATCH 1/3] Try new version --- .github/workflows/manual-debug.yml | 132 +++++++++++++---------------- action.yml | 20 ++--- cran-status.md | 23 +++++ docker/action.yml | 44 ++++------ docker/check-status.R | 85 +++++++++---------- docker/entrypoint.sh | 2 +- issue.md | 25 ++++++ 7 files changed, 174 insertions(+), 157 deletions(-) create mode 100644 cran-status.md create mode 100644 issue.md diff --git a/.github/workflows/manual-debug.yml b/.github/workflows/manual-debug.yml index d113b58..562ac65 100644 --- a/.github/workflows/manual-debug.yml +++ b/.github/workflows/manual-debug.yml @@ -1,71 +1,61 @@ -name: manual-debug - -on: - workflow_dispatch: - inputs: - path: - description: | - Path to the R package root, if the package is not at the top level of - the repository. - default: "." - required: false - type: string - package: - description: | - Package to check. If provided, it would have priority over the - package on the repo. - required: false - default: "" - type: string - statuses: - description: | - Create an issue if one or more of the following statuses are - reported on the check report. This is a comma-separated string of - statuses. Default value is ''WARN,ERROR'. Allowed statuses are - 'NOTE', 'WARN', and 'ERROR'. - default: "WARN,ERROR" - required: false - type: string - fail-on-error: - description: | - Logical, should the action error if CRAN checks are not ok? - default: "false" - required: false - type: boolean - create-issue: - description: | - Logical, create an issue on CRAN failed checks - default: "true" - required: false - type: boolean - issue-assignees: - description: | - Whom should the issue be assigned to if errors are - encountered in the CRAN status checks? - This is a comma-separated string of GitHub usernames. - If undefined or empty, no assignments are made. - default: "" - required: false - type: string - -jobs: - check: - runs-on: ubuntu-latest - permissions: write-all - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Check - uses: dieghernan/cran-status-check@main - with: - path: ${{ inputs.path }} - package: ${{ inputs.package }} - statuses: ${{ inputs.statuses }} - fail-on-error: ${{ inputs.fail-on-error }} - create-issue: ${{ inputs.create-issue }} - issue-assignees: ${{ inputs.issue-assignees }} - +name: manual-debug + +on: + workflow_dispatch: + inputs: + path: + description: | + Path to the R package root, if the package is not at the top level of + the repository. + default: "." + required: false + type: string + package: + description: | + Package to check. If provided, it would have priority over the + package on the repo. + required: false + default: "" + type: string + fail-on-error: + description: | + Logical, should the action error if CRAN checks are not ok? + default: "false" + required: false + type: boolean + create-issue: + description: | + Logical, create an issue on CRAN failed checks + default: "true" + required: false + type: boolean + issue-assignees: + description: | + Whom should the issue be assigned to if errors are + encountered in the CRAN status checks? + This is a comma-separated string of GitHub usernames. + If undefined or empty, no assignments are made. + default: "" + required: false + type: string + +jobs: + check: + runs-on: ubuntu-latest + permissions: write-all + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Check + uses: dieghernan/cran-status-check@dev + with: + path: ${{ inputs.path }} + package: ${{ inputs.package }} + fail-on-error: ${{ inputs.fail-on-error }} + create-issue: ${{ inputs.create-issue }} + issue-assignees: ${{ inputs.issue-assignees }} + diff --git a/action.yml b/action.yml index d9e765e..e1f6323 100644 --- a/action.yml +++ b/action.yml @@ -19,14 +19,6 @@ inputs: required: false default: "" type: string - statuses: - description: | - CRAN status to check. This is a comma-separated string of - statuses. Default value is ''WARN,ERROR'. Allowed statuses are - 'NOTE', 'WARN', and 'ERROR'. - default: "WARN,ERROR" - required: false - type: string fail-on-error: description: | Logical, should the action error if CRAN checks are not ok? @@ -48,7 +40,12 @@ inputs: default: "" required: false type: string - + statuses: + description: | + DEPRECATED + default: "" + required: false + type: string # Workflow derived from pharmaverse/admiralci # See for the original work from which this workflow is derived # https://github.com/pharmaverse/admiralci/blob/61347fe11955297818b3ca7814fc7328f2ad7840/.github/workflows/cran-status.yml @@ -85,7 +82,6 @@ runs: - name: Compute Cran Status codes uses: dieghernan/cran-status-check/docker@main with: - statuses: "${{ inputs.statuses }}" package: "${{ steps.pkg.outputs.package_name }}" # Report check @@ -118,7 +114,7 @@ runs: if: steps.err.outputs.error == 'true' && inputs.create-issue == 'true' uses: peter-evans/create-issue-from-file@v5 with: - title: "URGENT! Failed CRAN Checks for ${{ steps.pkg.outputs.package_name }}: ${{ steps.today.outputs.date }}" + title: "URGENT! ${{ steps.pkg.outputs.package_name }} at risk on CRAN: ${{ steps.today.outputs.date }}" content-filepath: ././cran-status.md assignees: ${{ inputs.issue-assignees }} @@ -127,6 +123,6 @@ runs: shell: bash run: | # Stop action - echo "::error::CRAN checks are not OK, see Job Summary of this GH action for details" + echo "::error::Package at risk, see Job Summary of this GH action for details" exit 1 diff --git a/cran-status.md b/cran-status.md new file mode 100644 index 0000000..ad600a7 --- /dev/null +++ b/cran-status.md @@ -0,0 +1,23 @@ +:white_check_mark: **Package dplyr is not at risk for removal + +See the table below for a summary of the checks run by CRAN: + + +|Flavor |Version | Tinstall| Tcheck| Ttotal|Status |Flags | +|:---------------------------------|:-------|--------:|------:|------:|:------|:-----| +|r-devel-linux-x86_64-debian-clang |1.1.4 | 23.48| 300.92| 324.40|NOTE |NA | +|r-devel-linux-x86_64-debian-gcc |1.1.4 | 13.73| 197.59| 211.32|NOTE |NA | +|r-devel-linux-x86_64-fedora-clang |1.1.4 | NA| NA| 516.59|NOTE |NA | +|r-devel-linux-x86_64-fedora-gcc |1.1.4 | NA| NA| 509.91|NOTE |NA | +|r-devel-windows-x86_64 |1.1.4 | 1.00| 5.00| 6.00|ERROR |NA | +|r-patched-linux-x86_64 |1.1.4 | 23.13| 279.79| 302.92|NOTE |NA | +|r-release-linux-x86_64 |1.1.4 | 21.56| 279.95| 301.51|NOTE |NA | +|r-release-macos-arm64 |1.1.4 | NA| NA| 194.00|NOTE |NA | +|r-release-macos-x86_64 |1.1.4 | NA| NA| 311.00|NOTE |NA | +|r-release-windows-x86_64 |1.1.4 | 34.00| 298.00| 332.00|NOTE |NA | +|r-oldrel-macos-arm64 |1.1.4 | NA| NA| 137.00|OK |NA | +|r-oldrel-macos-x86_64 |1.1.4 | NA| NA| 232.00|OK |NA | +|r-oldrel-windows-x86_64 |1.1.4 | 40.00| 392.00| 432.00|OK |NA | + + +All details and logs are available here: https://cran.r-project.org/web/checks/check_results_dplyr.html diff --git a/docker/action.yml b/docker/action.yml index f69f295..6fae692 100644 --- a/docker/action.yml +++ b/docker/action.yml @@ -1,28 +1,16 @@ -# Workflow derived from https://github.com/pharmaverse/admiralci - -name: CRAN Status Check -description: Creates a summary of issues reported on the CRAN status check page for a given R package - -inputs: - package: - description: | - Package name of the current R package deployed to CRAN - required: true - type: string - statuses: - description: | - Create an issue if one or more of the following - statuses are reported on the check report. - This is a comma-separated string of statuses. - Allowed statuses are 'NOTE', 'WARN', and 'ERROR' - default: 'ERROR' - required: false - type: string - -runs: - using: 'docker' - image: './Dockerfile' - args: - - ${{ inputs.package }} - - ${{ inputs.statuses }} - +# Workflow derived from https://github.com/pharmaverse/admiralci + +name: CRAN Status Check +description: Creates a summary of issues reported on the CRAN status check page for a given R package + +inputs: + package: + description: | + Package name of the current R package deployed to CRAN + required: true + type: string +runs: + using: 'docker' + image: './Dockerfile' + args: + - ${{ inputs.package }} diff --git a/docker/check-status.R b/docker/check-status.R index 3e0b46d..3bcf861 100644 --- a/docker/check-status.R +++ b/docker/check-status.R @@ -26,11 +26,6 @@ option_list <- list( type = "character", help = "package name (REQUIRED)", metavar = "character" - ), - make_option(c("-s", "--statuses"), - type = "character", default = "ERROR,WARN,NOTE", - help = "status types (comma separated list, e.g. ERROR,WARN,NOTE", - metavar = "character" ) ) opt_parser <- OptionParser(option_list = option_list) @@ -43,17 +38,21 @@ cran_status <- function(x) { # 2. Get Inputs ---- pkg <- opt$package # paste(desc::desc_get(keys = "Package")) -# Get input status -status_types <- opt$statuses -statuses <- unlist(strsplit(status_types, split = ",")) - url <- sprintf("https://cran.r-project.org/web/checks/check_results_%s.html", pkg) # 3. Tests ----- cat("Testing package:", pkg, "\n-----\n") -## a. Url not reachable ---- -if (httr::http_error(url)) { +# Getting database +options(repos = c(CRAN = "https://cloud.r-project.org")) +pkg_db <- tools::CRAN_package_db() %>% + as_tibble() %>% + filter(Package == pkg) + + +## a. Not in database ---- + +if (nrow(pkg_db) == 0) { cat( paste0("::warning::Package ", pkg, " not found on CRAN.") ) @@ -62,15 +61,17 @@ if (httr::http_error(url)) { paste0(":x: **Package ", pkg, " not found on CRAN**:\n\n") ) - cran_status(paste0("Error accessing url:\n", url)) + cran_status(paste0("Check url:\n", url)) # Copy to issue file.copy("cran-status.md", "issue.md") } -## b. Found on CRAN, check issues ---- +## b. Found on CRAN, check deadline ---- if (!file.exists("cran-status.md")) { + deadline <- pkg_db %>% pull(Deadline) + scrap <- url %>% read_html() @@ -78,25 +79,39 @@ if (!file.exists("cran-status.md")) { html_element("table") %>% html_table() - any_error <- any(cranchecks$Status %in% statuses) additional <- grepl("Additional", html_text(scrap), ignore.case = TRUE) - ### i. Has issues ---- - if (any_error) { + # Is on deadline? + is_deadline <- !is.na(deadline) + + if (is_deadline) { + # Notify cran_status(sprintf( - ":x: **CRAN checks for %s resulted in one or more (`%s`)s**:\n\n", + ":x: **Package %s at risk for removal by `%s`**:\n\n", pkg, - status_types + deadline )) - cran_status("\nSee the table below for a summary of the checks run by CRAN:\n\n") - cran_status(knitr::kable(cranchecks)) + + cat("::warning::Package at risk for removal") + } else { cran_status(sprintf( - "\n\nAll details and logs are available here: %s\n\n", url + ":white_check_mark: **Package %s is not at risk for removal", + pkg )) - cat("::warning::One or more CRAN checks resulted in an invalid status\n") + + cat("Package is not at risk for removal") } - ### ii. Has additional issues ---- + # Additional info + + # Add checks + cran_status("\nSee the table below for a summary of the checks run by CRAN:\n\n") + cran_status(knitr::kable(cranchecks)) + cran_status(sprintf( + "\n\nAll details and logs are available here: %s", url + )) + + # Additional issues if (additional) { cran_status(sprintf( @@ -109,27 +124,7 @@ if (!file.exists("cran-status.md")) { cat(paste0("::warning::", pkg, " has Additional issues\n")) } - ## So far if cran-status.md exists, generate issue - if (file.exists("cran-status.md")) file.copy("cran-status.md", "issue.md") - - ### iii. All OK ---- - # If no issue has been generated - if (!file.exists("cran-status.md")) { - cat( - sprintf("None of this status found in the CRAN table. (status=%s)", status_types) - ) - - cran_status(sprintf( - ":white_check_mark: **CRAN error for %s not found with (`%s`)s**:\n\n", - pkg, - status_types - )) - - cran_status("\nSee the table below for a summary of the checks run by CRAN:\n\n") - cran_status(knitr::kable(cranchecks)) - cran_status(sprintf( - "\n\nAll details and logs are available here: %s", url - )) - } + # Prepare the issue + if (is_deadline) file.copy("cran-status.md", "issue.md") } diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d32c288..dc16670 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -Rscript /app/check-status.R -p "${INPUT_PACKAGE}" -s "${INPUT_STATUSES}" +Rscript /app/check-status.R -p "${INPUT_PACKAGE}" diff --git a/issue.md b/issue.md new file mode 100644 index 0000000..01a46d8 --- /dev/null +++ b/issue.md @@ -0,0 +1,25 @@ +:x: **Package devtools at risk for removal by `2025-10-31`**: + + + +See the table below for a summary of the checks run by CRAN: + + +|Flavor |Version | Tinstall| Tcheck| Ttotal|Status |Flags | +|:---------------------------------|:-------|--------:|------:|------:|:------|:-----| +|r-devel-linux-x86_64-debian-clang |2.4.5 | 8.76| 103.62| 112.38|NOTE |NA | +|r-devel-linux-x86_64-debian-gcc |2.4.6 | 4.50| 67.77| 72.27|OK |NA | +|r-devel-linux-x86_64-fedora-clang |2.4.6 | NA| NA| 169.16|OK |NA | +|r-devel-linux-x86_64-fedora-gcc |2.4.6 | NA| NA| 175.92|OK |NA | +|r-devel-windows-x86_64 |2.4.5 | 14.00| 133.00| 147.00|NOTE |NA | +|r-patched-linux-x86_64 |2.4.5 | 8.63| 96.13| 104.76|NOTE |NA | +|r-release-linux-x86_64 |2.4.6 | 6.77| 84.86| 91.63|OK |NA | +|r-release-macos-arm64 |2.4.5 | NA| NA| 94.00|OK |NA | +|r-release-macos-x86_64 |2.4.6 | NA| NA| 124.00|OK |NA | +|r-release-windows-x86_64 |2.4.6 | 9.00| 125.00| 134.00|OK |NA | +|r-oldrel-macos-arm64 |2.4.5 | NA| NA| 90.00|OK |NA | +|r-oldrel-macos-x86_64 |2.4.6 | NA| NA| 130.00|OK |NA | +|r-oldrel-windows-x86_64 |2.4.6 | 16.00| 134.00| 150.00|OK |NA | + + +All details and logs are available here: https://cran.r-project.org/web/checks/check_results_devtools.html From 7d9fd2644186d8edbc417b8047cb36d0bbede877 Mon Sep 17 00:00:00 2001 From: Diego H Date: Mon, 6 Oct 2025 10:34:24 +0000 Subject: [PATCH 2/3] Cleanup repo --- .github/workflows/manual-debug.yml | 2 +- cran-status.md | 23 ----------------------- issue.md | 25 ------------------------- 3 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 cran-status.md delete mode 100644 issue.md diff --git a/.github/workflows/manual-debug.yml b/.github/workflows/manual-debug.yml index 562ac65..feb1d6b 100644 --- a/.github/workflows/manual-debug.yml +++ b/.github/workflows/manual-debug.yml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v5 - name: Check - uses: dieghernan/cran-status-check@dev + uses: dieghernan/cran-status-check@main with: path: ${{ inputs.path }} package: ${{ inputs.package }} diff --git a/cran-status.md b/cran-status.md deleted file mode 100644 index ad600a7..0000000 --- a/cran-status.md +++ /dev/null @@ -1,23 +0,0 @@ -:white_check_mark: **Package dplyr is not at risk for removal - -See the table below for a summary of the checks run by CRAN: - - -|Flavor |Version | Tinstall| Tcheck| Ttotal|Status |Flags | -|:---------------------------------|:-------|--------:|------:|------:|:------|:-----| -|r-devel-linux-x86_64-debian-clang |1.1.4 | 23.48| 300.92| 324.40|NOTE |NA | -|r-devel-linux-x86_64-debian-gcc |1.1.4 | 13.73| 197.59| 211.32|NOTE |NA | -|r-devel-linux-x86_64-fedora-clang |1.1.4 | NA| NA| 516.59|NOTE |NA | -|r-devel-linux-x86_64-fedora-gcc |1.1.4 | NA| NA| 509.91|NOTE |NA | -|r-devel-windows-x86_64 |1.1.4 | 1.00| 5.00| 6.00|ERROR |NA | -|r-patched-linux-x86_64 |1.1.4 | 23.13| 279.79| 302.92|NOTE |NA | -|r-release-linux-x86_64 |1.1.4 | 21.56| 279.95| 301.51|NOTE |NA | -|r-release-macos-arm64 |1.1.4 | NA| NA| 194.00|NOTE |NA | -|r-release-macos-x86_64 |1.1.4 | NA| NA| 311.00|NOTE |NA | -|r-release-windows-x86_64 |1.1.4 | 34.00| 298.00| 332.00|NOTE |NA | -|r-oldrel-macos-arm64 |1.1.4 | NA| NA| 137.00|OK |NA | -|r-oldrel-macos-x86_64 |1.1.4 | NA| NA| 232.00|OK |NA | -|r-oldrel-windows-x86_64 |1.1.4 | 40.00| 392.00| 432.00|OK |NA | - - -All details and logs are available here: https://cran.r-project.org/web/checks/check_results_dplyr.html diff --git a/issue.md b/issue.md deleted file mode 100644 index 01a46d8..0000000 --- a/issue.md +++ /dev/null @@ -1,25 +0,0 @@ -:x: **Package devtools at risk for removal by `2025-10-31`**: - - - -See the table below for a summary of the checks run by CRAN: - - -|Flavor |Version | Tinstall| Tcheck| Ttotal|Status |Flags | -|:---------------------------------|:-------|--------:|------:|------:|:------|:-----| -|r-devel-linux-x86_64-debian-clang |2.4.5 | 8.76| 103.62| 112.38|NOTE |NA | -|r-devel-linux-x86_64-debian-gcc |2.4.6 | 4.50| 67.77| 72.27|OK |NA | -|r-devel-linux-x86_64-fedora-clang |2.4.6 | NA| NA| 169.16|OK |NA | -|r-devel-linux-x86_64-fedora-gcc |2.4.6 | NA| NA| 175.92|OK |NA | -|r-devel-windows-x86_64 |2.4.5 | 14.00| 133.00| 147.00|NOTE |NA | -|r-patched-linux-x86_64 |2.4.5 | 8.63| 96.13| 104.76|NOTE |NA | -|r-release-linux-x86_64 |2.4.6 | 6.77| 84.86| 91.63|OK |NA | -|r-release-macos-arm64 |2.4.5 | NA| NA| 94.00|OK |NA | -|r-release-macos-x86_64 |2.4.6 | NA| NA| 124.00|OK |NA | -|r-release-windows-x86_64 |2.4.6 | 9.00| 125.00| 134.00|OK |NA | -|r-oldrel-macos-arm64 |2.4.5 | NA| NA| 90.00|OK |NA | -|r-oldrel-macos-x86_64 |2.4.6 | NA| NA| 130.00|OK |NA | -|r-oldrel-windows-x86_64 |2.4.6 | 16.00| 134.00| 150.00|OK |NA | - - -All details and logs are available here: https://cran.r-project.org/web/checks/check_results_devtools.html From d841a24b2e03d354d32dbec01df377d14d29a1aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:52:40 +0000 Subject: [PATCH 3/3] Bump peter-evans/create-issue-from-file from 5 to 6 Bumps [peter-evans/create-issue-from-file](https://github.com/peter-evans/create-issue-from-file) from 5 to 6. - [Release notes](https://github.com/peter-evans/create-issue-from-file/releases) - [Commits](https://github.com/peter-evans/create-issue-from-file/compare/v5...v6) --- updated-dependencies: - dependency-name: peter-evans/create-issue-from-file dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e1f6323..46d31fd 100644 --- a/action.yml +++ b/action.yml @@ -112,7 +112,7 @@ runs: - name: Report Status if: steps.err.outputs.error == 'true' && inputs.create-issue == 'true' - uses: peter-evans/create-issue-from-file@v5 + uses: peter-evans/create-issue-from-file@v6 with: title: "URGENT! ${{ steps.pkg.outputs.package_name }} at risk on CRAN: ${{ steps.today.outputs.date }}" content-filepath: ././cran-status.md