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 the Container class #247

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

qixiang
Copy link
Contributor

@qixiang qixiang commented Sep 27, 2023

Changes to the Container class:

  1. Change Container class to normal class

The class originally implemented using dataclass didn't have many of the advantages of dataclass, but rather made creating instances more difficult to understand. The reason is a container can have multi-arch images, most attributions doesn't have one-to-one mapping with a single image data.

  1. Use class method create_from_images to create Container instances

It was implemented with instantiating it first then load per-arch data with load which is confusing.

  1. Remove resolve_published

Just check if a container is published by checking that in all deliver repositories.

JIRA: CWFHEALTH-2313

@qixiang qixiang force-pushed the container-class-refactor branch from 36f7131 to 3d34da3 Compare September 27, 2023 14:24
Changes to the Container class:

1. Change Container class to normal class

The class originally implemented using dataclass didn't have many of the
advantages of dataclass, but rather made creating instances more
difficult to understand. The reason is a container can have multi-arch
images, most attributions doesn't have one-to-one mapping with a single
image data.

2. Use class method `create_from_images` to create Container instances

It was implemented with instantiating it first then load per-arch data
with `load` which is confusing.

3. Remove `resolve_published`

Just check if a container is published by checking that in all deliver
repositories.

JIRA: CWFHEALTH-2313
@qixiang qixiang force-pushed the container-class-refactor branch from 3d34da3 to daf44e7 Compare September 27, 2023 14:45
@qixiang qixiang requested a review from FernandesMF September 27, 2023 15:05
Copy link
Contributor

@FernandesMF FernandesMF left a comment

Choose a reason for hiding this comment

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

Looks good to me, I don't have anything to add!

@qixiang qixiang merged commit 9adf421 into redhat-exd-rebuilds:main Sep 28, 2023
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.

2 participants