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

Add 2.222.x line #214

Merged
merged 14 commits into from
Apr 14, 2020
Merged

Add 2.222.x line #214

merged 14 commits into from
Apr 14, 2020

Conversation

timja
Copy link
Member

@timja timja commented Apr 9, 2020

Adding 2.222.x line,

Blocked on jenkinsci/workflow-cps-global-lib-plugin#93 currently

sample-plugin/pom.xml Show resolved Hide resolved
pom.xml Show resolved Hide resolved
Mac bundled one is ancient, homebrew one is put in /usr/local just let
the user configure their path, not hardcode which exe to use
@timja
Copy link
Member Author

timja commented Apr 10, 2020

java.lang.NullPointerException
	at hudson.security.csrf.CrumbFilter$Security1774ServletRequest.getPathInfo(CrumbFilter.java:74)
	at hudson.cli.CliCrumbExclusion.process(CliCrumbExclusion.java:45)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:127)
	at hudson.plugins.git.GitStatusCrumbExclusionTest.testNotifyCommit(GitStatusCrumbExclusionTest.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

I vaguely remember some fallout in the latest security fixes related to this ^^^

@timja
Copy link
Member Author

timja commented Apr 10, 2020

This is the fix for the git plugin tests, it's merged but unreleased: jenkinsci/git-plugin#857

@timja
Copy link
Member Author

timja commented Apr 10, 2020

jdk-tool passed locally for me so I assume a flake

EDIT: it failed on the next run, not sure what I'm missing to reproduce it

Edit 2: I can reproduce this with PLUGINS=jdk-tool TEST=hudson.tools.JDKInstallerTest ./local-test.sh but not via maven test or intellij in the jdk-tool repo

cc @oleg-nenashev I believe you're maintainer of this plugin

https://ci.jenkins.io/blue/organizations/jenkins/Tools%2Fbom/detail/PR-214/9/tests

hudson.tools.JDKInstallerTest

java.lang.NullPointerException
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.hasTopCall(ScriptRuntime.java:3263)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:102)
	at com.gargoylesoftware.htmlunit.javascript.host.dom.MutationObserver.attributeReplaced(MutationObserver.java:171)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:359)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.fireHtmlAttributeReplaced(HtmlElement.java:364)
	at com.gargoylesoftware.htmlunit.html.HtmlElement.setAttributeNS(HtmlElement.java:207)
	at com.gargoylesoftware.htmlunit.html.HtmlInput.setAttributeNS(HtmlInput.java:537)
	at com.gargoylesoftware.htmlunit.html.HtmlTextInput.setAttributeNS(HtmlTextInput.java:160)
	at com.gargoylesoftware.htmlunit.html.DomElement.setAttribute(DomElement.java:327)
	at com.gargoylesoftware.htmlunit.html.HtmlInput.setValueAttribute(HtmlInput.java:96)
	at hudson.tools.JDKInstallerTest.enterCredential(JDKInstallerTest.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:548)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)

@timja
Copy link
Member Author

timja commented Apr 10, 2020

Can reproduce failure for pct-workflow-cps-global-lib-2.222.x / configRoundtrip – org.jenkinsci.plugins.workflow.libs.GlobalLibrariesTest

cc @dwnusbaum
https://ci.jenkins.io/blue/organizations/jenkins/Tools%2Fbom/detail/PR-214/5/tests

403 Forbidden for http://localhost:35173/jenkins/configure
Stacktrace
com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 403 Forbidden for http://localhost:35173/jenkins/configure
	at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:590)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:408)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:315)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:463)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:448)
	at org.jvnet.hudson.test.JenkinsRule$WebClient.goTo(JenkinsRule.java:2506)
	at org.jvnet.hudson.test.JenkinsRule$WebClient.goTo(JenkinsRule.java:2486)
	at org.jenkinsci.plugins.workflow.libs.GlobalLibrariesTest.configRoundtrip(GlobalLibrariesTest.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:598)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)

@timja
Copy link
Member Author

timja commented Apr 12, 2020

@jglick / @oleg-nenashev

After lots of banging my head against the wall for the jdk-tool plugin test issue,

I've found where the issue lies at least,

I added some

Debug code
    Class theClass = Version.class;

    String classPath = theClass.getResource(theClass.getSimpleName() + ".class").toString();
    System.out.println("Class: " + classPath);

    String libPath = classPath.substring(0, classPath.lastIndexOf("!"));
    System.out.println("Lib:   " + libPath);

    String filePath = libPath + "!/META-INF/MANIFEST.MF";
    System.out.println("File:  " + filePath);

    Manifest manifest = new Manifest(new URL(filePath).openStream());
    Attributes attr = manifest.getMainAttributes();
    System.out.println("Manifest-Version: " + attr.getValue("Manifest-Version"));

Which when run in megawar mode in the bom repo with

mvn --show-version --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --define=failIfNoTests=false --define=jth.jenkins-war.path=/Users/timja/projects/jenkinsci/bom/target/local-test/megawar.war --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --define=forkCount=1 hpi:resolve-test-dependencies hpi:test-hpl test -Djenkins.version=2.222.1 -Denforcer.skip=true -Dtest=hudson.tools.JDKInstallerTest

Prints html unit version 2.18-1:

Class: jar:file:/Users/timja/.m2/repository/org/jenkins-ci/main/jenkins-test-harness-htmlunit/2.18-1/jenkins-test-harness-htmlunit-2.18-1.jar!/com/gargoylesoftware/htmlunit/Version.class
Lib:   jar:file:/Users/timja/.m2/repository/org/jenkins-ci/main/jenkins-test-harness-htmlunit/2.18-1/jenkins-test-harness-htmlunit-2.18-1.jar
File:  jar:file:/Users/timja/.m2/repository/org/jenkins-ci/main/jenkins-test-harness-htmlunit/2.18-1/jenkins-test-harness-htmlunit-2.18-1.jar!/META-INF/MANIFEST.MF

When run in intellij, version 2.36.0-1:

Class: jar:file:/Users/timja/.m2/repository/org/jenkins-ci/main/jenkins-test-harness-htmlunit/2.36.0-1/jenkins-test-harness-htmlunit-2.36.0-1.jar!/com/gargoylesoftware/htmlunit/Version.class
Lib:   jar:file:/Users/timja/.m2/repository/org/jenkins-ci/main/jenkins-test-harness-htmlunit/2.36.0-1/jenkins-test-harness-htmlunit-2.36.0-1.jar
File:  jar:file:/Users/timja/.m2/repository/org/jenkins-ci/main/jenkins-test-harness-htmlunit/2.36.0-1/jenkins-test-harness-htmlunit-2.36.0-1.jar!/META-INF/MANIFEST.MF
Manifest-Version: 1.0

Any idea why the bom is picking up such an ancient version of htmlunit?

for reference it appears to be caused by a combination of jenkinsci/jenkins#3991 and https://sourceforge.net/p/htmlunit/bugs/1811/

@oleg-nenashev
Copy link
Member

IURC there was some code in PCT which was setting a plugin POM version for Java 11 tests, maybe there is an issue in its logic which forces old plugin pom

@timja
Copy link
Member Author

timja commented Apr 12, 2020

IURC there was some code in PCT which was setting a plugin POM version for Java 11 tests, maybe there is an issue in its logic which forces old plugin pom

I think it might actually be as simple as an old parent pom in jdk-tool

but when I bump it running through PCT (megawar) I get:

[ERROR] hudson.tools.JDKInstallerTest.enterCredential  Time elapsed: 2.805 s  <<< ERROR!
java.lang.NoSuchMethodError: com.gargoylesoftware.htmlunit.html.HtmlInput.setValueAttribute(Ljava/lang/String;)Lcom/gargoylesoftware/htmlunit/Page;
	at hudson.tools.JDKInstallerTest.enterCredential(JDKInstallerTest.java:98)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:597)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:288)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:282)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)

Although it's fine in intellij and maven outside PCT

@timja
Copy link
Member Author

timja commented Apr 12, 2020

🤦 turned out to be a simple fix: jenkinsci/jdk-tool-plugin#12

Missed it as I was updating the parent pom locally because of enforcer errors, but PCT just ignores enforcer

failFast Outdated Show resolved Hide resolved
@timja timja marked this pull request as ready for review April 12, 2020 11:00
@timja
Copy link
Member Author

timja commented Apr 12, 2020

Previous build was green, requires jenkins-infra/repository-permissions-updater#1488 before releasing

<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>bom-2.164.x</artifactId>
<artifactId>bom-2.204.x</artifactId>
<version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
Copy link
Member

Choose a reason for hiding this comment

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

ansicolor 0.6.2 is still here, below. Should this not now be deleted?

Copy link
Member

Choose a reason for hiding this comment

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

0.6.3 requires 2.164.x; i.e. now all of our lines. So we can delete the below override.

Copy link
Member

Choose a reason for hiding this comment

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

(trying this in the appropriately named #222)

@@ -53,6 +53,15 @@ then
rm -fv pct-work/trilead-api/target/surefire-reports/TEST-InjectedTest.xml
fi

# TODO pending https://github.com/jenkinsci/jdk-tool-plugin/pull/12
Copy link
Member

Choose a reason for hiding this comment

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

# TODO pending https://github.com/jenkinsci/jdk-tool-plugin/pull/12
rm -rf pct-work/jdk-tool/target/surefire-reports/TEST-hudson.tools.JDKInstallerTest.xml

# TODO pending https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/96
Copy link
Member

Choose a reason for hiding this comment

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

# TODO pending https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/96
rm -rf pct-work/workflow-cps-global-lib/target/surefire-reports/TEST-org.jenkinsci.plugins.workflow.libs.GlobalLibrariesTest.xml

# TODO Merged, but needs a release: https://github.com/jenkinsci/git-plugin/pull/857
Copy link
Member

Choose a reason for hiding this comment

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

# TODO pending https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/96
rm -rf pct-work/workflow-cps-global-lib/target/surefire-reports/TEST-org.jenkinsci.plugins.workflow.libs.GlobalLibrariesTest.xml

# TODO Merged, but needs a release: https://github.com/jenkinsci/git-plugin/pull/857
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
# TODO Merged, but needs a release: https://github.com/jenkinsci/git-plugin/pull/857
# TODO pending https://github.com/jenkinsci/git-plugin/pull/857

(a lot of these are merged but pending release)

Comment on lines +82 to +83
also any of https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/95, https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/94,
https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/93 would solve it.
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
also any of https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/95, https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/94,
https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/93 would solve it.
also pending https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/94

Copy link
Member

Choose a reason for hiding this comment

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

@jglick jglick merged commit 4def3fb into jenkinsci:master Apr 14, 2020
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.

None yet

3 participants