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

Validation for the optional dependencies fails with 2.9.0 #339

Open
v1v opened this issue Jun 21, 2021 · 4 comments
Open

Validation for the optional dependencies fails with 2.9.0 #339

v1v opened this issue Jun 21, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@v1v
Copy link
Member

v1v commented Jun 21, 2021

Version report

Jenkins and plugins versions report: 2.289.1-lts-jdk11

cloudbees-disk-usage-simple:0.10
opentelemetry::https://repo.jenkins-ci.org/incrementals/io/jenkins/plugins/opentelemetry/0.16-rc359.9eae24591360/opentelemetry-0.16-rc359.9eae24591360.hpi
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Docker

Reproduction steps

  • Dockerfile
FROM jenkins/jenkins:2.289.1-lts-jdk11
RUN jenkins-plugin-cli --latest false --plugins cloudbees-disk-usage-simple:0.10 opentelemetry::https://github.com/jenkinsci/opentelemetry-plugin/releases/download/0.14-beta/opentelemetry-0.14-beta.hpi

Results

Expected result:

Can install the optional plugin

Actual result:

#5 8.040 Plugin prerequisite not met:
#5 8.040 Plugin opentelemetry:0.14 depends on cloudbees-disk-usage-simple:0.10;resolution, but there is an older version defined on the top level - cloudbees-disk-usage-simple:0.10
------
executor failed running [/bin/sh -c jenkins-plugin-cli --latest false --plugins cloudbees-disk-usage-simple:0.10 opentelemetry::https://github.com/jenkinsci/opentelemetry-plugin/releases/download/0.14-beta/opentelemetry-0.14-beta.hpi]: exit code: 1

While If I don't add the explicit dependency for the optional plugin cloudbees-disk-usage-simple then it works

Somehow the resolution looks suspicious

@v1v v1v added the bug Something isn't working label Jun 21, 2021
@timja
Copy link
Member

timja commented Jun 21, 2021

I don't think that's a bug, optional dependencies still have version constraints as far as I know.

i.e. if you're going to install a plugin you have an optional extension for it needs to be at least the minimum version?

But I may be wrong @oleg-nenashev?

@v1v
Copy link
Member Author

v1v commented Jun 21, 2021

Sorry if I wasn't clear but:

But there is an error with

Plugin opentelemetry:0.14 depends on cloudbees-disk-usage-simple:0.10;resolution, but there is an older version defined on the top level - cloudbees-disk-usage-simple:0.10

@v1v
Copy link
Member Author

v1v commented Jul 9, 2021

It seems to work fine when using --latest-specified

@v1v
Copy link
Member Author

v1v commented Jul 9, 2021

How to reproduce this?

tee -a plugins.txt <<EOF
cloudbees-disk-usage-simple:0.10
google-compute-engine
opentelemetry::https://repo.jenkins-ci.org/incrementals/io/jenkins/plugins/opentelemetry/0.17-rc383.d28294a0c63f/opentelemetry-0.17-rc383.d28294a0c63f.hpi
EOF

tee -a Dockerfile <<EOF
FROM jenkins/jenkins:lts-jdk11
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli --latest false -f /usr/share/jenkins/ref/plugins.txt
EOF

docker build .

output:

 > [stage-3 3/3] RUN jenkins-plugin-cli --latest false -f /usr/share/jenkins/ref/plugins.txt:                                                                     
#7 13.90 Multiple plugin prerequisites not met:                                                                                                                   
#7 13.90 Plugin opentelemetry:0.17-rc383.d28294a0c63f depends on cloudbees-disk-usage-simple:0.10;resolution, but there is an older version defined on the top level - cloudbees-disk-usage-simple:0.10,                                                                                                                            
#7 13.90 Plugin opentelemetry:0.17-rc383.d28294a0c63f depends on cloudbees-disk-usage-simple:0.10;resolution, but there is an older version defined on the top level - cloudbees-disk-usage-simple:0.10,
#7 13.90 Plugin opentelemetry:0.17-rc383.d28294a0c63f depends on cloudbees-disk-usage-simple:0.10;resolution, but there is an older version defined on the top level - cloudbees-disk-usage-simple:0.10,
#7 13.90 Plugin opentelemetry:0.17-rc383.d28294a0c63f depends on cloudbees-disk-usage-simple:0.10;resolution, but there is an older version defined on the top level - cloudbees-disk-usage-simple:0.10,
#7 13.90 Plugin opentelemetry:0.17-rc383.d28294a0c63f depends on google-compute-engine:4.3.8;resolution, but there is an older version defined on the top level - google-compute-engine:4.3.8
------
executor failed running [/bin/sh -c jenkins-plugin-cli --latest false -f /usr/share/jenkins/ref/plugins.txt]: exit code: 1

Workaround

using the --latest-specified flag

tee -a plugins.txt <<EOF
cloudbees-disk-usage-simple:0.10
google-compute-engine
opentelemetry::https://repo.jenkins-ci.org/incrementals/io/jenkins/plugins/opentelemetry/0.17-rc383.d28294a0c63f/opentelemetry-0.17-rc383.d28294a0c63f.hpi
EOF

tee -a Dockerfile <<EOF
FROM jenkins/jenkins:lts-jdk11
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli --latest false --latest-specified -f /usr/share/jenkins/ref/plugins.txt
EOF

docker build .

with output:

RUN jenkins-plugin-cli --latest false --latest-specified -f /usr/share/jenkins/ref/plugins.txt
[+] Building 21.3s (8/8) FINISHED                                                                                                                                 
 => [internal] load build definition from Dockerfile                                                                                                         0.0s
 => => transferring dockerfile: 892B                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                              0.0s
 => [internal] load metadata for docker.io/jenkins/jenkins:lts-jdk11                                                                                         0.0s
 => [internal] load build context                                                                                                                            0.0s
 => => transferring context: 1.09kB                                                                                                                          0.0s
 => CACHED [stage-4 1/3] FROM docker.io/jenkins/jenkins:lts-jdk11                                                                                            0.0s
 => [stage-4 2/3] COPY plugins.txt /usr/share/jenkins/ref/plugins.txt                                                                                        0.0s
 => [stage-4 3/3] RUN jenkins-plugin-cli --latest false --latest-specified -f /usr/share/jenkins/ref/plugins.txt                                            20.9s
 => exporting to image                                                                                                                                       0.3s
 => => exporting layers                                                                                                                                      0.3s
 => => writing image sha256:99f3e9d74c51630615cc430577b3a7b09e02c8a6cae14a287342e860d44ee83a                                                                 0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

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

No branches or pull requests

2 participants