jfrog-cli icon indicating copy to clipboard operation
jfrog-cli copied to clipboard

Build name is included as a module id after publishing a maven build

Open VigneshSurendrababu opened this issue 4 years ago • 4 comments

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:

  1. Collect the build information using: $ jfrog rt bce maven 2
  2. Build the project using: $ jfrog rt mvn clean install -f pom.xml --build-name=maven --build-number=2 -Dartifactory.publish.artifacts=true
  3. 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

image

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

VigneshSurendrababu avatar Jul 18 '21 05:07 VigneshSurendrababu

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

gangefors avatar Aug 02 '21 09:08 gangefors

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.

gangefors avatar Aug 02 '21 09:08 gangefors

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

github-actions[bot] avatar Feb 28 '25 06:02 github-actions[bot]

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.

gangefors avatar Feb 28 '25 12:02 gangefors

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

github-actions[bot] avatar Sep 09 '25 00:09 github-actions[bot]

This issue was closed due to 7 days of inactivity after being marked as stale. Feel free to reopen it if it remains relevant.

github-actions[bot] avatar Sep 16 '25 00:09 github-actions[bot]