-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: refactor "skipping a build" section #9717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
humitos
merged 6 commits into
humitos/skip-build-based-on-exit-code
from
humitos/skip-builds-docs
Nov 10, 2022
Merged
Docs: refactor "skipping a build" section #9717
humitos
merged 6 commits into
humitos/skip-build-based-on-exit-code
from
humitos/skip-builds-docs
Nov 10, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Move the explanation about the "Cancelling builds" feature to the "Builds" page - Keep the examples (How-To) for "Cancel a build" into the "Build customization" page
ericholscher
approved these changes
Nov 8, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition to the docs.
> This error code isn't a valid exit > code (tldp.org/LDP/abs/html/exitcodes.html), we shouldn't document a code above > 255 otherwise users will get confused. From Eric's review.
Co-authored-by: Eric Holscher <[email protected]>
They are easier to read
Co-authored-by: Eric Holscher <[email protected]>
humitos
added a commit
that referenced
this pull request
Nov 14, 2022
* Build: skip build based on commands' exit codes Define a particular exit code (439) to skip a build. If any of the commands returns this exit code, the build will be cancelled automatically and won't run any of the following commands. When this happens, the build will be marked as `cancelled` and no email/webhook notifications will be sent. Why 439 was chosen for the exit code? It's the word "skip" encoded in ASCII. Then it's taken the 256 modulo of it because the Unix implementation does this automatically for exit codes greater than 255 ``` >>> sum(list('skip'.encode('ascii'))) 439 >>> 439 % 256 183 ``` * Update readthedocs/doc_builder/exceptions.py Co-authored-by: Anthony <[email protected]> * Build: send SUCCESS external build status on skipped builds When the command exists with the magic exit code, we send SUCCESS to GitHub/GitLab as status so the PR check passes and the PR can be merged. * Docs: skip build based on a condition * Lint: small darker change * Docs: reference fixed * Docs: improve comment on YAML * Build: make usage of `status` variable Thanks to Benjamin for pointing it to me ;) * Apply suggestions from code review Co-authored-by: Benjamin Balder Bach <[email protected]> * Docs: update code example for skip builds Use Bash's `if` to only run this code on pull requests. * Docs: example showing how to skip the build based on commit message * Docs: refactor "skipping a build" section (#9717) * Docs: refactor "skipping a build" section - Move the explanation about the "Cancelling builds" feature to the "Builds" page - Keep the examples (How-To) for "Cancel a build" into the "Build customization" page * Docs: use 183 instead of 439 exit code > This error code isn't a valid exit > code (tldp.org/LDP/abs/html/exitcodes.html), we shouldn't document a code above > 255 otherwise users will get confused. From Eric's review. * Apply suggestions from code review Co-authored-by: Eric Holscher <[email protected]> * Minor fix underline * Use multi-line bash examples They are easier to read * Update docs/user/builds.rst Co-authored-by: Eric Holscher <[email protected]> Co-authored-by: Eric Holscher <[email protected]> * Docs: use `grep` instead of `case` * Docs: small note about "Why 183?" Co-authored-by: Anthony <[email protected]> Co-authored-by: Benjamin Balder Bach <[email protected]> Co-authored-by: Eric Holscher <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📚 Documentation previews 📚
docs
): https://docs--9717.org.readthedocs.build/en/9717/dev
): https://dev--9717.org.readthedocs.build/en/9717/