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

[JENKINS-64107] Convert SSHD module to a plugin #5049

Merged
merged 18 commits into from
Feb 25, 2021

Conversation

kuisathaverat
Copy link
Contributor

See JENKINS-55582 JENKINS-64107 JENKINS-64104.

Proposed changelog entries

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • [ ] For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@jenkinsci/code-reviewers

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

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.

Will need to add a test-scoped dep to the test module since some functional tests in core do try to use java -jar jenkins-cli.jar -ssh.

test/pom.xml Outdated Show resolved Hide resolved
@kuisathaverat kuisathaverat marked this pull request as ready for review November 15, 2020 19:39
@kuisathaverat
Copy link
Contributor Author

the publish stages failed due to the issues on the infra these last two days, all the tests and the ATH passes.

@jglick
Copy link
Member

jglick commented Nov 16, 2020

The JEP proposes inlining ssh-cli-auth but I do not see that here.

@kuisathaverat
Copy link
Contributor Author

I was thinking of splitting the change into two PRs, but if you think I can include the ssh-cli-auth change here, I'd include it.

@jglick
Copy link
Member

jglick commented Nov 16, 2020

I think you have to. Otherwise we could release a split of a plugin before that plugin is actually ready.

@kuisathaverat
Copy link
Contributor Author

kuisathaverat commented Nov 17, 2020

@jglick I checked the ssh-cli-auth-module and it depends on sshd-module for the tests, if I include the ssh-cli-auth-module as a dependency inside sshd-module, we will have a circular dependency for testing, so I wonder if we should move the code in ssh-cli-auth-module repo to the sshd-module repo and archive the ssh-cli-auth-module repo.

@jglick
Copy link
Member

jglick commented Nov 17, 2020

move the code in ssh-cli-auth-module repo to the sshd-module repo and archive the ssh-cli-auth-module repo

That is precisely what I advocated in the JEP. Perhaps I did not word it clearly enough?

@oleg-nenashev
Copy link
Member

+1 for having a single plugin BTW. I am a bit concerned about having no SSH CLI support on startup without a plugin, but I think we can live without it.

@kuisathaverat kuisathaverat requested a review from jglick December 6, 2020 13:49
@jglick jglick marked this pull request as draft December 7, 2020 15:51
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.

Approving conditional on upstream.

core/src/main/resources/jenkins/split-plugins.txt Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@kuisathaverat
Copy link
Contributor Author

I have added the test on jenkinsci/sshd-plugin#40 and update the PR with the master changes

What are the next steps? I guess we have to merge jenkinsci/sshd-plugin#38 after this we can decide the final Jenkins Core version we will include this PR, and after that, we can finish and merge jenkinsci/sshd-plugin#40

finally, if everything is fine we can test and merge jenkinsci/sshd-plugin#37

core/src/main/resources/jenkins/split-plugins.txt Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
Co-authored-by: Jesse Glick <[email protected]>
@timja timja requested a review from a team February 23, 2021 15:19
pom.xml Outdated Show resolved Hide resolved
Co-authored-by: Jesse Glick <[email protected]>
@jglick
Copy link
Member

jglick commented Feb 23, 2021

filter.check("org.jenkinsci.main.modules.cli.auth.ssh.UserPropertyImpl");
can be deleted

@jglick
Copy link
Member

jglick commented Feb 23, 2021

Note that automated test coverage is not going to be of much help here. You need to take the actual generated jenkins.war and try to run it to see what happens.

@timja
Copy link
Member

timja commented Feb 23, 2021

I tested this manually, setup wizard worked fine, but update center data for the plugin seems missing, cc @danielbeck

wget http://updates.jenkins.io/current/update-center.actual.json
 cat update-center.actual.json | jq '.plugins["sshd"]'

instance-identity worked fine

@timja
Copy link
Member

timja commented Feb 23, 2021

@timja timja added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 24, 2021
@timja
Copy link
Member

timja commented Feb 24, 2021

This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@jglick
Copy link
Member

jglick commented Feb 24, 2021

Suggest #5049 (comment) though it is not a blocker.

@@ -29,5 +29,8 @@ jdk-tool 2.112 1.0
# JENKINS-55681
jaxb 2.163 2.3.0 11

# JENKINS-64107
sshd 2.281 3.0.1
Copy link
Member

Choose a reason for hiding this comment

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

I still do not see this on the UC?

Copy link
Member

Choose a reason for hiding this comment

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

?

➜  wars cat update-center.actual.json | jq '.plugins["sshd"]'
{
  "buildDate": "Feb 23, 2021",
  "dependencies": [],
  "developers": [
    {
      "developerId": "timja"
    }
  ],
  "excerpt": "Adds SSH server functionality to Jenkins, exposing CLI commands through it",
  "gav": "org.jenkins-ci.modules:sshd:3.0.1",
  "labels": [],
  "minimumJavaVersion": "1.8",
  "name": "sshd",
  "popularity": 0,
  "previousTimestamp": "2021-02-22T19:33:24.00Z",
  "previousVersion": "3.0",
  "releaseTimestamp": "2021-02-23T15:53:28.00Z",
  "requiredCore": "2.282-rc30905.2ddf35821c11",
  "scm": "https://github.com/jenkinsci/sshd-plugin",
  "sha1": "xX2ALuJ47hl9sGVwrc6WptJTj+g=",
  "sha256": "Jmpl9bTjReS3qrwwTf3d0CTR8RyB/bZS3u+IQVzvEJg=",
  "title": "SSH server",
  "url": "https://updates.jenkins.io/download/plugins/sshd/3.0.1/sshd.hpi",
  "version": "3.0.1",
  "wiki": "https://plugins.jenkins.io/sshd"
}

Copy link
Member

Choose a reason for hiding this comment

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

$ curl -sL 'https://updates.jenkins-ci.org/update-center.json?version=2.282' | head -n-1 | tail -n+2 | jq -r '.plugins | .["sshd"] | .version'
3.0

Copy link
Member

Choose a reason for hiding this comment

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

seems not portable command?

head: illegal line count -- -1

Copy link
Member

Choose a reason for hiding this comment

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

hmm weird, maybe update center is ignoring the version in the dynamic tiers, 'latest' has it

Copy link
Member

Choose a reason for hiding this comment

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

Maybe does not refresh until after 2.282 actually comes out. If so, fine.

@daniel-beck
Copy link
Member

Why are we considering this a split/detached plugin, when the functionality wasn't in core before?

It makes some sense from a configuration/functionality POV (but seems separate enough that functionality would easily be restored after installing the plugin, similar to https://plugins.jenkins.io/cctray-xml/ ), but needlessly adds a dependency from plugins with slightly older core baselines.

@kuisathaverat
Copy link
Contributor Author

I think that the main reason to consider it a detached plugin is that is a feature you do not want to be installed. the use of Apache Mina SSH library in it is another good reason, it forces all plugins to use a version highly attached to the Jenkins Core, it difficult to bump that library version. As a plugin allows more flexibility to change the library version and helps other plugins to depend on a plugin and not on a Jenkins Core.

@daniel-beck
Copy link
Member

Well, yeah, but those dependencies on plugins need to be explicit. Adding it to the split-plugins file doesn't accomplish that, because that only matters on cores newer than what the downstream plugin was developed against.

I think that the main reason to consider it a detached plugin is that is a feature you do not want to be installed.

Well, the alternative is to just split it off and add a changelog entry, like we did for cctray-xml. Otherwise it'll just be installed automatically all the time because tons of plugins (almost all of them at this point) would get it as an implied dependency.

@kuisathaverat
Copy link
Contributor Author

Oh!! I get you now, I simply put it in detached for backward compatibility as I did with the trilead plugin, to avoid friction.

@daniel-beck
Copy link
Member

Well, trilead was on the core classpath, this one was not (AFAIUI).

@oleg-nenashev
Copy link
Member

IIUC upgrade guideline is not required here simnce the plugin is detached, may have been confused by the changelog entry. Am I right or not?

@kuisathaverat
Copy link
Contributor Author

yes, it is detached so nothing to do on the user side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-rfe For changelog: Major enhancement. Will be highlighted on the top ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants