Skip to content

ci: guard fromJSON in detect-changes against empty pr-info output#1940

Merged
cpcloud merged 1 commit intoNVIDIA:mainfrom
cpcloud:ci-guard-detect-changes-fromjson
Apr 17, 2026
Merged

ci: guard fromJSON in detect-changes against empty pr-info output#1940
cpcloud merged 1 commit intoNVIDIA:mainfrom
cpcloud:ci-guard-detect-changes-fromjson

Conversation

@cpcloud
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud commented Apr 17, 2026

Summary

  • The detect-changes job's Detect changed paths step has an if: gate that should skip it on non-PR events, but GitHub Actions evaluates step-level env: expressions eagerly — the if: does not short-circuit them.
  • On push to main, tag, or schedule events the preceding Resolve PR base branch (pr-info) step is skipped and its outputs are empty strings, so fromJSON(steps.pr-info.outputs.pr-info) raises a template error and the step fails despite its if: being false. That cascades into Check job status and turns the whole run red (see run 24566662170).
  • Guard the fromJSON call with a short-circuit so the expression resolves to an empty string on non-PR events. On PR events the expression still evaluates to the PR's actual base ref, so behavior introduced in CI: Detect changed paths and gate cuda.bindings tests #1908 is preserved.

Test plan

  • After merge, the next push-to-main CI run reaches a successful Check job status instead of failing at detect-changes / Detect changed paths.
  • PR CI runs (including backport-target PRs resolved via nv-gha-runners/get-pr-info) still classify changed paths correctly and gate the bindings test matrix as before.

The detect-changes job's `Detect changed paths` step gates on
`startsWith(github.ref_name, 'pull-request/')`, but GitHub Actions
evaluates step-level `env:` expressions eagerly — the `if:` gate does
not short-circuit them. On push to main, tag, or schedule events the
preceding `Resolve PR base branch` step is skipped and its outputs
are empty strings, so `fromJSON(steps.pr-info.outputs.pr-info)`
raises a template error and fails the step even though its `if:`
would otherwise skip it. That failure cascades into the final
"Check job status" aggregation, turning every push-to-main CI run
red (see run 24566662170).

Guard the `fromJSON` call with a short-circuit so the expression
resolves to an empty string when pr-info did not run. On PR events
the expression still evaluates to the PR's actual base ref.
@cpcloud cpcloud added this to the cuda.core next milestone Apr 17, 2026
@cpcloud cpcloud self-assigned this Apr 17, 2026
@cpcloud cpcloud requested review from leofang and rwgk April 17, 2026 14:23
@cpcloud cpcloud added the CI/CD CI/CD infrastructure label Apr 17, 2026
@github-actions

This comment has been minimized.

@cpcloud cpcloud enabled auto-merge (squash) April 17, 2026 15:15
@cpcloud cpcloud added bug Something isn't working P0 High priority - Must do! labels Apr 17, 2026
@cpcloud cpcloud merged commit b991295 into NVIDIA:main Apr 17, 2026
99 of 101 checks passed
@github-actions
Copy link
Copy Markdown

Doc Preview CI
Preview removed because the pull request was closed or merged.

@cpcloud cpcloud deleted the ci-guard-detect-changes-fromjson branch April 18, 2026 10:22
mdboom pushed a commit to mdboom/cuda-python that referenced this pull request Apr 20, 2026
…IDIA#1940)

The detect-changes job's `Detect changed paths` step gates on
`startsWith(github.ref_name, 'pull-request/')`, but GitHub Actions
evaluates step-level `env:` expressions eagerly — the `if:` gate does
not short-circuit them. On push to main, tag, or schedule events the
preceding `Resolve PR base branch` step is skipped and its outputs
are empty strings, so `fromJSON(steps.pr-info.outputs.pr-info)`
raises a template error and fails the step even though its `if:`
would otherwise skip it. That failure cascades into the final
"Check job status" aggregation, turning every push-to-main CI run
red (see run 24566662170).

Guard the `fromJSON` call with a short-circuit so the expression
resolves to an empty string when pr-info did not run. On PR events
the expression still evaluates to the PR's actual base ref.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD CI/CD infrastructure P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants