Skip to content

Conversation

@aeisenberg
Copy link
Contributor

@aeisenberg aeisenberg commented Feb 17, 2022

This commit adds a UserError class that should be thrown when the
cause of an error is fundamentally from user configuration.

When sending status reports, avoid sending a failure for UserErrors.
This will prevent our diagnostics from pinging us for errors outside of
our control.

This particular PR adds two cases where we use user-error instead of failure:

  1. When the action is too old and cannot support the version of the CLI being used.
  2. When a user calls the init action twice in one workflow.

We can add more cases as we see fit.

Questions for reviewers:

  1. Is it ok to add a new kind of key (user-error) to our status reports?
  2. I'm not happy with using text matching and regex to determine if the error is from the user. Is there a better way? We may need to also make changes to the CLI to add some sort of error code or other way to identify errors.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

This commit adds a `UserError` class that should be thrown when the
cause of an error is fundamentally from user configuration.

When sending status reports, avoid sending a `failure` for `UserError`s.
This will prevent our diagnostics from pinging us for errors outside of
our control.
@aeisenberg aeisenberg requested a review from a team as a code owner February 17, 2022 19:52
@aeisenberg
Copy link
Contributor Author

OK...Looks like there may need to be a server-side change as well. Here is an attempt to send a user-error report. It fails with:

user-error is not a member of ["success", "failure", "starting", "aborted"].

Alternatively, we could send aborted and avoid changing the server, but the semantics isn't right.

Copy link
Contributor

@edoardopirovano edoardopirovano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems good to me. You'll want to hold off merging till my PR doing the server-side changes is merged, however.

@edoardopirovano
Copy link
Contributor

Server-side changes are done. I'm going to go ahead and merge this.

@edoardopirovano edoardopirovano merged commit f14beeb into main Feb 23, 2022
@edoardopirovano edoardopirovano deleted the aeisenberg/user-error branch February 23, 2022 11:21
@edoardopirovano
Copy link
Contributor

Confirmed a test run looks good: https://github.com/edoardopirovano/actions-test2/runs/5302594964

I can also find the test run in Splunk and it's correctly tagged with user-error.

@github-actions github-actions bot mentioned this pull request Feb 23, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants