Skip to content
Merged
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 releasey/libs/_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 on GH runners).

Suggested change
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'"
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:

[
  "Unit Tests",
  "Quarkus Tests",
  "Quarkus Integration Tests",
  "Quarkus Admin Tests",
  "Integration Tests",
  "regtest",
  "spark-plugin-regtest",
  "site",
  "Helm tests"
]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to run a full release cycle before merging this, and that requires all CI checks to pass (>20 minutes) plus another 20 minutes to fully package Polaris and its components. Let's open a separate PR for that so that I can merge this PR and release 1.3.0 in about 45 minutes.

if [ ${DRY_RUN} -eq 1 ]; then
print_info "DRY_RUN is enabled, skipping GitHub check verification"
print_command "${num_invalid_checks_retrieval_command}"
Expand Down