viirya opened a new pull request, #402:
URL: https://github.com/apache/spark-connect-swift/pull/402
### What changes were proposed in this pull request?
Port the hardening fixes from Apache Spark (SPARK-57154, SPARK-57155) to this
repository's `notify_test_workflow.yml` and `update_build_status.yml`, which
were
introduced here as a copy of Spark's fork-based CI status mechanism
(SPARK-57151).
`notify_test_workflow.yml`:
1. When listing the fork's workflow runs, instead of blindly taking the most
recent run (`workflow_runs[0]`) and throwing if its `head_sha` does not
match
the PR head SHA, retry (up to 3 times, 3s apart) looking for the run whose
`head_sha` matches the PR head SHA. The listing endpoint orders by most
recent,
so the run for the just-pushed SHA may not be registered yet and a stale
run
from a previous push could be returned.
2. When resolving the `Run / License Check` check-run id (used only to
render a
Check-run view link instead of the Actions view, see SPARK-37879), a
missing
check-run no longer throws. The check-run materializes later than the
workflow
run, especially when the matrix is queued, so this is now best-effort: if
it
cannot be found, the `Build` check is still created pointing at the
Actions
run URL.
`update_build_status.yml`:
3. List a commit's check-runs with `github.paginate(..., per_page: 100)`
instead
of a single un-paginated request, matching `notify_test_workflow.yml`. The
default page size is 30, so the target `Build` check could fall off the
first
page on a SHA that accumulates more check-runs than that.
4. Wrap `JSON.parse(cr.output.text)` in try/catch and `continue` on failure,
so a
`Build` check with empty or malformed output text does not abort the whole
scheduled run and block updates for every PR queued behind it.
### Why are the changes needed?
The race conditions previously left a PR with no `Build` check at all, and
the
scheduled updater only syncs existing checks, so the PR had no status
reported
until the next push. The pagination and parsing issues silently block status
updates, leaving PRs stuck in `queued`.
### Does this PR introduce _any_ user-facing change?
No. CI infrastructure only.
### How was this patch tested?
Static verification: the embedded `actions/github-script` bodies pass
`node --check`, and the workflow YAML parses.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]