-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add support for allowing skipped checks in has_successful_status
#789
base: develop
Are you sure you want to change the base?
Add support for allowing skipped checks in has_successful_status
#789
Commits on Jul 7, 2024
-
Add utility functions to allow predicates to take lists of conclusions
If a predicate has an `allowedConclusions` member, it will unmarshal from a list `["a", "b", "c"]` into a set, so that the handler can easily check if the incoming conclusion was allowed.
Configuration menu - View commit details
-
Copy full SHA for caba90e - Browse repository at this point
Copy the full SHA caba90eView commit details -
Add support for allowing skipped checks in
has_successful_status
The `has_successful_status` predicate currently requires predicates to be present and successful in order to pass. But workflows can be run conditionally - for example only if certain paths change - and it is currently not very convenient to write a policy which considers such skipped workflows as passing. The only feasible workaround is to duplicate the path filters in the policy, and this quickly gets unwieldy and prone to getting out-of-sync in large repositories. Here we add direct support for specifying such rules. This is done by introducing a new alernative form that `has_successful_status` predicates can take: ```yaml has_successful_status: options: skipped_is_success: true statuses: - "status 1" - "status 2" ``` In this mode, we will consider the `skipped` result as acceptable. The current form: ```yaml has_successful_status: - "status 1" - "status 2" ``` remains supported. We have done this by implementing a custom unmarshaling function to be able to handle both forms. Closes: palantir#760
Configuration menu - View commit details
-
Copy full SHA for a5acfbc - Browse repository at this point
Copy the full SHA a5acfbcView commit details -
Implement `has_successful_status` in terms of `has_status` and deprecate it. This avoids us having two forms for one predidcate. An example would be ```yaml has_status: conclusions: ["success", "skipped"] statuses: - "status 1" - "status 2" ```
Configuration menu - View commit details
-
Copy full SHA for d96d2a0 - Browse repository at this point
Copy the full SHA d96d2a0View commit details
Commits on Jul 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2d9c41c - Browse repository at this point
Copy the full SHA 2d9c41cView commit details -
README: Add back documentation fo
has_successful_status
Mark it as deprecated instead of removing it.
Configuration menu - View commit details
-
Copy full SHA for 06ae646 - Browse repository at this point
Copy the full SHA 06ae646View commit details -
Rearrange things to define
HasSuccessfulStatus
in terms ofHasStatus
This is more direct. We want to test `HasSuccessfulStatus` now, so jiggle the testsuite a bit to make that less repetitive by introducing a `StatusTestSuite` struct.
Configuration menu - View commit details
-
Copy full SHA for 1793921 - Browse repository at this point
Copy the full SHA 1793921View commit details -
It's more code for not too much gain since we're only dealing with tiny slices and not really looking through them that often.
Configuration menu - View commit details
-
Copy full SHA for ebee532 - Browse repository at this point
Copy the full SHA ebee532View commit details