This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Allow no content responses from GitHub #937
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This also fixes an issue where the dry run variable could never be set to "false" locally since it was not JSON decoded.
openverse-bot
added
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
🟧 priority: high
Stalls work on the project or its dependents
labels
Dec 29, 2022
stacimc
approved these changes
Jan 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The tests look good and do indeed fail with the error reported in #936 for me, when checked out before the fix. Thanks for the very convenient commits for testing purposes, and for the additional test cases as well! 😄
) | ||
|
||
with dag: | ||
PythonOperator( | ||
task_id="pr_review_reminder_operator", | ||
python_callable=pr_review_reminders.post_reminders, | ||
op_kwargs={"github_pat": GITHUB_PAT, "dry_run": DRY_RUN}, | ||
op_kwargs={ | ||
"github_pat": "{{ var.value.get('GITHUB_API_KEY', 'not_set') }}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good!
This was referenced Jan 4, 2023
obulat
approved these changes
Jan 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
🟧 priority: high
Stalls work on the project or its dependents
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes
Fixes WordPress/openverse#1305 by @AetherUnbound
Description
This PR modifies the
_make_request
function to prevent an exception from being raised when GitHub returns an HTTP 204No Content
response. This is done on comment deletion responses: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#delete-a-review-comment-for-a-pull-request. I suspect this case hadn't happened yet since this was introduced in #642, which is why these only just started raising errors.In addition to the change necessary to fix the underlying issue (9a1a992), I also changed the
Variable.get
calls at the top level in accordance with a discussion from WordPress/openverse#1317 and #904 (46ad685).In order to test this I added the
pook
library, which @sarayourfriend added to the API in WordPress/openverse-api#1027 and seemed appropriate to use here! This will not require a deployment since it's only a testing dependency.Testing Instructions
It's hard to test this since we need specific conditions from the API in order to actually raise the error. You can however check out the commit before the fix (1a4ad1c) and run
just test
- you should see exactly the error described in the issue. Runningjust test
again on the tip of this branch should have all tests pass.Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin