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-55582] Split instance-identity to a plugin #5304

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ THE SOFTWARE.
</dependency>

<!-- Modules -->
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>slave-installer</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/resources/jenkins/split-plugin-cycles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ junit jaxb
bouncycastle-api jaxb
command-launcher jaxb
jdk-tool jaxb

# JENKINS-55582
bouncycastle-api instance-identity
bouncycastle-api command-launcher
trilead-api instance-identity
jdk-tool instance-identity
bouncycastle-api jdk-tool
Copy link
Member Author

Choose a reason for hiding this comment

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

Trial-and-error.

I still get errors during the setup wizard because ssh-credentials cannot be installed without updating trilead-api. Not sure if that is somehow related to this PR.

Copy link
Member

Choose a reason for hiding this comment

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

yes, sshd PR worked fine through setup wizard.

Appears to be related to this PR

Also I get this on a clean install on startup:

2021-02-25 21:13:53.773+0000 [id=42]	WARNING	h.ExtensionFinder$GuiceFinder$SezpozModule#configure: Failed to load org.jenkinsci.modules.systemd_slave_installer.SlaveInstallerFactoryImpl
java.lang.ClassNotFoundException: org.jenkinsci.main.modules.instance_identity.InstanceIdentity
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:538)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
Caused: java.lang.NoClassDefFoundError: Lorg/jenkinsci/main/modules/instance_identity/InstanceIdentity;
	at java.base/java.lang.Class.getDeclaredFields0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
	at java.base/java.lang.Class.getDeclaredFields(Class.java:2248)
	at hudson.ExtensionFinder$GuiceFinder$SezpozModule.resolve(ExtensionFinder.java:497)
	at hudson.ExtensionFinder$GuiceFinder$SezpozModule.resolve(ExtensionFinder.java:482)
	at hudson.ExtensionFinder$GuiceFinder$SezpozModule.configure(ExtensionFinder.java:525)
	at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
	at com.google.inject.spi.Elements.getElements(Elements.java:110)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
	at com.google.inject.Guice.createInjector(Guice.java:96)
	at com.google.inject.Guice.createInjector(Guice.java:73)
	at hudson.ExtensionFinder$GuiceFinder.<init>(ExtensionFinder.java:285)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at net.java.sezpoz.IndexItem.instance(IndexItem.java:181)
	at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:703)
	at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:689)
	at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:349)
	at hudson.ExtensionList.load(ExtensionList.java:381)
	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:317)
	at hudson.ExtensionList.getComponents(ExtensionList.java:183)
	at jenkins.model.Jenkins$6.onInitMilestoneAttained(Jenkins.java:1161)
	at jenkins.InitReactorRunner$1.onAttained(InitReactorRunner.java:84)
	at org.jvnet.hudson.reactor.ReactorListener$Aggregator.lambda$onAttained$3(ReactorListener.java:102)
	at org.jvnet.hudson.reactor.ReactorListener$Aggregator.run(ReactorListener.java:109)
	at org.jvnet.hudson.reactor.ReactorListener$Aggregator.onAttained(ReactorListener.java:102)
	at org.jvnet.hudson.reactor.Reactor$1.run(Reactor.java:177)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Copy link
Member Author

Choose a reason for hiding this comment

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

Will recheck after merge of #5049.

Copy link
Member

Choose a reason for hiding this comment

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

It’s merged?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I know, but I need time to retest.

5 changes: 4 additions & 1 deletion core/src/main/resources/jenkins/split-plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ windows-slaves 1.547 1.0
antisamy-markup-formatter 1.553 1.0
matrix-project 1.561 1.0
junit 1.577 1.0
bouncycastle-api 2.16 2.16.0
bouncycastle-api 2.18 2.16.0
Copy link
Member Author

Choose a reason for hiding this comment

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

Dep of new plugin.

# JENKINS-47393
command-launcher 2.86 1.0
# JENKINS-22367
Expand All @@ -34,3 +34,6 @@ sshd 2.281 3.0.1

#JENKINS-43610 Split Trilead out from Core
trilead-api 2.184 1.0.4

# JENKINS-55582
instance-identity 2.281 3.0
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ THE SOFTWARE.

<matrix-auth.version>2.6.5</matrix-auth.version>
<matrix-project.version>1.18</matrix-project.version>
<instance-identity.version>3.0</instance-identity.version>
<sorcerer.version>0.11</sorcerer.version>
<animal.sniffer.skip>${skipTests}</animal.sniffer.skip>
<java.level>8</java.level>
Expand Down
5 changes: 5 additions & 0 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ THE SOFTWARE.
<!-- TODO define property for this and share with war/pom.xml-->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
<version>${instance-identity.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>sshd</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public void xstreamRequiresWhitelist() throws Exception {
public void moduleClassesShouldBeWhitelisted() throws Exception {
ClassFilterImpl filter = new ClassFilterImpl();
filter.check("org.jenkinsci.modules.windows_slave_installer.WindowsSlaveInstaller");
filter.check("org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl");
Copy link
Member Author

Choose a reason for hiding this comment

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

No longer a module, so no longer relevant to test.

}

@TestExtension("xstreamRequiresWhitelist")
Expand Down
40 changes: 36 additions & 4 deletions war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,55 @@ THE SOFTWARE.
<version>5.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>slave-installer</artifactId>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>windows-slave-installer</artifactId>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>launchd-slave-installer</artifactId>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>upstart-slave-installer</artifactId>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>systemd-slave-installer</artifactId>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.ui</groupId>
Expand Down Expand Up @@ -397,6 +423,12 @@ THE SOFTWARE.
<version>1.0.4</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
<version>${instance-identity.version}</version>
<type>hpi</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins</outputDirectory>
<stripVersion>true</stripVersion>
Expand Down