Repository navigation
ci: Skip heavy test jobs for docs-only PRs - #2391
Conversation
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| FILES=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \ |
There was a problem hiding this comment.
Hmm, perhaps cleaner to interact in terms of git diff? Aren't there existing actions/tools for this?
Assisted-by: AI Signed-off-by: gursewak1997 <gursmangat@gmail.com>
d0e1edc to
703748e
Compare
|
So I got suspicious when merging this because currently our CI was down...and this job changed CI itself, not just docs, so CI should have been failing. Basically That error goes to stderr, so stdout is empty. Piped into I have to emphasize just how absolutely terrible of a language shell script is, and this is a perfect example of that. We need to add a checkout step and also correctly test exit status, which is best by separating fetch from grep. |
|
Since we're redoing this let's also please try harder to clean up this code, I think we should only be testing the docs conditional once for example. Also what may work better is to factor out this stuff into e.g. |
|
Bigger picture one thing we could try to do is factor out most of this logic into https://github.com/bootc-dev/actions perhaps and try to apply it consistently across all of the repos that way. (And when we do that we should write more of it in typescript probably, not bash) |
|
This should have been caught earlier but starting the factoring out: bootc-dev/actions#51 |
|
Sorry I'm giving slightly conflicting messages but it may make the most sense to do a quick PR that tries to fix this in the existing shell script and land that ASAP, but have a parallel effort to do the generic actions and js logic? |
|
That was my take but then I went on an ambitious tangent and thought we could land something in actions soon (today) and get something up and running. Let me fix this and make sure we are not skipping CI:/ |
|
No worries, and thanks for working on this! BTW one thing I've been doing because this stuff is hard to test is basically having agents force push to https://github.com/bootc-dev/ci-sandbox and testing things there. (Though we should perhaps make separate $username-ci-sandbox repos to avoid conflict?) |
The previous attempt (merged in bootc-dev#2391) failed silently because compute-ci-level had no checkout step, so gh pr diff could not infer the repository and produced empty output. The pipe into grep swallowed the error, setting docs_only=true for all PRs. Fix by adding a sparse checkout for PR events, separating the gh pr diff fetch from the grep so failures abort via set -euo pipefail, and guarding empty output explicitly. Assisted-by: AI Signed-off-by: gursewak1997 <gursmangat@gmail.com>
The previous attempt (merged in bootc-dev#2391) failed silently because compute-ci-level had no checkout step, so gh pr diff could not infer the repository and produced empty output. The pipe into grep swallowed the error, setting docs_only=true for all PRs. Fix by adding a sparse checkout for PR events, separating the gh pr diff fetch from the grep so failures abort via set -euo pipefail, and guarding empty output explicitly. Assisted-by: AI Signed-off-by: gursewak1997 <gursmangat@gmail.com>
The previous attempt (merged in bootc-dev#2391) failed silently because compute-ci-level had no checkout step, so gh pr diff could not infer the repository and produced empty output. The pipe into grep swallowed the error, setting docs_only=true for all PRs. Fix by adding a sparse checkout for PR events, separating the gh pr diff fetch from the grep so failures abort via set -euo pipefail, and guarding empty output explicitly. Assisted-by: AI Signed-off-by: gursewak1997 <gursmangat@gmail.com>
The previous attempt (merged in #2391) failed silently because compute-ci-level had no checkout step, so gh pr diff could not infer the repository and produced empty output. The pipe into grep swallowed the error, setting docs_only=true for all PRs. Fix by adding a sparse checkout for PR events, separating the gh pr diff fetch from the grep so failures abort via set -euo pipefail, and guarding empty output explicitly. Assisted-by: AI Signed-off-by: gursewak1997 <gursmangat@gmail.com>
Skip heavy test jobs for docs-only PRs