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

Bug 1835228: handle embedded pipeline spec in pipelinerun scenario #5425

Merged

Conversation

karthikjeeyar
Copy link
Contributor

@karthikjeeyar karthikjeeyar commented May 13, 2020

Fixes: https://issues.redhat.com/browse/ODC-3675

Problem:
Devconsole UI breaks when user creates pipelinerun with embedded pipeline spec and visits the pipeline run details page

Solution:
Add checks and conditionally rendering the pipelinerun visualization component based on the pipelineRef field in the pipelinerun spec.

Screenshots:
The pipeline Visualization component and Pipeline resource links will not be rendered, if there is no pipelineRef attached to it.
image

Unit coverage:
image
Broswer confromance:

  • Chrome
  • Firefox
  • Safari
  • Edge

cc: @openshift/team-devconsole-ux @serenamarie125 @andrewballantyne

@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: This pull request references Bugzilla bug 1835228, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1835228: handle embedded pipeline spec in pipelinerun scenario

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console labels May 13, 2020
@karthikjeeyar
Copy link
Contributor Author

/kind bug
/assign @andrewballantyne

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 13, 2020
@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: This pull request references Bugzilla bug 1835228, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1835228: handle embedded pipeline spec in pipelinerun scenario

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

1 similar comment
@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: This pull request references Bugzilla bug 1835228, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1835228: handle embedded pipeline spec in pipelinerun scenario

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -399,3 +399,6 @@ export const getResourceModelFromTask = (task: PipelineTask): K8sKind => {

return getResourceModelFromTaskKind(kind);
};

export const pipelineExists = (pipelineRun: PipelineRun): boolean =>
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be pipelineRunExists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No @debsmita1, this function checks if pipeline reference is availble in a pipelineRun object, maybe we should change it to pipelineRefExists.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yes, pipelineRefExists sounds good. Thank you for clarifying

@debsmita1
Copy link
Contributor

verified this locally
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2020
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for this fix. This will need to be backported once it merges. We don't officially support the pipelineSpec yet, but we do need to support not white-screening when it is used.

Comment on lines 289 to 296
const pipelineRunWithoutPipelineRef = {
...pipelineTestData[PipelineExampleNames.SIMPLE_PIPELINE].pipelineRuns[DataState.SUCCESS],
spec: {
...pipelineTestData[PipelineExampleNames.SIMPLE_PIPELINE].pipelineRuns[DataState.SUCCESS]
.spec,
pipelineRef: undefined,
},
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we don't actually support the pipelineSpec with this change... we can keep this test as just omit the pipelineRef. Which can be simplified if we just use lodash to omit the field.

Suggested change
const pipelineRunWithoutPipelineRef = {
...pipelineTestData[PipelineExampleNames.SIMPLE_PIPELINE].pipelineRuns[DataState.SUCCESS],
spec: {
...pipelineTestData[PipelineExampleNames.SIMPLE_PIPELINE].pipelineRuns[DataState.SUCCESS]
.spec,
pipelineRef: undefined,
},
};
const pipelineRunWithoutPipelineRef = _.omit(
pipelineTestData[PipelineExampleNames.SIMPLE_PIPELINE].pipelineRuns[DataState.SUCCESS],
'spec.pipelineRef',
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated it.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 18, 2020
@debsmita1
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 18, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, debsmita1, karthikjeeyar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2020
@openshift-merge-robot openshift-merge-robot merged commit 7297b20 into openshift:master May 21, 2020
@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: All pull requests linked via external trackers have merged: openshift/console#5425. Bugzilla bug 1835228 has been moved to the MODIFIED state.

In response to this:

Bug 1835228: handle embedded pipeline spec in pipelinerun scenario

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants