Skip to content

Bugfix/action/get contents with decode parameter#42

Merged
nzlosh merged 8 commits into
StackStorm-Exchange:masterfrom
userlocalhost:bugfix/action/get_contents_with_decode_paramter
Jul 25, 2023
Merged

Bugfix/action/get contents with decode parameter#42
nzlosh merged 8 commits into
StackStorm-Exchange:masterfrom
userlocalhost:bugfix/action/get_contents_with_decode_paramter

Conversation

@userlocalhost
Copy link
Copy Markdown
Contributor

Close: #41

This commit changed decoding processing of getting content to use ContentFile.decoded_content method instead of self-implemented one.
Because the PyGithub, which this pack depends on, have already implemented decoding processing for content of ContentFile as below.
https://github.com/PyGithub/PyGithub/blob/v1.45/github/ContentFile.py#L58-L61

This commit changed decoding processing of getting content to use
ContentFile.decoded_content method instead of self-implemented one.
Because the PyGithub, which this pack depends on, have already
implemented decoding processing for content of ContentFile.
@blag
Copy link
Copy Markdown
Contributor

blag commented Jul 17, 2021

This looks good. Please rebase this on the current master (sorry I updated after you opened your PR).

It would be nice if we fixed the decode_base64 as well, or removed it and every usage of it.

@blag blag added the bug label Jul 17, 2021
@userlocalhost
Copy link
Copy Markdown
Contributor Author

Thank you very much for your review. I got it.

In the previous implementation uses custom decoding method of
`lib.formatters.base64_decode` when `github.create_file` and
`github.update_file` actions are called with "encoding" parameter. And
those will be failed because of its implementation.

This removes `lib.formatters.base64_decode` method because it is not
used any more except for above actions, which is wrong the way of using.
@userlocalhost userlocalhost force-pushed the bugfix/action/get_contents_with_decode_paramter branch from 230c323 to b335d47 Compare July 20, 2021 02:17
It's necessary for decode processing for the value that is get from
`github.ContentFile.ContentFile.decoded_content` because it returns
bytes typed value. This commit added its processing at
`lib.formatters.contents_to_dict` method.
(c.f. https://pygithub.readthedocs.io/en/latest/github_objects/ContentFile.html)
@userlocalhost userlocalhost force-pushed the bugfix/action/get_contents_with_decode_paramter branch from caa1432 to a43361e Compare July 21, 2021 02:44
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 11, 2022

CLA assistant check
All committers have signed the CLA.

@arm4b
Copy link
Copy Markdown
Member

arm4b commented Aug 18, 2022

@userlocalhost is the change here still actual, can I merge it?
Sorry, my bad. I thought you had write access in this repo to merge it by yourself.

@RishabhDev42
Copy link
Copy Markdown

@userlocalhost @armab Faced the same issue.
image
After pulling the fix, it works however
image
I wanted to follow up with ETA on the merge of this fix?

@nzlosh nzlosh merged commit 7a6e159 into StackStorm-Exchange:master Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "github.get_contents" action will fail when decode parameter is set

6 participants