snazy commented on code in PR #3116:
URL: https://github.com/apache/polaris/pull/3116#discussion_r2552703298


##########
releasey/libs/_github.sh:
##########
@@ -43,7 +43,7 @@ function check_github_checks_passed() {
   local repo_info="$GITHUB_REPOSITORY"
 
   local num_invalid_checks
-  local num_invalid_checks_retrieval_command="gh api 
repos/${repo_info}/commits/${commit_sha}/check-runs --jq '[.check_runs[] | 
select(.conclusion != \"success\" and .conclusion != \"skipped\" and (.name | 
startswith(\"Release - \") | not))] | length'"
+  local num_invalid_checks_retrieval_command="gh api 
repos/${repo_info}/commits/${commit_sha}/check-runs --jq '[.check_runs[] | 
select(.conclusion != \"success\" and .conclusion != \"skipped\" and (.name | 
startswith(\"Release - \") | not) and (.name != \"markdown-link-check\"))] | 
length'"

Review Comment:
   This is probably more flexible.
   We already have the name of the required checks in `.asf.yaml`, and can get 
the names as a JSON array via `yq` 
([available](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#tools)
 on GH runners).
   
   ```suggestion
     local required_check_names_array="$(yq -o json 
'.github.protected_branches.main.required_status_checks.contexts' < .asf.yaml)"
     # 
     local num_invalid_checks_retrieval_command="$(gh api 
repos/${repo_info}/commits/${commit_sha}/check-runs --jq "
   [
     .check_runs[] |
     select(
       .conclusion != \"success\" and
       .conclusion != \"skipped\" and
       (
         .name as \$name |
         any(
           ${required_check_names_array}[] == \$name
         )
       )
     )
   ]
   | length
   ")"
   ```
   
   
   The `yq` command yields:
   ```json
   [
     "Unit Tests",
     "Quarkus Tests",
     "Quarkus Integration Tests",
     "Quarkus Admin Tests",
     "Integration Tests",
     "regtest",
     "spark-plugin-regtest",
     "site",
     "Helm tests"
   ]
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to