-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
[JEP-230] [JENKINS-55582] Convert instance-identity
to a detached plugin
#6585
Merged
+129
−26
Merged
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d5cdafe
[JENKINS-55582] Split instance-identity to a plugin
basil cf4d77c
Merge commit 'd5cdafeb1d290e224aa7f2a8e478b08be9435f41' into instance…
jglick 70f6bf2
Update to `instance-identity` 3.1
jglick 1ed16c0
Add form validation for agents https://github.com/jenkinsci/jenkins/p…
jglick a3cd19a
Will also need `bouncycastle-api` 2.26 for the `instance-identity` dep
jglick ab04b07
Improved Javadoc
jglick 5eb2e05
`JNLPLauncherRealTest` turned up need for https://github.com/jenkinsc…
jglick f6af760
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick d96d64b
Also need to bump `sshd` in `split-plugins.txt` or we will get an old…
jglick da0fd2d
https://github.com/jenkinsci/sshd-plugin/pull/75 released
jglick 3b263bc
Discourage use of `jenkins.model.identity` from plugins.
jglick a8c46f1
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick fb2908c
Provisionally targeting 2.350
jglick 83fbe36
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick 4205138
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick 14c075b
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick ecd8400
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick 6192c7e
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick 46d571a
Update core/src/main/resources/jenkins/split-plugins.txt
timja 1b55251
Merge branch 'master' of https://github.com/jenkinsci/jenkins into in…
jglick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
test/src/test/java/hudson/slaves/JNLPLauncherRealTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2022 CloudBees, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package hudson.slaves; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import hudson.ExtensionList; | ||
import hudson.PluginWrapper; | ||
import hudson.model.FreeStyleBuild; | ||
import hudson.model.FreeStyleProject; | ||
import hudson.model.Slave; | ||
import hudson.util.FormValidation; | ||
import jenkins.slaves.JnlpSlaveAgentProtocol4; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.Description; | ||
import org.junit.runners.model.Statement; | ||
import org.jvnet.hudson.test.For; | ||
import org.jvnet.hudson.test.InboundAgentRule; | ||
import org.jvnet.hudson.test.Issue; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
import org.jvnet.hudson.test.RealJenkinsRule; | ||
|
||
@For({JNLPLauncher.class, JnlpSlaveAgentProtocol4.class}) | ||
public class JNLPLauncherRealTest { | ||
|
||
@Rule public RealJenkinsRule rr = new RealJenkinsRule().includeTestClasspathPlugins(false); | ||
|
||
@Issue("JEP-230") | ||
@Test public void smokes() throws Throwable { | ||
/* Since RealJenkinsRuleInit.jpi will load detached plugins, to reproduce a failure use: | ||
FileUtils.touch(new File(rr.getHome(), "plugins/instance-identity.jpi.disabled")); | ||
*/ | ||
rr.then(JNLPLauncherRealTest::_smokes); | ||
} | ||
|
||
private static void _smokes(JenkinsRule r) throws Throwable { | ||
InboundAgentRule inboundAgents = new InboundAgentRule(); // cannot use @Rule since it would not be accessible from the controller JVM | ||
inboundAgents.apply(new Statement() { | ||
@Override public void evaluate() throws Throwable { | ||
for (PluginWrapper plugin : r.jenkins.pluginManager.getPlugins()) { | ||
System.err.println(plugin + " active=" + plugin.isActive() + " enabled=" + plugin.isEnabled()); | ||
} | ||
assertThat(ExtensionList.lookupSingleton(JNLPLauncher.DescriptorImpl.class).doCheckWebSocket(false, null).kind, is(FormValidation.Kind.OK)); | ||
Slave agent = inboundAgents.createAgent(r, "static"); | ||
FreeStyleProject p = r.createFreeStyleProject(); | ||
p.setAssignedNode(agent); | ||
FreeStyleBuild b = r.buildAndAssertSuccess(p); | ||
System.err.println(JenkinsRule.getLog(b)); | ||
} | ||
}, Description.EMPTY).evaluate(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,10 +96,6 @@ THE SOFTWARE. | |
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jenkins-ci.modules</groupId> | ||
<artifactId>instance-identity</artifactId> | ||
</dependency> | ||
<dependency> | ||
<!-- | ||
We bundle slf4j binding since we got some components (sshd for example) | ||
|
@@ -399,7 +395,7 @@ THE SOFTWARE. | |
<artifactItem> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>bouncycastle-api</artifactId> | ||
<version>2.25</version> | ||
<version>2.26</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dep of current |
||
<type>hpi</type> | ||
</artifactItem> | ||
<artifactItem> | ||
|
@@ -423,7 +419,7 @@ THE SOFTWARE. | |
<artifactItem> | ||
<groupId>org.jenkins-ci.modules</groupId> | ||
<artifactId>sshd</artifactId> | ||
<version>3.0.3</version> | ||
<version>3.236.ved5e1b_cb_50b_2</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<type>hpi</type> | ||
</artifactItem> | ||
<artifactItem> | ||
|
@@ -444,6 +440,12 @@ THE SOFTWARE. | |
<version>1.6.2-5</version> | ||
<type>hpi</type> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.jenkins-ci.modules</groupId> | ||
<artifactId>instance-identity</artifactId> | ||
<version>3.1</version> | ||
<type>hpi</type> | ||
</artifactItem> | ||
</artifactItems> | ||
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins</outputDirectory> | ||
<stripVersion>true</stripVersion> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is released,
bom-weekly
can get it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though if I understand correctly from jenkinsci/bom#671 jenkinsci/bom#570 (comment) jenkinsci/bom#681, it cannot be added until this PR is in the oldest supported line, so that will be a while. In the meantime the handful of plugins using this dep can specify 3.1.