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

Incorrect JCasC configuration export when a JFrog CLI installation is set to "install the latest version" #30

Closed
jordibellido opened this issue May 8, 2024 · 1 comment · Fixed by jfrog/jenkins-jfrog-plugin#98
Labels
bug Something isn't working

Comments

@jordibellido
Copy link

Describe the bug

On "Manage Jenkins -> Global Tool Configuration", I have set a JFrog CLI installation to always download the latest JFrog CLI tool available on releases.jfrog.io :
2024-05-08-jenkinsci_jfrog-plugin-JCasC_error_latest

I have reproduced this issue in three different Jenkins instances (same version, same plugins and same version plugins): if I export the JCasC configuration, the exported section for the aforementioned JFrog CLI installation is incorrect, because it just exports the installation name. When importing it back, the JFrog CLI installation is partially restored in Jenkins, because it has no information that it needs to use the latest version from JFrog repository, hence jobs using jf fail with the following error:
A 'jfrog' tool was not set. Using JFrog CLI from the system path.

As documented in the main page from this plugin and from #7, this is the right exported configuration for this case I have tested:

  jfrog:
    installations:
    - name: "jfrog-cli-latest"
      properties:
      - installSource:
          installers:
          - "releasesInstaller"

Current behavior

The JCasC configuration is partially exported:

  jfrog:
    installations:
    - name: "jfrog-cli-latest"

Reproduction steps

  1. Install Jenkins and the following plugins: configuration-as-code and jfrog.
  2. Go to "Manage Jenkins -> Global Tool Configuration"
  3. Create a new JFrog CLI installation to always download the latest JFrog CLI tool available on releases.jfrog.io. A valid test name could be jfrog-cli-latest.
  4. Go to "Manage Jenkins -> Configuration as Code" and click on the "View Configuration" button to export the JCasC confguration.
  5. Search for the string jfrog: to see how the related configuration was exported.

Expected behavior

The JCasC configuration is correctly exported:

  jfrog:
    installations:
    - name: "jfrog-cli-latest"
      properties:
      - installSource:
          installers:
          - "releasesInstaller"

JFrog plugin version

1.4.0

JFrog CLI version

any

Operating system type and version

AmazonLinux 2

JFrog Artifactory version

No response

JFrog Xray version

No response

@yahavi
Copy link
Collaborator

yahavi commented Jul 22, 2024

@jordibellido

The Jenkins JFrog plugin version 1.5.1 has been released. This version includes the fix for the issue.

Please feel free to upgrade, and we would appreciate your feedback on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants