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 1878700: Fix Add Pipeline Trigger for Pipeline Operator 1.1 #6612
Conversation
@jerolimov: This pull request references Bugzilla bug 1878700, 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
In response to this:
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. |
@jerolimov: This pull request references Bugzilla bug 1878700, which is valid. 3 validation(s) were run on this bug
In response to this:
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. |
/retest |
/retest |
1 similar comment
/retest |
@jerolimov You have TS errors, I think it's causing the whole CI stack to fail:
|
2baac48
to
1fb87f6
Compare
@andrewballantyne Thanks for that hint. :) Fixed the TS error. This fixes also an issue that the Previously it does not show the name for Pipeline Triggers which was created with 1.1. I noticed that Pipeline Triggers which was created with 1.0 does not run in 1.1. But this is true for all Pipeline objects I think. The pipelines itself also doesn't work after the update. Since everything is Tech Preview and Alpha here I think this is "okayish" |
/retest |
1 similar comment
/retest |
/kind bug |
ref: string; | ||
// We also support older operators, so need to show & save the old field as well. | ||
// https://github.com/tektoncd/triggers/pull/603/files | ||
// https://github.com/tektoncd/triggers/releases/tag/v0.5.0 and | ||
// https://github.com/tektoncd/triggers/releases/tag/v0.6.0 | ||
/** @deprecated use ref instead */ | ||
name?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we might be able to use keyof
here, or would it become too verbose? Especially since name
is deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know what the solution looks like then. But the usage in triggers.ts works fine with name and at least VScode shows these deprecated hint. But I'm open to see and try an example here. /me open the TS keyof definition :)
The current solution uses the Tekton CRD version labels. Unfortunately these are not readable for all users / developers. Will change the solution and remove the WIP label after that. |
39ab213
to
2468828
Compare
@jerolimov: This pull request references Bugzilla bug 1878700, which is valid. 3 validation(s) were run on this bug
In response to this:
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. |
expect(k8sList).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
it('should return null if there is no matching ClusterServiceVersion available', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you write one more test for valid items but not including a Pipeline Operator? I think you covered both sides (none and mixed), but I think there is still valid test possible here for just invalid ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added new test, it should return null if there is no pipeline operator at all
csv.status?.phase === ClusterServiceVersionPhase.CSVPhaseSucceeded, | ||
); | ||
const versions = matchingCSVs.map((csv) => parse(csv.spec.version)).filter(Boolean); | ||
// Orders from small (oldest) to highest (newest) version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this comment vs the tests.
// Orders from small (oldest) to highest (newest) version | |
// Orders versions from latest to earliest |
You're grabbing the last one, the earliest version based on your tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order after this versions.sort(compare)
is 1.0, 1.1, 2.0, ... And then I selected the last one (to get the newest version). The comment was only for the versions.sort
line. I will update that comment so that it matches both lines or do some code change. don't know yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I was confused by your test... I didn't read the phase
value. You're right. Apologizes -- ignore this thread.
/lgtm /assign @rohitkrai03 @christianvogt |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, christianvogt, jerolimov 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 |
/retest |
In response to this:
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. |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@jerolimov: All pull requests linked via external trackers have merged: Bugzilla bug 1878700 has been moved to the MODIFIED state. In response to this:
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. |
/cherry-pick release-4.5 |
@jerolimov: #6612 failed to apply on top of branch "release-4.5":
In response to this:
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. |
Because automatically check picking fails I created PR #6675 manually. |
Fixes:
https://issues.redhat.com/browse/ODC-4496
https://bugzilla.redhat.com/show_bug.cgi?id=1878700
Analysis / Root cause:
With the OpenShift Pipeline Operator 1.1 a new version of Pipeline Trigger CRDs was released. The new version was 0.6.
In 0.5.0 (we didn't see this version in the Operator) they deprecated
{{spec.triggers[].bindings[].name}}
.In 0.6.0 (TP2 - 1.1 of the Operator) it has been removed in favour of deprecated
{{spec.triggers[].bindings[].ref}}
.So we need to change the EventListener generation (source code) in a way we support OpenShift Pipeline Operator 1.0 and 1.1.
Solution Description:
The code checks the installed OpenShift Pipeline Operator version. If it finds the version 0.x or 1.0.x it uses the old EventListener format, and the new one format otherwise (also in the case the Operator version check fails).
Screen shots / Gifs for design review:
No visual change here.
Unit test coverage report:
Add new tests for the new
getPipelineOperatorVersion
method.Test setup:
Browser conformance: