Skip to content
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 status action type #71

Closed
jnwng opened this issue Aug 19, 2020 · 3 comments · Fixed by #106
Closed

Add status action type #71

jnwng opened this issue Aug 19, 2020 · 3 comments · Fixed by #106
Assignees
Labels

Comments

@jnwng
Copy link
Collaborator

jnwng commented Aug 19, 2020

in discussions about what the purpose of the dryRun flag is, it was a little confusing as to what it actually does.

however, it is clear that dryRun true is the same as action: none, which i think is a little more clear in terms of "what happens when this rule passes"

@gagoar
Copy link
Owner

gagoar commented Aug 20, 2020

I've been thinking about this option. This will override the action on all the rules that have been defined. is that what you were thinking? meaning it will be at the workflow level, like dryRun.

@gagoar
Copy link
Owner

gagoar commented Aug 20, 2020

I think the best would be to add another enum to the action field in the rule, that clearly states that if the rule does not match, the step will fail. FAIL_STEP would be the value

@cyamonide cyamonide added the 2.0 label Aug 23, 2020
@cyamonide cyamonide changed the title Change dryRun -> action: none Add check_required action type Aug 23, 2020
@cyamonide cyamonide added 2.1 and removed 2.0 labels Aug 23, 2020
@cyamonide
Copy link
Collaborator

Re: discussion with @gagoar offline, perhaps the best way moving forward here is to introduce a new action called check_required, which will trigger a failing GitHub check when the rule isn't matched. Instead of using the customMessage field to post a comment on a PR, that field would be interpreted as the error message to communicate on failure.

This new action should effectively eliminate the need of errorLevel and the none action, as described in #87.

This also begs the question of whether we should introduce a check_optional action. I argue no, since I don't see a use case for having a check_optional that doesn't have any side effects (neither triggers a failing check nor posts a message).

@gagoar gagoar changed the title Add check_required action type Add status action type Aug 24, 2020
@gagoar gagoar mentioned this issue Aug 31, 2020
3 tasks
gagoar added a commit that referenced this issue Sep 7, 2020
**Issue Reference**:  fixes #71 

## Description

One good enhancement of failing a workflow is to just have rules that can fail or succeed on a  commit status.
this PR adds that feature. 

## Motivation and Context

We have found that failing the entire step when using `errorLevel: error` might be too blunt and perhaps we could a status as a way to display individual rules when `action` is set to `status`

## How Has This Been Tested?
unit test and changing validation_template to use this feature moving forward.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants