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: Remove ImageBuilder struct #7682

Merged
merged 4 commits into from
May 14, 2020
Merged

Conversation

christophermaier
Copy link
Contributor

As these refactorings have progressed, `ImageBuilder` has been
revealed to be the equivalent of Tom Smykowski in the movie Office
Space.

Now, the `Naming` struct generates the "expanded identifiers" that
`ImageBuilder` was via the `Identified` trait. This makes more sense,
in that all the identifier logic is consolidated in the `Naming`
struct.

A future commit will remove the `Identified` trait altogether, thus
fulfilling the prophecy foretold in 70a8aca.

Signed-off-by: Christopher Maier <cmaier@chef.io>
This allows us to get rid of the `Identified` trait entirely.

Signed-off-by: Christopher Maier <cmaier@chef.io>
Copy link
Contributor

@davidMcneil davidMcneil left a comment

Choose a reason for hiding this comment

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

Very nice! It has been cool to see this series of PRs come together.

pub fn image_identifiers(&self,
ident: &FullyQualifiedPackageIdent,
channel: &ChannelIdent)
-> Result<(String, Vec<String>)> {
-> Result<(String, Vec<String>, Vec<String>)> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth having a type alias or maybe even a new type for the different types of tags?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe... writing this return type killed a little bit of my soul.

I think that with some additional future refactorings this would get a lot simpler, but it may be a good idea to contain the gnarliness until then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f057ddb; much better 😄

}

impl ContainerImage {
// TODO (CM): temporary; we shouldn't use this at all
pub fn workdir(&self) -> &Path { self.workdir.as_path() }

pub fn expanded_identifiers(&self) -> &Vec<String> { &self.expanded_identifiers }
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the return type &[String]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in decc378

Signed-off-by: Christopher Maier <cmaier@chef.io>
Signed-off-by: Christopher Maier <cmaier@chef.io>
@christophermaier christophermaier merged commit 2410c3f into master May 14, 2020
@chef-expeditor chef-expeditor bot deleted the cm/remove-image-builder branch May 14, 2020 14:48
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