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-41966] load and save using the editor from Github #886

Merged
merged 16 commits into from Mar 7, 2017
Merged

[FIX JENKINS-41966] load and save using the editor from Github #886

merged 16 commits into from Mar 7, 2017

Conversation

kzantow
Copy link
Collaborator

@kzantow kzantow commented Mar 6, 2017

Description

Only real changes here are:

  • refactored loading indicator to blueocean-core-js
  • modified back behavior of RunDetails to use router history
  • added an extension point for the Create Pipeline button

Before the pipeline-editor work is completed and the plugin is installed (and we'll update the version in the POM), we'll get this for creation, which I think is acceptable:

image

See JENKINS-41966.

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

pom.xml Outdated
@@ -133,49 +133,49 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-commons</artifactId>
<version>${project.version}</version>
<version>${project.parent.version}</version>
Copy link
Member

Choose a reason for hiding this comment

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

oh? What difference does this make vs project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I should probably revert this, but the issue was if you use the blueocean parent (which I was trying for another reason) you have to set your plugin to the same as the blueocean verasion. But one shouldn't need to use the blueocean parent, so...

Copy link
Member

Choose a reason for hiding this comment

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

ok

@kzantow
Copy link
Collaborator Author

kzantow commented Mar 7, 2017

Copy link
Contributor

@cliffmeyers cliffmeyers left a comment

Choose a reason for hiding this comment

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

Overall these changes LGTM.

I do have a question about the changes in RunDetails and background persist code. It's not clear to me what issue that change is trying to fix. Since I've worked on some bugs in that area just want to understand the changes to help determine whether they might regress anything.

@@ -64,6 +64,7 @@ class RunDetails extends Component {

componentWillMount() {
this._fetchRun(this.props, true);
this.opener = locationService.previous;
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call, this is much simpler code. Can remove the true as second param up above though.

router.goBack();
} else {
const fallbackUrl = buildPipelineUrl(params.organization, params.pipeline);
router.push(fallbackUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if push or replace is more appropriate here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm, I'm not really sure, either. replace might be more consistent, but if i go to the page directly, and accidentally hit esc or something, it would be nice to go back in that case.

const classListAsArray = new Array(classList.length);
for (let i = 0, len = classList.length; i < len; i++) {
classListAsArray[i] = classList[i];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You may be able to simplify this code to:
const classListAsArray = [... classList]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good call, updated.

@kzantow
Copy link
Collaborator Author

kzantow commented Mar 7, 2017

@cliffmeyers the RunDetails changes are necessary to solve the 'link to editor page' from there. Otherwise, we get into a cycle, as you navigate to the pipeline editor, and when you navigate back to the run details, it stores the opener of the pipeline editor. it seems to make a lot more sense to just pop this off the history, as it's supposed to be a modal for now, anyway. this gives it more 'modal' type behavior. I assume there could be other similar issues introduced in the future, this should just solve that whole set of problems.

Copy link
Contributor

@cliffmeyers cliffmeyers left a comment

Choose a reason for hiding this comment

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

@kzantow thanks for clarifying. SGTM 🐝

@kzantow kzantow changed the title [WiP] [ FIX JENKINS-41966] load and save using the editor from Github [FIX JENKINS-41966] load and save using the editor from Github Mar 7, 2017
@kzantow
Copy link
Collaborator Author

kzantow commented Mar 7, 2017

@michaelneale happy to have you give this a smoke test before merging, if you had some time - especially making sure loading indicators aren't acting really crazy, though you might see more, and the run details seems to work as expected wherever you navigate from

runnable={ this.props.pipeline }
latestRun={ currentRun }
buttonType="stop-only"
/>,
<Extensions.Renderer extensionPoint="jenkins.blueocean.rundetails.top.widgets"
Copy link
Member

Choose a reason for hiding this comment

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

Nice

@michaelneale
Copy link
Member

@kzantow nice - yes I can see loading worm on creation too - which is a nice addition. Of course when it scrolls down it isnt visible but that doesn't matter.

LGTM 🐝

This is a tour de force of necessary additions and improvements.

@kzantow kzantow merged commit 8282175 into jenkinsci:master Mar 7, 2017
@kzantow kzantow deleted the JENKINS-41966-load-save-from-github branch March 8, 2017 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants