-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[TEP-0100] Implementation for embedded TaskRun and Run statuses in PipelineRuns #4739
Conversation
The following is the coverage report on the affected files.
|
/retest |
The following is the coverage report on the affected files.
|
test/v1alpha1/retry_test.go
Outdated
@@ -44,6 +48,9 @@ func TestTaskRunRetry(t *testing.T) { | |||
knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) | |||
defer tearDown(ctx, t, c, namespace) | |||
|
|||
// Skip if the "embedded-status" feature flag has any value but "full". |
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 comment appears stale
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.
Nope, that's still relevant in my mind - v1alpha1
should, in theory, always be full
. Though in practice because of how we have the type aliases set up, I guess you could mess around there. Eh, I'm fine either way.
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.
either way makes sense, but the comment here doesn't reflect the code.
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.
Oy, duh, fixed. =)
pkg/reconciler/pipelinerun/cancel.go
Outdated
// If pr.Status.ChildReferences is populated, use that as source of truth for TaskRun and Run names. | ||
if len(pr.Status.ChildReferences) > 0 { | ||
// Loop over the ChildReferences in the PipelineRun status. | ||
for _, cr := range pr.Status.ChildReferences { |
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 might prefer a helper function which returns the runs and taskruns to cancel based on the embedded status value.
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.
Lemme see what I can do here.
|
||
return nil | ||
} | ||
|
||
func updatePipelineRunStatusFromTaskRuns(logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, trs []*v1beta1.TaskRun) { | ||
func updatePipelineRunStatusFromSlices(ctx context.Context, logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, taskRuns []*v1beta1.TaskRun, runs []*v1alpha1.Run) { |
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.
nit: could this function be updatePipelineRunStatusFromChildObjects
? IMO including things like "slices" in variable names can be redundant
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.
Good idea! I did not like the name but couldn't think of a better one.
if fullEmbedded { | ||
updatePipelineRunStatusFromTaskRuns(logger, pr, taskRuns, taskNameByPipelineTask) | ||
updatePipelineRunStatusFromRuns(logger, pr, runs) | ||
} else { |
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 don't think this else block should be necessary. If something depends on these values being non-nil let's change that code instead of initializing these.
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.
Lemme see how much breaks if we don't initialize 'em.
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.
Huh, nothing but tests - nice!
// updatePipelineRunStatusFromTaskRuns takes a PipelineRun, a list of TaskRuns within that PipelineRun, and a map of | ||
// existing PipelineTask names to TaskRun (or Run) names, and updates the PipelineRun's .Status.TaskRuns, including | ||
// ensuring that any (deprecated) condition checks are represented. | ||
func updatePipelineRunStatusFromTaskRuns(logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, trs []*v1beta1.TaskRun, taskRunNameByPipelineTask map[string]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.
this function should be able to stay the same, no? (except for the small change removing the nil check for trs which I asked for :) )
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 changes here are either minor cleanup/renames (I really didn't like the taskrun
variable name - I twitch when I see a variable name overriding an imported package name!), necessary signature changes, or the condition check changes with getNewConditionChecksForTaskRun
. That said, I'll unrename things and clean up one or two inadvertent changes I made.
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.
cleanup changes are great! I think they belong in a separate PR though
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.
At this point there's just the one bit of cleanup left - switching if trs == nil || len(trs) == 0 {
to if len(trs) == 0 {
.
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.
(oops accidentally hit resolve!)
for _, tr := range trs { | ||
// Only process TaskRuns that are owned by this PipelineRun. | ||
// This skips TaskRuns that are indirectly created by the PipelineRun (e.g. by custom tasks). | ||
if len(tr.OwnerReferences) < 1 || tr.OwnerReferences[0].UID != pr.ObjectMeta.UID { |
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 block is repeated in a few places, can it be reused?
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.
It shows up twice for TaskRun
and twice for Run
- not sure if it's worth doing that as two functions, but I'm open to it.
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.
these two functions in general share a lot of code, could you experiment to see how it can be consolidated?
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.
Lemme see.
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.
So fwiw on this particular block, I just tried going with a helper function or two (i.e., either one function each for TaskRun
and Run
, or one generic one with a type switch
) and it didn't really make things any clearer, since we still have to have a block here for the continue
. I'm still seeing if there are any other shared bits I can consolidate, but this particular one doesn't feel worth doing.
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.
Actually, turns out that once I decided to try doing the filtering of condition
TaskRun
s before entering the main loop, I saw the obvious and realized that we could just filter out the "not owned by this PipelineRun
" TaskRun
s and Run
s before entering the main loop as well. 🤦 =) How does 6c8d615 look?
actualPrStatus.ChildReferences = fixedChildRefs | ||
} | ||
|
||
// Sort the ChildReferences to deal with annoying ordering issues. |
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.
rather than sorting the output, I think you can provide extra inputs/flags to cmp.Diff to get it to ignore ordering of some fields.
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.
Oh yeaaaah - I just cargo-culted that over from the original ...FromTaskRuns
test blindly.
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.
And actually, I'm not sure if cmpopts.SortSlices
would make much of a difference here - it'd just be moving the same code around to be a parameter rather than standing alone...
@@ -585,7 +594,13 @@ func getConditionCheckName(taskRunStatus map[string]*v1beta1.PipelineRunTaskRunS | |||
} | |||
|
|||
// GetTaskRunName should return a unique name for a `TaskRun` if one has not already been defined, and the existing one otherwise. | |||
func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus, ptName, prName string) string { | |||
func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus, childRefs []v1beta1.ChildStatusReference, ptName, prName string) 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.
super nit: I think you can import and use constants for the kind
of Run and TaskRun (here and elsewhere in the PR)
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 swear that I couldn't figure out where to find that to import. Maybe I missed something?
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.
they're here but actually on second thought importing and using the controller name is a bit weird :/
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.
Oh right, I did look at that and decided it felt too squirelly - I don't quite trust that the controller names are always going to be guaranteed to map one to one with the kind
s. Feels like it might be worthwhile to add constants specifically for the kind
name somewhere...
if len(pr.Status.Runs) != 2 { | ||
t.Fatalf("PipelineRun had unexpected .status.runs; got %d, want 2", len(pr.Status.Runs)) | ||
var runNames []string | ||
if embeddedStatusValue != config.MinimalEmbeddedStatus { |
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 think the branches are off here, you probably want
if embeddedStatusValue != config.MinimalEmbeddedStatus {}
if embeddedStatusValue != config.FullEmbeddedStatus{}
both here and below (ensuring config.BothEmbeddedStatus is tested correctly)
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.
Good catch!
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.
same thing on line 218 and in custom_task_test
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.
Well I feel a silly man. Fixed.
test/featureflags.go
Outdated
|
||
// GetEmbeddedStatusValue gets the current value for the "embedded-status" feature flag. | ||
// If the flag is not set, it returns the default value. | ||
func GetEmbeddedStatusValue(ctx context.Context, t *testing.T, kubeClient kubernetes.Interface) 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.
super nit: this function can just be called "getEmbeddedStatus"
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 following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
len(prs.ChildReferences)) | ||
} | ||
|
||
for _, cr := range prs.ChildReferences { |
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 adding this function! just a few quick comments:
- I would collect the names of child refs not in taskruns/runs and return an error containing all of them; this is more informative
- make sure you're handling the case where childRef isn't a taskrun or a run
- please add some tests for this function
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.
👍 on all of that!
|
||
return nil | ||
} | ||
|
||
func updatePipelineRunStatusFromTaskRuns(logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, trs []*v1beta1.TaskRun) { | ||
func updatePipelineRunStatusFromSlices(ctx context.Context, logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, taskRuns []*v1beta1.TaskRun, runs []*v1alpha1.Run) { | ||
taskNameByPipelineTask := make(map[string]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.
got it-- any way to factor out the condition checks and pass them into the updatePipelineRunStatus
functions? it seems like the updatePipelineRunStatus
functions could be made more modular: they should just take some info and use it to update the PR status, without having to return data that will be used in other updates
for _, tr := range trs { | ||
// Only process TaskRuns that are owned by this PipelineRun. | ||
// This skips TaskRuns that are indirectly created by the PipelineRun (e.g. by custom tasks). | ||
if len(tr.OwnerReferences) < 1 || tr.OwnerReferences[0].UID != pr.ObjectMeta.UID { |
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.
these two functions in general share a lot of code, could you experiment to see how it can be consolidated?
@@ -585,7 +594,13 @@ func getConditionCheckName(taskRunStatus map[string]*v1beta1.PipelineRunTaskRunS | |||
} | |||
|
|||
// GetTaskRunName should return a unique name for a `TaskRun` if one has not already been defined, and the existing one otherwise. | |||
func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus, ptName, prName string) string { | |||
func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus, childRefs []v1beta1.ChildStatusReference, ptName, prName string) 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.
they're here but actually on second thought importing and using the controller name is a bit weird :/
if len(pr.Status.Runs) != 2 { | ||
t.Fatalf("PipelineRun had unexpected .status.runs; got %d, want 2", len(pr.Status.Runs)) | ||
var runNames []string | ||
if embeddedStatusValue != config.MinimalEmbeddedStatus { |
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.
same thing on line 218 and in custom_task_test
test/v1alpha1/retry_test.go
Outdated
@@ -44,6 +48,9 @@ func TestTaskRunRetry(t *testing.T) { | |||
knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) | |||
defer tearDown(ctx, t, c, namespace) | |||
|
|||
// Skip if the "embedded-status" feature flag has any value but "full". |
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.
either way makes sense, but the comment here doesn't reflect the code.
The following is the coverage report on the affected files.
|
/retest |
/hold Since I'm not squashing as I go, I'm putting this on hold until I get the thumbs-up for the whole PR and then squashing. |
The following is the coverage report on the affected files.
|
pkg/reconciler/pipelinerun/cancel.go
Outdated
@@ -122,6 +127,45 @@ func cancelPipelineTaskRuns(ctx context.Context, logger *zap.SugaredLogger, pr * | |||
return errs | |||
} | |||
|
|||
// getChildObjectsToCancel looks in the PipelineRunStatus for TaskRun and Run names to cancel. It looks in |
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.
nit: this function comment describes the implementation, and the name describes how the function will be used.
I'd prefer something like:
// getChildObjects returns taskruns and runs owned by the pipelineRun, based on the value of the embedded status flag.
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 renaming it to filterChildObjectsFromPRStatus
.
pkg/reconciler/pipelinerun/cancel.go
Outdated
// Loop over the TaskRuns in the PipelineRun status. | ||
// If a TaskRun is not in the status yet we should not cancel it anyways. | ||
for taskRunName := range pr.Status.TaskRuns { | ||
trNames, runNames, err := getChildObjectsToCancel(ctx, pr.Status) |
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 looking much better! :)
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.
hooray! =)
pipelineRun: &v1beta1.PipelineRun{ | ||
ObjectMeta: metav1.ObjectMeta{Name: "test-pipeline-run-cancelled"}, | ||
Spec: v1beta1.PipelineRunSpec{ | ||
Status: v1beta1.PipelineRunSpecStatusCancelledDeprecated, | ||
}, | ||
}, | ||
}, { | ||
name: "child-references", | ||
embeddedStatus: config.BothEmbeddedStatus, |
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 please add a test case for minimal embedded status?
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.
👍
return nil | ||
updatePipelineRunStatusFromChildObjects(ctx, logger, pr, taskRuns, runs) | ||
|
||
return validateChildObjectsInPipelineRunStatus(ctx, pr.Status) |
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 think this function call should be moved to updatePipelineRunStatusFromChildObjects
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.
👍
|
||
return nil | ||
} | ||
|
||
func updatePipelineRunStatusFromTaskRuns(logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, trs []*v1beta1.TaskRun) { | ||
func updatePipelineRunStatusFromSlices(ctx context.Context, logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, taskRuns []*v1beta1.TaskRun, runs []*v1alpha1.Run) { | ||
taskNameByPipelineTask := make(map[string]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.
maybe a better pattern here could be one function for minimal embedded status, one function for full embedded status, and one function for both embedded status which calls both of the first two. I think this way none of them should need to return anything. thoughts?
The following is the coverage report on the affected files.
|
/retest |
The following is the coverage report on the affected files.
|
/retest |
d := test.Data{ | ||
PipelineRuns: []*v1beta1.PipelineRun{tc.pipelineRun}, | ||
TaskRuns: tc.taskRuns, | ||
Runs: tc.runs, | ||
} | ||
ctx, _ := ttesting.SetupFakeContext(t) | ||
cfg := config.NewStore(logtesting.TestLogger(t)) |
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.
what's this for?
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, there's a line further down that needs to be removed. We need the context to be populated with the feature flags, hence this bit.
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.
Oh, no, the later line is fine. Yeah, so what I said above. =)
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 think you can just do cfg := withCustomTasks(withEmbeddedStatus(newFeatureFlagsConfigMap(), tc.embeddedStatus))
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.
That creates a ConfigMap
, but not a *config.Store
, which is what we need to call cfg.ToContext(ctx)
. I tried hand-crafting a context.Context
so I could skip the *config.Store
in between, but couldn't make it work right for config.FromContextOrDefaults(ctx)
to pick it up properly.
} | ||
if r.IsDone() { | ||
t.Fatalf("Run unexpectedly done: %v", r.Status.GetCondition(apis.ConditionSucceeded)) | ||
for rn := range pr.Status.Runs { |
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 a bit confused, what's going on here?
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.
We need the run name later in the test.
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.
oh I see, the slice has length 1-- in that case pr.Status.Runs[0] is more clear
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, right, I tried to do that, but pr.Status.Runs
is a map, so pr.Status.Runs[0]
isn't an option.
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
} | ||
if r.IsDone() { | ||
t.Fatalf("Run unexpectedly done: %v", r.Status.GetCondition(apis.ConditionSucceeded)) | ||
for rn := range pr.Status.Runs { |
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.
oh I see, the slice has length 1-- in that case pr.Status.Runs[0] is more clear
d := test.Data{ | ||
PipelineRuns: []*v1beta1.PipelineRun{tc.pipelineRun}, | ||
TaskRuns: tc.taskRuns, | ||
Runs: tc.runs, | ||
} | ||
ctx, _ := ttesting.SetupFakeContext(t) | ||
cfg := config.NewStore(logtesting.TestLogger(t)) |
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 think you can just do cfg := withCustomTasks(withEmbeddedStatus(newFeatureFlagsConfigMap(), tc.embeddedStatus))
c934e21
to
af6055a
Compare
7990ce4
to
ce12e81
Compare
/hold cancel Ok, hopefully this is the final form. =) |
/retest |
1 similar comment
/retest |
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
/retest |
1 similar comment
/retest |
If build tests are failing this seems unlikely to be a flake? |
the |
/retest |
The following is the coverage report on the affected files.
|
cc @tektoncd/core-maintainers - I'd be extremely grateful for a final review/approve (well, assuming it's approval-worthy!), so I can finally get TEP-0100 put to bed for once and for all. =) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
Hello, thank you all so much for this feature. How do I enable this feature? Should I add the flag in my pipelinerun? Do you have an example? |
Thanks a lot for the respond @lbernick |
@lbernick I don't think I am subscribed to an email. Could you tell me when is the release date? |
Please make sure you are subscribed to https://groups.google.com/g/tekton-users; we just sent out an email update (thanks for the reminder!) This release is scheduled for the 25th. |
With tektoncd#4739 merged and the v0.35.0 release coming up, it's time to update the deprecations table. The plan is to switch the default value for `embedded-status` to `minimal` 9 months after the release of v0.35.0, and then remove the `full` and `both` values in the following release. I opted to use the date for changing the default as the "earliest date of removal" here. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
With #4739 merged and the v0.35.0 release coming up, it's time to update the deprecations table. The plan is to switch the default value for `embedded-status` to `minimal` 9 months after the release of v0.35.0, and then remove the `full` and `both` values in the following release. I opted to use the date for changing the default as the "earliest date of removal" here. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
With tektoncd#4739 merged and the v0.35.0 release coming up, it's time to update the deprecations table. The plan is to switch the default value for `embedded-status` to `minimal` 9 months after the release of v0.35.0, and then remove the `full` and `both` values in the following release. I opted to use the date for changing the default as the "earliest date of removal" here. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
This comes out of discussions on tektoncd#4739 - with the new minimal embedded status changes which will be introduced in that PR, we can see that we're currently using the output of `pipelineRunFacts.State.GetTaskRunsStatus(pr)` and `pipelineRunFacts.State.GetRunsStatus(pr)` for two separate purposes: * To set `pr.Status.TaskRuns` and `pr.Status.Runs` with the full embedded status * To pass to `resources.ApplyTaskResultsToPipelineResults` for populating results It's understandable why `ApplyTaskResultsToPipelineResults` is using the maps from `pr.Status.[TaskRuns|Runs]`, since those maps do contain everything needed for propagating results up from the tasks to the pipeline run, but if you look at the current implementation, you can see that it's shuffling the maps around into a different form that's more suited for what it's doing than the original form. So this PR reworks `ApplyTaskResultsToPipelineResults` to instead take maps in the form the current implementation uses internally, with new functions on `PipelineRunState` to get these new maps without needing to use the `pr.Status.[TaskRuns|Runs]` form as an intermediary. This makes the pre-minimal-embedded-status implementation cleaner, and is particularly helpful in that regard once we do have minimal embedded status in place. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
…d status This builds on tektoncd#4694, tektoncd#4734, and tektoncd#4753. It will feed into a revamped tektoncd#4739, all as part of https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md and tektoncd#3140. Specifically, this adds functionality to `pkg/reconciler/pipelinerun/resources` in `pipelinerunresolution.go` and `pipelinerunstate.go` which will be needed for the full implementation. These changes won't have any effects in the current situation, because `pr.Status.ChildReferences` is never populated, so can be made independently of the rest of the implementation, thus also shrinking the size of the rest of the implementation PR(s) for easier review. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
With tektoncd#4739 merged and the v0.35.0 release coming up, it's time to update the deprecations table. The plan is to switch the default value for `embedded-status` to `minimal` 9 months after the release of v0.35.0, and then remove the `full` and `both` values in the following release. I opted to use the date for changing the default as the "earliest date of removal" here. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Changes
See:
updatePipelineRunStatusFromChildRefs
function #4760This implements TEP-0100, allowing for choosing between the original full embedded
TaskRun
andRun
statuses inPipelineRun
statuses, minimal child references to the underlyingTaskRun
andRun
s, or both, building on top of all the other PRs referenced above./kind tep
/kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes