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

Fix: [GithubCommitActivity] invalid branch error handling #9258

Merged

Conversation

jNullj
Copy link
Collaborator

@jNullj jNullj commented Jun 14, 2023

Current code to handle invalid branch in Github Commit Activity (branch) never runs.

When GraphQL response with a bad repo it returns an error indicating the bad repo.
When GraphQL has the correct repo with a bad branch it will return null inside the repo object without an error object.
The existing code seems to try and use that but due to the current Joi schema not allowing null it did not work and an error due to bad schema would show instead.

This PR fixes this issue and adds a test for this case

Photo from production showing invalid response data due to response differ from schema:
image
Photo of PR changes on my local debug instance, handling invalid branch:
image

When GraphQL response with a bad repo it returns an error indicating the bad repo.
When GraphQL has the currect repo with a bad branch it will null inside the repo object without an error object.
The privouse commits seems to try and use that but due not allowing null in schema it did not work and an error due to bad schema would show insted.

This commit fixes this issue
@github-actions
Copy link
Contributor

Messages
📖 ✨ Thanks for your contribution to Shields, @jNullj!

Generated by 🚫 dangerJS against c5411f7

@jNullj jNullj marked this pull request as ready for review June 14, 2023 19:33
@chris48s chris48s merged commit 35dfd75 into badges:master Jun 14, 2023
22 checks passed
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.

None yet

2 participants