Skip to content

Commit

Permalink
Remove predicate.buildConfig.tasks[i].ref field
Browse files Browse the repository at this point in the history
Related to tektoncd#436 (comment).

Prior, pipeline level provenance had a `ref` field in the `predicate.buildConfig`
section.

In this commit, we remove this `ref` field from buildconfig in favor of `buildConfig.tasks[i].invocation.configSource`
tektoncd#554 because configsource should be enough
to record the source information that we need to track the origin of the remote definitions.

Since `predicate.buildConfig` is pretty much free text, this deletion shouldn't
introduce backward incompatible changes.

Signed-off-by: Chuang Wang <chuangw@google.com>
  • Loading branch information
chuangw6 committed Nov 28, 2022
1 parent 40b43e9 commit d6f0d66
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 52 deletions.
32 changes: 8 additions & 24 deletions pkg/chains/formats/intotoite6/intotoite6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,8 @@ func TestPipelineRunCreatePayload(t *testing.T) {
BuildConfig: pipelinerun.BuildConfig{
Tasks: []pipelinerun.TaskAttestation{
{
Name: "git-clone",
After: nil,
Ref: v1beta1.TaskRef{
Name: "git-clone",
Kind: "ClusterTask",
},
Name: "git-clone",
After: nil,
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down Expand Up @@ -219,12 +215,8 @@ func TestPipelineRunCreatePayload(t *testing.T) {
},
},
{
Name: "build",
After: []string{"git-clone"},
Ref: v1beta1.TaskRef{
Name: "build",
Kind: "ClusterTask",
},
Name: "build",
After: []string{"git-clone"},
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down Expand Up @@ -360,12 +352,8 @@ func TestPipelineRunCreatePayloadChildRefs(t *testing.T) {
BuildConfig: pipelinerun.BuildConfig{
Tasks: []pipelinerun.TaskAttestation{
{
Name: "git-clone",
After: nil,
Ref: v1beta1.TaskRef{
Name: "git-clone",
Kind: "ClusterTask",
},
Name: "git-clone",
After: nil,
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down Expand Up @@ -407,12 +395,8 @@ func TestPipelineRunCreatePayloadChildRefs(t *testing.T) {
},
},
{
Name: "build",
After: []string{"git-clone"},
Ref: v1beta1.TaskRef{
Name: "build",
Kind: "ClusterTask",
},
Name: "build",
After: []string{"git-clone"},
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down
4 changes: 0 additions & 4 deletions pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ func buildConfig(pro *objects.PipelineRunObject, logger *zap.SugaredLogger) Buil
Results: tr.Status.TaskRunResults,
}

if t.TaskRef != nil {
task.Ref = *t.TaskRef
}

tasks = append(tasks, task)
if i < len(pSpec.Tasks) {
last = task.Name
Expand Down
32 changes: 8 additions & 24 deletions pkg/chains/formats/intotoite6/pipelinerun/provenance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@ func TestBuildConfig(t *testing.T) {
expected := BuildConfig{
Tasks: []TaskAttestation{
{
Name: "git-clone",
After: nil,
Ref: v1beta1.TaskRef{
Name: "git-clone",
Kind: "ClusterTask",
},
Name: "git-clone",
After: nil,
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down Expand Up @@ -123,12 +119,8 @@ func TestBuildConfig(t *testing.T) {
},
},
{
Name: "build",
After: []string{"git-clone"},
Ref: v1beta1.TaskRef{
Name: "build",
Kind: "ClusterTask",
},
Name: "build",
After: []string{"git-clone"},
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down Expand Up @@ -252,12 +244,8 @@ func TestBuildConfigTaskOrder(t *testing.T) {
expected := BuildConfig{
Tasks: []TaskAttestation{
{
Name: "git-clone",
After: nil,
Ref: v1beta1.TaskRef{
Name: "git-clone",
Kind: "ClusterTask",
},
Name: "git-clone",
After: nil,
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down Expand Up @@ -299,12 +287,8 @@ func TestBuildConfigTaskOrder(t *testing.T) {
},
},
{
Name: "build",
After: []string{"git-clone"},
Ref: v1beta1.TaskRef{
Name: "build",
Kind: "ClusterTask",
},
Name: "build",
After: []string{"git-clone"},
StartedOn: e1BuildStart,
FinishedOn: e1BuildFinished,
Status: "Succeeded",
Expand Down

0 comments on commit d6f0d66

Please sign in to comment.