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

[chore] Move Trilead Authenticator implementation from SSH Credentials #147

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dohbedoh
Copy link

@Dohbedoh Dohbedoh commented May 8, 2024

(See also jenkinsci/ssh-credentials-plugin#206)

Moving Trilead specific implementation from SSH Credentials as proposed in jenkinsci/ssh-credentials-plugin#199.

This probably need some planning and coordination between those 2 plugins and the bom. Also I am not sure how to avoid a circular dependency trilead-api -> ssh-credentials -> trilead-api. Could not prevent it with deps exclusions..

cc @olamy

Submitter checklist

  • JIRA issue is well described
  • Appropriate autotests or explanation to why this change has no tests

@Dohbedoh
Copy link
Author

Dohbedoh commented May 8, 2024

Last commit is a test with incrementals from jenkinsci/ssh-credentials-plugin#206

@kuisathaverat
Copy link
Contributor

I am not sure of the motivation for this change; I did not check how many plugins use those classes, maybe only the SSH Build Agents. But I am not sure if it is the right place for the classes too. It is another reason to make the change to the new library or stop maintaining the SSH plugins on my side and put them in adoption and start publishing the other version I have with the new library.

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Unfortunately for a situation like this where deps are reversed, there is not any good way of releasing the changes incrementally. Nor can you release this as written first and then fix up the dep version to be non-incremental later, since -P-consume-incrementals is enforced during the release process (for good reason). All you can do is release jenkinsci/ssh-credentials-plugin#206 and then edit this PR to pick up the released version and immediately release this too (so you had better make sure maintainers of both plugins are ready to pull the trigger). And users needed to be warned in release notes, compatibleSinceVersion, etc. that they cannot update ssh-credentials in isolation—they should update both (from the GUI it suffices to request update of trilead-api).

bom changes can and should be prepared in advance: just file a draft PR picking up both PRs as incremental versions and add full-test or weekly-test. When both plugins have been released, edit the versions and mark ready for review.

pom.xml Outdated Show resolved Hide resolved
Comment on lines +115 to +129
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<optional>true</optional>
</dependency>
Copy link
Member

@jtnord jtnord May 10, 2024

Choose a reason for hiding this comment

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

should have an optional dep on credentials for the Username/Password based authenticator.

/**
* {@inheritDoc}
*/
@OptionalExtension(requirePlugins = {"ssh-credentials"})
Copy link
Member

Choose a reason for hiding this comment

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

this uses StandardUsernamePasswordCredentials not SSH ones, so the following?

Suggested change
@OptionalExtension(requirePlugins = {"ssh-credentials"})
@OptionalExtension(requirePlugins = {"plain-credentials"})

Copy link
Member

Choose a reason for hiding this comment

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

StandardUsernamePasswordCredentials is defined in credentials. plain-credentials is for string & text credentials which are newer.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@OptionalExtension(requirePlugins = {"ssh-credentials"})
@OptionalExtension(requirePlugins = {"credentials"})

Copy link
Author

Choose a reason for hiding this comment

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

@jtnord ssh-credentials is required since this is a com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator implementation. ssh-credentials should be sufficient since it has a direct required dependency on credentials ? Or do we want to include both ssh-credentials and credentials ?

assertThat(instance.isAuthenticated(), is(true));
}

private Object createPasswordAuthenticatedSshServer() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, InstantiationException, IllegalAccessException {
Copy link
Member

@jtnord jtnord May 10, 2024

Choose a reason for hiding this comment

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

@olamy
Copy link
Member

olamy commented Aug 2, 2024

@kuisathaverat do you think is it something we could move forward? it certainly needs some more testing and coordination when releasing it but will cleanup dependencies.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants