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

[FIX JENKINS-41638] "Open Blue Ocean" construction by replacing the classic object path with the blue ocean object path #819

Merged
merged 7 commits into from
Feb 14, 2017

Conversation

tfennelly
Copy link
Member

Description

... so that it no longer matters if the configured Jenkins URL is different to current browser URL e.g. from outside a proxy.

See JENKINS-41638.

To test ... run a local Jenkins with this change ... run something like ngrok locally ... browse to the Jenkins via the ngrok URL e.g. browsing to http://555862b4.ngrok.io/jenkins/job/ATH/job/activateFolder/ should result in an "Open Blue Ocean" linking to http://555862b4.ngrok.io/jenkins/blue/organizations/jenkins/ATH/branches Vs it trying to use the configured Jenkins URL (localhost:8080 etc)..

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
  • Ran Acceptance Test Harness against PR changes.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

@reviewbybees

Copy link
Collaborator

@scherler scherler left a comment

Choose a reason for hiding this comment

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

LGTM

@tfennelly tfennelly force-pushed the JENKINS-41638-v2 branch 2 times, most recently from a8a7805 to 6d028dd Compare February 13, 2017 19:48
@michaelneale
Copy link
Member

@tfennelly:

Error
Malformed URL: blue/organizations/jenkins/freestyle/activity/
Stacktrace
java.lang.IllegalArgumentException: Malformed URL: blue/organizations/jenkins/freestyle/activity/
	at org.jsoup.helper.HttpConnection.url(HttpConnection.java:101)
	at org.jsoup.helper.HttpConnection.connect(HttpConnection.java:43)
	at org.jsoup.Jsoup.connect(Jsoup.java:73)
	at io.jenkins.blueocean.preload.StatePreloaderTest.test(StatePreloaderTest.java:55)
	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$2.evaluate(JenkinsRule.java:533)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: java.net.MalformedURLException: no protocol: blue/organizations/jenkins/freestyle/activity/

Looks like a related test failure - but nice to see this approach

@michaelneale
Copy link
Member

LGTM - but that io.jenkins.blueocean.preload.StatePreloaderTest error is worth looking into - but I tried this with different domains via /etc/hosts and it seemed to work nicely.

@tfennelly tfennelly merged commit 7dca244 into master Feb 14, 2017
@tfennelly tfennelly deleted the JENKINS-41638-v2 branch February 14, 2017 16:41
i386 pushed a commit that referenced this pull request Feb 15, 2017
…lassic object path with the blue ocean object path (#819)

* Construct "Open Blue Ocean" URL by replacing the object url with the Blue Ocean URL

* Fix "Open Blue Ocean" URL tests

* Fix "Open Blue Ocean" URL for classic pages where there's no BO page e.g. folders

* Fix "Open Blue Ocean" URL for Run instances (they're not Items)

* Fix StatePreloaderTest

* change the try.js path substitution

* Tweak try.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants