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 1763725: fix(tekton-migration): Fix trigger type and resource issue #3086

Merged

Conversation

abhinandan13jan
Copy link
Contributor

@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 24, 2019
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.

My review of the code - I'll have to do a deeper dive into the yaml changes before I can give more feedback on that.

<TableData className={tableColumnClasses[5]}>
{obj.spec && obj.spec.trigger && obj.spec.trigger.type ? obj.spec.trigger.type : '-'}
</TableData>
<TableData className={tableColumnClasses[5]}>-</TableData>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any point in having the trigger column when it's no longer a valid field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would require UX intervention

Copy link
Contributor

Choose a reason for hiding this comment

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

@abhinandan13jan Don't wait on me to say go talk to UX :) Reach out to UX and discuss this at your earliest convenience. Having a dead column helps no one.

Copy link
Contributor

@christianvogt christianvogt Oct 25, 2019

Choose a reason for hiding this comment

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

I think it's fairly obvious that we need to remove this column now. Inform UX in case they want to substitute or there's an alternative. But right now it will never show any data and therefore it has no value with the current change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the column, cascading the same to UX

Comment on lines 26 to 30
const resources = [];
const runResources = _.get(latestRun, ['spec', 'resources'], []);
runResources.forEach((resource) =>
resources.push({ name: resource.name, resourceRef: resource.resourceRef }),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

  const runResources = _.get(latestRun, ['spec', 'resources'], []);
  const resources = runResources.map((resource) => (
    { name: resource.name, resourceRef: resource.resourceRef }
  ));

No sense in reinventing map.

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 this

resources:
latestRun && latestRun.spec && latestRun.spec.resources
? latestRun.spec.resources
: pipeline && pipeline.spec && pipeline.spec.resources
Copy link
Contributor

Choose a reason for hiding this comment

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

You no longer have the fallback - was this intentional? latestRun is optional
https://github.com/openshift/console/pull/3086/files#diff-25f91b2db21c7ce21bcebedf9f18bb23R19

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's why the above lines, if no 'latestrun' and no resources, this field would be []

Copy link
Contributor

@andrewballantyne andrewballantyne Oct 25, 2019

Choose a reason for hiding this comment

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

Sorry, perhaps I am misunderstanding - where are you looking into pipeline.spec.resources now? There are two fallbacks here... latestRun.spec.resources falls back into pipeline.spec.resources falls back into []. You're not doing this anymore as far as I can see - you just do latestRun and [].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should not be using 'pipeline.specs' any longer as it would simply not work and fail the validation. For a fallback a [] is used instead now.

@andrewballantyne
Copy link
Contributor

/assign

@andrewballantyne
Copy link
Contributor

andrewballantyne commented Oct 25, 2019

Looks like you missed the StartPipelineModal trigger value (not sure how you were able to start them in your gif).
Ref: frontend/packages/dev-console/src/components/pipelines/pipeline-form/StartPipelineModal.tsx

@andrewballantyne
Copy link
Contributor

We should also look to remove the base.yaml as well as it contains incompatible webhook that is serving up 0.3.1. It was causing the error around needing trigger. Let's remove it so we don't have an accidental re-triggering of this problem.

From slack:

https://github.com/openshift/console/blob/master/frontend/packages/dev-console/yamls/pipelines/base.yaml shouldn't be there if you install openshift-pipelines using the operator

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 29, 2019
@abhinandan13jan
Copy link
Contributor Author

abhinandan13jan commented Oct 29, 2019

Looks like you missed the StartPipelineModal trigger value (not sure how you were able to start them in your gif).
Ref: frontend/packages/dev-console/src/components/pipelines/pipeline-form/StartPipelineModal.tsx

@andrewballantyne Thanks for pointing that out. I have moved out that block.
Even without those changes it works as we are finally using getPipelineRunData(pipeline-action.ts) function for creating a new PipelineRun resource with the correct specs.

Also, I have removed the base.yaml so that it is not added to the cluster by mistake.

We must be looking for other pieces to improve upon with regards to the migration, for the time being this is the minimum that must go in to unblock other stories around Tekton. It's already a XXL PR 😄

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 29, 2019

@abhinandan13jan: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-console-olm 5e5a498 link /test e2e-aws-console-olm

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@abhinandan13jan
Copy link
Contributor Author

/test e2e-aws-console-olm
/test e2e-gcp-console

@@ -47,9 +47,6 @@ const PipelineRunRow: React.FC<PipelineRunRowProps> = ({ obj, index, key, style
</TableData>
<TableData className={tableColumnClasses[4]}>-</TableData>
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, there is another column here doing nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the duration field, which should come as a backend response. It is blank from the very beginning

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you log a bug for us to address it later. We'll investigate with UX to see if there was any intent here.

@@ -94,3 +94,369 @@ export const testData: PipelineAugmentData[] = [
},
},
];

export enum DataState {
Copy link
Contributor

Choose a reason for hiding this comment

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

Conflict resolution problem? This should have been moved to dev-console/src/test/pipeline-data.ts in one of my last PRs that were merged yesterday.

Did you add something to the lines below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nopes, I just accepted incoming changes

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, if you didn't change anything, just remove all the "added" lines here. Not sure how you got them back :) (are you on latest?)

Copy link
Contributor

Choose a reason for hiding this comment

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

I verified, and all the code is using the ones from pipeline-data so these lines are just dead code.

Copy link
Contributor Author

@abhinandan13jan abhinandan13jan Oct 29, 2019

Choose a reason for hiding this comment

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

yup, ok. I m removing them from pipeline-augment-test-data

@andrewballantyne
Copy link
Contributor

/lgtm

We'll need to see what we can do to get a z-stream fix for 4.2

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 29, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinandan13jan, andrewballantyne, christianvogt, vdemeester

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 Oct 29, 2019
@openshift-merge-robot openshift-merge-robot merged commit 5685539 into openshift:master Oct 29, 2019
@spadgett spadgett added this to the v4.3 milestone Oct 31, 2019
@andrewballantyne
Copy link
Contributor

/retitle Bug 1763725: fix(tekton-migration): Fix trigger type and resource issue

REF: https://bugzilla.redhat.com/show_bug.cgi?id=1763725

@openshift-ci-robot openshift-ci-robot changed the title fix(tekton-migration): Fix trigger type and resource issue in Pipelin… Bug 1763725: fix(tekton-migration): Fix trigger type and resource issue Nov 1, 2019
@openshift-ci-robot
Copy link
Contributor

@abhinandan13jan: All pull requests linked via external trackers have merged. Bugzilla bug 1763725 has been moved to the MODIFIED state.

In response to this:

Bug 1763725: fix(tekton-migration): Fix trigger type and resource issue

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.

@andrewballantyne
Copy link
Contributor

/cherrypick release-4.2

QE Verification was just completed, cherry picking to 4.2.

@openshift-cherrypick-robot

@andrewballantyne: #3086 failed to apply on top of branch "release-4.2":

Using index info to reconstruct a base tree...
M	frontend/packages/dev-console/src/components/pipelineruns/PipelineRunRow.tsx
A	frontend/packages/dev-console/src/test/pipeline-data.ts
M	frontend/packages/dev-console/src/utils/pipeline-actions.tsx
M	frontend/packages/dev-console/src/utils/pipeline-augment.ts
Falling back to patching base and 3-way merge...
Removing frontend/packages/dev-console/yamls/pipelines/base.yaml
Auto-merging frontend/packages/dev-console/src/utils/pipeline-augment.ts
CONFLICT (content): Merge conflict in frontend/packages/dev-console/src/utils/pipeline-augment.ts
Auto-merging frontend/packages/dev-console/src/utils/pipeline-actions.tsx
CONFLICT (modify/delete): frontend/packages/dev-console/src/test/pipeline-data.ts deleted in HEAD and modified in fix(tekton-migration): Fix trigger type and resource issue in Pipeline start. Version fix(tekton-migration): Fix trigger type and resource issue in Pipeline start of frontend/packages/dev-console/src/test/pipeline-data.ts left in tree.
Auto-merging frontend/packages/dev-console/src/components/pipelineruns/PipelineRunRow.tsx
error: Failed to merge in the changes.
Patch failed at 0001 fix(tekton-migration): Fix trigger type and resource issue in Pipeline start

In response to this:

/cherrypick release-4.2

QE Verification was just completed, cherry picking to 4.2.

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.

@andrewballantyne
Copy link
Contributor

andrewballantyne commented Nov 4, 2019

/bugzilla refresh

Was seeing if missed a step for it to be linked.

@openshift-ci-robot
Copy link
Contributor

@andrewballantyne: Bugzilla bug 1763725 is in an unrecognized state (VERIFIED) and will not be moved to the MODIFIED state.

In response to this:

/bugzilla refresh

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. component/dev-console Related to dev-console lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants