-
Notifications
You must be signed in to change notification settings - Fork 130
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
Increase usage of TektonObject #881
Conversation
This commit removes certain parts of the code that switch on the underlying TektonObject type to determine if either the string `taskrun` or `pipelinerun` should be used. Instead, a new method on TektonObject is used. Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
The following is the coverage report on the affected files.
|
Change the code to no longer require callers to inspect the underlying type of the TektonObject. Instead, add a set of methods that specify which artifacts are supported. An alternative approach was consider to introduce a method such as `TektonObject.GetSignables` to return `[]artifacts.Signable`. However, `Signable` already has a dependency on `TektonObject` causing a circular import. Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
@chitrangpatel, let me know what you think of this approach. It's a small step towards making it easier to support multiple versions of TaskRun and PipelineRun objects. |
The following is the coverage report on the affected files.
|
Thanks @lcarva!!! This is amazing! |
Wondering if we can bump up the coverage of |
Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
Great catch! Added a new commit that covers all the functionality added, as well as some existing methods. |
The following is the coverage report on the affected files.
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chitrangpatel 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 |
/lgtm |
Changes
The first commit removes certain parts of the code that switch on the underlying TektonObject type to determine if either the string
taskrun
orpipelinerun
should be used. Instead, a new method on TektonObject is used.The second commit changes the code to no longer require callers to inspect the underlying type of the TektonObject to determine which
Signable
is supported. Instead, add a set of methods that specify which artifacts are supported. An alternative approach was consider to introduce a method such asTektonObject.GetSignables
to return[]artifacts.Signable
. However,Signable
already has a dependency onTektonObject
causing a circular import.Relates to #875
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes