Build name is included as a module id after publishing a maven build
Describe the bug When using JFrog CLI to compile and build, publish maven builds, the build name is also getting included as one of the Published modules under the builds section
To Reproduce Step 1: Clone the project https://github.com/jfrog/project-examples/tree/master/maven-examples/maven-jib-example Step 2: Use JFrog-CLI 1.47.3 and Artifactory 6.23.15 version Step 3: Configure the project to use JFrog CLI Step 4: Steps to be performed to collect env variables, compile and publish:
- Collect the build information using: $ jfrog rt bce maven 2
- Build the project using: $ jfrog rt mvn clean install -f pom.xml --build-name=maven --build-number=2 -Dartifactory.publish.artifacts=true
- Publish the build using: $ jfrog rt bp maven 2
Expected behavior After performing the "jfrog rt bp maven 2" it is expected to see only the modules available within the project and it should not consider the build name as one of the published modules
Screenshots
Versions
- JFrog CLI version: 1.47.3
- JFrog CLI operating system: Centos 7, Mac
- Artifactory Version: 6.23.15
Additional context This behaviour is not observed when using Jenkins and observed only when using JFrog-CLI
I also observed this incorrect behaviour when doing a python build.
I can conclude that running rt bce command inserts the following in the "modules" array in the build info json even if no other modules were added to the build info (only the bce and bp commands were executed in the test case below).
sh '$WORKSPACE/jfrog rt bce'
sh '$WORKSPACE/jfrog rt bp --build-url $BUILD_URL'
# Produces the following in the build info
{
"properties": {},
"id": "<build name>"
}
Expected behaviour
The bce command should not add any module information at all to the build info since there is no module associated with environment variables.
Version
Jfrog CLI 2.1.1
Looking into the source it might be that this is an issue in jfrog-cli-core.
I have very limited Go knowledge, but to me it looks like when we get to here: https://github.com/jfrog/jfrog-cli-core/blob/5d91a428da61ab2cf350b864e628990a7f711156/artifactory/commands/buildinfo/publish.go#L138
the modules array is not empty, and the code ends up adding the build name as "id" to an otherwise empty module.
Might help someone with better knowledge of Go to submit a PR for this issue. Or I could be completely wrong in my analysis.
This issue has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days
If this hasn't been fixed in the latest version then this should be kept open. If it's fixed, then link to the commit that solves it and close.
This issue has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days
This issue was closed due to 7 days of inactivity after being marked as stale. Feel free to reopen it if it remains relevant.