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

support transforming google images #419

Merged
merged 4 commits into from
Mar 23, 2023

Conversation

miyunari
Copy link
Member

closes #405

@miyunari miyunari self-assigned this Mar 22, 2023
@miyunari miyunari requested review from F-X64 and major March 22, 2023 21:25
@major major force-pushed the add_google_transformer_#405 branch from 64d325c to 1652902 Compare March 23, 2023 01:49
@@ -56,5 +56,5 @@ def run(origin_path: str, destination_path: str, api: str, arg_files: str) -> No
version_prefix = api + "/"
for result in results:
result.filename = destination_path + "/" + version_prefix + result.filename
print("put content to filesystem - filename: " + result.filename)
# print("put content to filesystem - filename: " + result.filename)
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this line? 😉

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise this looks good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I will remove it 😄

import os


def test_transformer_google():
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a docstring to your tests as well as breaking test cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I can add a docstring. How would you model a breaking test? The only thing that I have in mind is, that the transformer would fail if we provide an invalid input file. Does this make sense to you?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that makes total sense to me. I would add

  • Files with a broken structure (test case: the retriever created a malformed file)
  • Files cannot be downloaded (test case: S3 bucket is down / cannot be reached)
    I want to make sure that we can catch those failures should they occur.

Copy link
Member Author

@miyunari miyunari Mar 23, 2023

Choose a reason for hiding this comment

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

Files with a broken structure (test case: the retriever created a malformed file)

Sure, I will create an issue 👍 #421

Files cannot be downloaded (test case: S3 bucket is down / cannot be reached)
I want to make sure that we can catch those failures should they occur.

Is that then a test of the s3cmd tool? 🤔

https://github.com/redhatcloudx/cloud-image-directory/blob/580b08b3e942866f2b1dcd1e28757a690fde5a21/.github/workflows/transformer.yaml#L54-L66

Since the transformer only uses files from the filesystem. We removed the s3 bucket connection (implementation), remember? 🥴

Copy link
Member

Choose a reason for hiding this comment

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

True. Strike the download! We'll cover empty inputs with the rest of the tests in the follow up task!

@miyunari miyunari force-pushed the add_google_transformer_#405 branch from 1652902 to f150995 Compare March 23, 2023 08:52
@miyunari miyunari requested review from F-X64 and major March 23, 2023 09:11
@miyunari miyunari merged commit eead18d into redhatcloudx:main Mar 23, 2023
@miyunari miyunari deleted the add_google_transformer_#405 branch March 23, 2023 09:43
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.

Support for transforming google images
3 participants