-
Notifications
You must be signed in to change notification settings - Fork 249
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
Add a --filename parameter to 'tkn tasks start'. #459
Conversation
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
pkg/cmd/task/start.go
Outdated
|
||
_ = c.MarkZshCompPositionalArgumentCustom(1, "__tkn_get_task") | ||
|
||
return c | ||
} | ||
|
||
func startTask(opt startOptions, tname string) error { | ||
// For stubbing in 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.
This is actually used in startTask
, so can we remove the comment?
defer func() { | ||
parseTask = oldParseTask | ||
}() | ||
parseTask = func(p string) (*v1alpha1.Task, error) { |
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.
This doesn't appear to cover parseTask
in startTask
.
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 see. It's because of the reassignment. Wondering if there's a better testing approach that can be done here, but I understand the reasoning.
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 only other mechanism I can think of is to "inject" it through the startOptions struct into startTask.
Any thoughts on which you'd prefer?
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 am comfortable keeping this as is for now, and we can iterate on it before next release. But we can also see if other folks have thoughts.
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.
Thanks for the review!
The following is the coverage report on pkg/.
|
Could you regenerate the manpages? This should resolve the CI issue. |
This parameter lets users specify a local task definition. tkn will then inline that definition in the generated TaskRun, without creating it first. This is useful for "as-code" scenarios and development.
The following is the coverage report on pkg/.
|
/lgtm Thanks, @dlorenc! |
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.
/lgtm
|
||
_ = c.MarkZshCompPositionalArgumentCustom(1, "__tkn_get_task") | ||
|
||
return c | ||
} | ||
|
||
func startTask(opt startOptions, tname string) error { | ||
// Setting as var for stubbing in 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.
ah this is how you do monkey patching in GO :-D
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chmouel 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 |
Changes
This parameter lets users specify a local task definition. tkn will then
inline that definition in the generated TaskRun, without creating it first.
This is useful for "as-code" scenarios and development.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make docs
andmake man
if needed.make check
See the contribution guide
for more details.
Release Notes