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

Split build-info class #559

Merged
merged 8 commits into from
Dec 12, 2021
Merged

Split build-info class #559

merged 8 commits into from
Dec 12, 2021

Conversation

Or-Geva
Copy link
Contributor

@Or-Geva Or-Geva commented Oct 7, 2021

  • All tests passed. If this feature is not already covered by the tests, I added new tests.

Until now, Build-info-java has one class that includes all the build-info schema properties & extra logic. Examples of build-info logic are recording artifacts/dependencies local path or append modules/builds.

The one-class structure needs to be splitted into two classes. The first class would have only build-info properties that Artifactory will be using, and the second would have all the extra logic + properties which will be used by other consumers (Jenkins).
Relates PR:

Copy link
Contributor

@eyalbe4 eyalbe4 left a comment

Choose a reason for hiding this comment

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

I'm not done reviewing everything, but I'm sharing what I have so far.
I'll continue reviewing the rest soon.

@@ -81,40 +88,39 @@ public Build build() {
throw new IllegalArgumentException("Build start time must be set");
}

Build build = new Build();
BuildInfo buildInfo = new BuildInfo();
if (StringUtils.isNotBlank(version)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this if statement needed? Seems redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The If makes sure that the default version in new BuildInfo(); won't get an override.

Copy link
Contributor

@eyalbe4 eyalbe4 left a comment

Choose a reason for hiding this comment

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

I haven't finished going over everything, but I suggest you go ahead and review my comments so far, comment or modify the code if needed. Once you're done, I'll resume my review.
This is because I'm mostly concerned about the usage of "ci" classes by "api" classes. See my inline comments and let me know what you think.

import java.util.Properties;


public class BuildInfoModuleBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not clear what the relationship between this class and the BuildModuleBuilder which exists in the same package. Should what of them be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BuildModuleBuilder - build the old 'build' class (used by Artifactory)
BuildInfoModuleBuilder - build the new 'build' class (used by Jenkins, etc..)

@Or-Geva Or-Geva requested a review from eyalbe4 November 11, 2021 10:53
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