Skip to content

manual setBuildNumber causes build number matrix not to be reported #141

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

Closed
regevbr opened this issue Dec 5, 2017 · 3 comments
Closed

Comments

@regevbr
Copy link

regevbr commented Dec 5, 2017

Currently, if you want to set the build number manually, you can use the clientConfig.info.setBuildNUmber() which is great but has a bad side affect - the build.number property is not attached to the artifact, thus causing the artifact to not be aware to the build that created it (and making the promote action on the build fail).
The reason for that is the code in GradleArtifactoryClientConfigUpdater.setMissingBuildAttributes. There, if no one set manually the build number it sets it for you and publishes the property to the artifact by doing

        if (StringUtils.isBlank(buildNumber)) {
            buildNumber = new Date().getTime() + "";
            config.info.setBuildNumber(buildNumber);
            config.publisher.addMatrixParam(BuildInfoFields.BUILD_NUMBER, buildNumber);
        }

But in the case you set it manually, no one adds it to the properties. The fix currently is to add the extra code yourself but I found it out the hard way by tracing your code.
The same occurs for buildName and the rest of the properties in that class.
I think the fix should be to set the matrix param only if it was not set, separately from the buildName set in the info

@eyalbe4
Copy link
Contributor

eyalbe4 commented Dec 10, 2017

@regevbr - thanks for reporting this.
I think that this commit fixes the issue.
The fix hasn't been released yet, but GAP-283 tracks it.

@regevbr
Copy link
Author

regevbr commented Dec 10, 2017

Thanks!

@eyalbe4
Copy link
Contributor

eyalbe4 commented Dec 11, 2017

@regevbr,
Since we can use GAP-283 to track this fix, I'm closing this issue.

@eyalbe4 eyalbe4 closed this as completed Dec 11, 2017
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

No branches or pull requests

2 participants