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

Format Github exceptions in Airflow pipeline #1366

Merged

Conversation

kiersten-stokes
Copy link
Member

@kiersten-stokes kiersten-stokes commented Mar 3, 2021

Parses the GithubException object into its status and data properties and writes them to formatted error string, along with a message that directs the user to check their entered runtime configuration details.

Covers the following cases:

  • incorrect branch name
  • incorrect repository name
  • incorrect repository token
  • incorrect GitHub server API endpoint

Screenshots

Incorrect branch name. Error caught in upload_dag function
wrong-branch-fix

Incorrect repository name. Error caught in get_repo function on GithubClient init and moves up the exception chain to the try/except block in processor_airflow.py
wrong-token-fix

Fixes #1332

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@elyra-bot
Copy link

elyra-bot bot commented Mar 3, 2021

Thanks for making a pull request to Elyra!

To try out this branch on binder, follow this link: Binder

Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

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

This looks really good @kiersten-stokes - thank you. My only recommendation would be to update the first word in your description from "Addresses" to one of the documented keywords that trigger an issue's auto-closure from a merged PR. (Although not explicitly stated, case doesn't matter. I'm partial to "Resolves" myself. 😄 )

@kiersten-stokes
Copy link
Member Author

That's a great tip, thank you @kevin-bates! I didn't know that this feature existed until now

@lresende lresende added this to the 2.1.0 milestone Mar 3, 2021
@lresende lresende merged this pull request into elyra-ai:master Mar 3, 2021
@kevin-bates
Copy link
Member

Just to clarify the keyword stuff, the placement doesn't matter (based on what I've read). I suspect the only aspect that matters is the relationship of the keyword to the issue number. Also, I've just learned that this keyword/auto-close stuff only applies when the PR targets the default branch (just FYI).

@kiersten-stokes kiersten-stokes deleted the github-exception-formatting branch August 20, 2021 18:38
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.

Expose github exceptions in a more user-friendly way
3 participants