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

Refactor AWS images for hourly/cloudaccess #11

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

major
Copy link
Member

@major major commented Oct 6, 2022

Update pytest fixtures to include cloud access billing codes and use
those fixtures consistently. Add the billing codes to config and use the
constants consistently.

Split out the actual AWS describe_image call into its own function for
easier mocking and testing. Add an argument to get_aws_images that
specifies which image types to filter for with hourly as the default.

Fixes: #7

@major major requested a review from F-X64 October 6, 2022 16:23
@major major added the enhancement New feature or request label Oct 6, 2022
@F-X64
Copy link
Member

F-X64 commented Oct 7, 2022

I like the changes. About your concern regarding the individual commits: I think the readability is fine but we might want to consider squashing the "fix" commits. e.g.
78147f2 and b69aa68, a91fafc and c7f7389.

I don't think splitting the commits is necessary though as they do follow a logical structure that makes sense.



def get_aws_all_hourly_images() -> dict[str, list[str]]:
def get_aws_all_images(image_type: str = "hourly") -> dict[str, list[dict[str, str]]]:
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for this. Wanted to implement it myself so this save me loads of time ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hah yeah, I wasn't thinking through it terribly deeply when I wrote it the first time. 🤦🏻‍♂️

@major
Copy link
Member Author

major commented Oct 7, 2022

Looks like I have a conflict with that other PR. I'll resolve it right quick.

Update pytest fixtures to include cloud access billing codes and use
those fixtures consistently. Add the billing codes to config and use the
constants consistently.

Split out the actual AWS describe_image call into its own function for
easier mocking and testing. Add an argument to get_aws_images that
specifies which image types to filter for with hourly as the default.

Fixes: #7

Signed-off-by: Major Hayden <major@redhat.com>
@major major force-pushed the update-tests-use-common-fixtures branch from c7f7389 to 466928b Compare October 7, 2022 11:38
@major major merged commit f772df7 into main Oct 7, 2022
@major major deleted the update-tests-use-common-fixtures branch October 7, 2022 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🔧 Refactor AWS hourly images to get cloud access images as well
2 participants