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

Revert ssh-credentials that made trilead-api optional #3049

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Mar 23, 2024

jenkinsci/ssh-credentials-plugin#199 makes the trilead-api optional. Likely needs some tuning to allow plugin compatibility tests to pass.

This reverts commit 3fb5748.

@olamy can you investigate the two failures? I can duplicate the failures in the plugin bom repository with:

$ PLUGINS=subversion TEST=CompareAgainstBaselineCallableTest bash local-test.sh
$ LINE=weekly PLUGINS=mina-sshd-api-core  bash local-test.sh

…enkinsci#3039)"

jenkinsci/ssh-credentials-plugin#199 makes
the trilead-api optional.  Likely needs some tuning to allow plugin
compatibility tests to pass.

This reverts commit 3fb5748.
@MarkEWaite MarkEWaite requested a review from a team as a code owner March 23, 2024 00:51
@MarkEWaite MarkEWaite merged commit ed44ea8 into jenkinsci:master Mar 23, 2024
1 of 3 checks passed
@MarkEWaite MarkEWaite deleted the revert-ssh-credentials-326.v7fcb_a_ef6194b_ branch March 23, 2024 01:20
@MarkEWaite MarkEWaite added the bug Something isn't working label Mar 23, 2024
@olamy
Copy link
Member

olamy commented Mar 25, 2024

subversion plugin jenkinsci/subversion-plugin#284

@MarkEWaite
Copy link
Contributor Author

subversion plugin jenkinsci/subversion-plugin#284

Thanks very much!

@olamy
Copy link
Member

olamy commented Mar 25, 2024

subversion plugin jenkinsci/subversion-plugin#284

Thanks very much!

no worries,
The other one is strange

[ERROR] io.jenkins.plugins.mina_sshd_api.core.authenticators.MinaSSHPublicKeyAuthenticatorTest.testFactory -- Time elapsed: 2.461 s <<< ERROR!
java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.supports(TrileadSSHPasswordAuthenticator.java:191)
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.newInstance(TrileadSSHPasswordAuthenticator.java:178)
	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.lambda$newInstance$0(SSHAuthenticator.java:219)

not sure to understand why as we are using this now @OptionalExtension(requirePlugins = {"trilead-api"})
I need to dig into it.

@@ -939,7 +939,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<version>326.v7fcb_a_ef6194b_</version>
<version>322.v124df57ed808</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not take the necessary actions to prevent future updates from being automatically merged as in #3052.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll submit a pull request proposing the necessary change.

@MarkEWaite
Copy link
Contributor Author

The test failure in the subversion plugin is resolved in Subversion plugin pull request:

@olamy
Copy link
Member

olamy commented Mar 26, 2024

btw there seems to be something weird here

[ERROR] io.jenkins.plugins.mina_sshd_api.core.authenticators.MinaSSHPublicKeyAuthenticatorTest.testFactory -- Time elapsed: 2.461 s <<< ERROR!
java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.supports(TrileadSSHPasswordAuthenticator.java:191)
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.newInstance(TrileadSSHPasswordAuthenticator.java:178)
	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.lambda$newInstance$0(SSHAuthenticator.java:219)

The code is supposed to lookup only available extensions via this https://github.com/jenkinsci/ssh-credentials-plugin/blob/7fcbaef6194b61fd575d47c1825e56544f20183b/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHAuthenticator.java#L236

so TrileadSSHPasswordAuthenticator shouldn't be there in the lookup list if trilead-api not available because of @OptionalExtension(requirePlugins = {"trilead-api"}) https://github.com/jenkinsci/ssh-credentials-plugin/blob/7fcbaef6194b61fd575d47c1825e56544f20183b/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/TrileadSSHPasswordAuthenticator.java#L156

it turns out changing scope is fixing the issue see jenkinsci/mina-sshd-api-plugin#89
looks to be some black magic from PCT :)

@olamy
Copy link
Member

olamy commented Mar 28, 2024

I suspect the issue is related to this jenkinsci/maven-hpi-plugin#391
Looks to be some issue with the classpath calculation as Jenkins can see the trilead-api plugin (and so return the optional extension) but the classpath calculation for surefire completely ignores it.

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 this pull request may close these issues.

3 participants