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: artifact download #115

Merged
merged 1 commit into from Feb 12, 2024
Merged

fix: artifact download #115

merged 1 commit into from Feb 12, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Feb 10, 2024

40e754e removed PullRequest.headers(type) which breaks the artifact download:

Traceback (most recent call last):
  File "/usr/local/bin/post", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/clang_tidy_review/post.py", line 80, in main
    metadata, review = download_artifacts(pull_request, int(args.workflow_id))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/clang_tidy_review/__init__.py", line 929, in download_artifacts
    "GET", artifact.archive_download_url, headers=pull.headers("json")
                                                  ^^^^^^^^^^^^
AttributeError: 'PullRequest' object has no attribute 'headers'

This refactors the download into a method on PullRequest which gets the appropriate headers.

Copy link
Owner

@ZedThree ZedThree left a comment

Choose a reason for hiding this comment

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

Thanks @Nerixyz, much appreciated!

@ZedThree ZedThree merged commit 9a32adc into ZedThree:master Feb 12, 2024
1 check passed
@Nerixyz Nerixyz deleted the fix/pr-stuff branch February 12, 2024 12:36
dacap added a commit to aseprite/laf that referenced this pull request Feb 27, 2024
dacap added a commit to aseprite/laf that referenced this pull request Feb 27, 2024
v0.17.1 looks buggy to download artifacts, even with this patch:

  ZedThree/clang-tidy-review#115

We got the following error:

  File "/usr/local/lib/python3.12/site-packages/clang_tidy_review/post.py", line 80, in main
    metadata, review = download_artifacts(pull_request, int(args.workflow_id))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/clang_tidy_review/__init__.py", line 946, in download_artifacts
    contents = b"".join(data["data"].iter_content())
                        ~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
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