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

Make it work again #776

Closed
wants to merge 2 commits into from
Closed

Conversation

jtnord
Copy link
Member

@jtnord jtnord commented May 27, 2022

this should fix the majority of ATHs OwnerShipTest (and possibly many in the future when plugins upgrade) by not installing the form-element-path-plugin which is not required as of modern (2.323 or above)) Jenkins versions (jenkinsci/jenkins#5926)

fixes : #775
I have only tested the WinstoneController (using OwnershipPluginTest) neither the JBOSS nor Tomcat has been tested, information on the configuration was obtained from their respective documentation. Similarly WinstoneDockerController has not been tested.

For existing controllers it will be the responsibilty of the user to start them with the required flag (-Djenkins.formelementpath.FormElementPathPageDecorator.enabled=true)

Also fixes an issue with the mock-update center that caused it to not work

@jtnord jtnord requested review from Vlatombe and timja May 27, 2022 20:48
@jtnord jtnord enabled auto-merge May 27, 2022 20:49
@jtnord jtnord requested a review from jglick May 27, 2022 20:51

import javax.inject.Inject;
import javax.inject.Named;

import org.codehaus.plexus.util.FileUtils;
import org.apache.commons.io.FileUtils;
Copy link
Member Author

Choose a reason for hiding this comment

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

was likely a previous accident, and the write taking a charset was not present so switched.

@@ -25,7 +25,7 @@ public class CachedUpdateCenterMetadataLoader implements UpdateCenterMetadataPro
File cacheBase = new File(System.getProperty("java.io.tmpdir"), "update-center");

@Inject(optional=true) @Named("update_center_url")
String url = "https://updates.jenkins-ci.org/update-center.json"; // TODO consider using update-center.actual.json so we do not need to strip preamble/postamble
String url = "https://updates.jenkins.io/update-center.json"; // TODO consider using update-center.actual.json so we do not need to strip preamble/postamble
Copy link
Member Author

@jtnord jtnord May 27, 2022

Choose a reason for hiding this comment

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

just blew up spectaculary when running.

I got the same in my browser and then changed it and it worked. could have been a site redeply - but given this is now the expected URL to use we may as well use it.

INFO: Installing plugins for test: [ownership, cloudbees-folder]
Downloading https://updates.jenkins-ci.org/update-center.json?version=2.345 to C:\Users\jnord\AppData\Local\Temp\update-center-2.345.jsonp
java.lang.Error: cannot load data for mock update center
        at org.jenkinsci.test.acceptance.update_center.MockUpdateCenter.ensureRunning(MockUpdateCenter.java:106)
        at org.jenkinsci.test.acceptance.po.PluginManager.checkForUpdates(PluginManager.java:93)
        at org.jenkinsci.test.acceptance.po.PluginManager.installPlugins(PluginManager.java:188)
        at org.jenkinsci.test.acceptance.junit.WithPlugins$RuleImpl$1.installPlugins(WithPlugins.java:195)
        at org.jenkinsci.test.acceptance.junit.WithPlugins$RuleImpl$1.evaluate(WithPlugins.java:142)
        at org.jenkinsci.test.acceptance.junit.Since$RuleImpl$1.evaluate(Since.java:49)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at org.jenkinsci.test.acceptance.junit.JenkinsAcceptanceTestRule$1$2$1.evaluate(JenkinsAcceptanceTestRule.java:168)
        at org.jenkinsci.test.acceptance.junit.FilterRule$1.evaluate(FilterRule.java:63)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at org.jenkinsci.test.acceptance.junit.JenkinsAcceptanceTestRule$1.evaluate(JenkinsAcceptanceTestRule.java:58)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:352)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:295)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:290)
        at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1357)
        at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1232)
        at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1175)
        at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421)
        at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:182)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1501)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1411)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:451)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:422)
        at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:572)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:197)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
        at java.base/java.net.URL.openStream(URL.java:1165)
        at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1025)
        at org.jenkinsci.test.acceptance.update_center.CachedUpdateCenterMetadataLoader.get(CachedUpdateCenterMetadataLoader.java:42)
        at org.jenkinsci.test.acceptance.update_center.MockUpdateCenter.ensureRunning(MockUpdateCenter.java:104)
        ... 32 more
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
        at java.base/sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:369)
        at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:263)
        at java.base/sun.security.validator.Validator.validate(Validator.java:264)
        at java.base/sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313)
        at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:222)
        at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:129)
        at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1341)
        ... 52 more
Caused by: java.security.cert.CertPathValidatorException: validity check failed
        at java.base/sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:135)
        at java.base/sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:224)
        at java.base/sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:144)
        at java.base/sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:83)
        at java.base/java.security.cert.CertPathValidator.validate(CertPathValidator.java:309)
        at java.base/sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:364)
        ... 58 more
Caused by: java.security.cert.CertificateExpiredException: NotAfter: Wed Feb 12 23:59:59 GMT 2020
        at java.base/sun.security.x509.CertificateValidity.valid(CertificateValidity.java:277)
        at java.base/sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:675)
        at java.base/sun.security.provider.certpath.BasicChecker.verifyValidity(BasicChecker.java:190)
        at java.base/sun.security.provider.certpath.BasicChecker.check(BasicChecker.java:144)
        at java.base/sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:125)
        ... 63 more

@jtnord
Copy link
Member Author

jtnord commented May 27, 2022

plugins.JiraPluginTest.jira_ticket_gets_updated_with_a_build_link is fixed in #772

JobDsl plugin tests are broken still (why does it seem to always be JobDSL?)

@timja timja mentioned this pull request May 29, 2022
@timja
Copy link
Member

timja commented May 30, 2022

merged in #778

@timja timja closed this May 30, 2022
auto-merge was automatically disabled May 30, 2022 07:00

Pull request was closed

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.

ATH always installs form-element-path plugin which causes failures due to detached plugins
2 participants