@@ -489,6 +489,118 @@ func TestTaskRun(t *testing.T) {
489489 },
490490 },
491491 },
492+ {
493+ name : "resolvedDependencies from remote StepAction" ,
494+ obj : objects .NewTaskRunObjectV1 (& v1.TaskRun {
495+ Status : v1.TaskRunStatus {
496+ TaskRunStatusFields : v1.TaskRunStatusFields {
497+ Steps : []v1.StepState {
498+ {
499+ Name : "remote-build" ,
500+ ImageID : "gcr.io/test/build@sha256:aaa111" ,
501+ Provenance : & v1.Provenance {
502+ RefSource : & v1.RefSource {
503+ URI : "git+https://github.com/tektoncd/stepactions" ,
504+ Digest : map [string ]string {"sha256" : "bbb222" },
505+ },
506+ },
507+ },
508+ },
509+ },
510+ },
511+ }),
512+ want : []* intoto.ResourceDescriptor {
513+ {
514+ Uri : "oci://gcr.io/test/build" ,
515+ Digest : common.DigestSet {"sha256" : "aaa111" },
516+ },
517+ {
518+ Name : "stepAction/remote-build" ,
519+ Uri : "git+https://github.com/tektoncd/stepactions" ,
520+ Digest : common.DigestSet {"sha256" : "bbb222" },
521+ },
522+ },
523+ },
524+ {
525+ name : "local StepAction excluded from resolvedDependencies" ,
526+ obj : objects .NewTaskRunObjectV1 (& v1.TaskRun {
527+ Status : v1.TaskRunStatus {
528+ TaskRunStatusFields : v1.TaskRunStatusFields {
529+ Steps : []v1.StepState {
530+ {
531+ Name : "local-step" ,
532+ ImageID : "gcr.io/test/local@sha256:ccc333" ,
533+ },
534+ },
535+ },
536+ },
537+ }),
538+ want : []* intoto.ResourceDescriptor {
539+ {
540+ Uri : "oci://gcr.io/test/local" ,
541+ Digest : common.DigestSet {"sha256" : "ccc333" },
542+ },
543+ },
544+ },
545+ {
546+ name : "multiple remote StepActions produce distinct resolvedDependencies" ,
547+ obj : objects .NewTaskRunObjectV1 (& v1.TaskRun {
548+ Status : v1.TaskRunStatus {
549+ TaskRunStatusFields : v1.TaskRunStatusFields {
550+ Steps : []v1.StepState {
551+ {
552+ Name : "git-clone" ,
553+ ImageID : "gcr.io/test/git@sha256:aaa111" ,
554+ Provenance : & v1.Provenance {
555+ RefSource : & v1.RefSource {
556+ URI : "git+https://github.com/tektoncd/stepactions" ,
557+ Digest : map [string ]string {"sha256" : "step1digest" },
558+ },
559+ },
560+ },
561+ {
562+ Name : "build" ,
563+ ImageID : "gcr.io/test/build@sha256:bbb222" ,
564+ Provenance : & v1.Provenance {
565+ RefSource : & v1.RefSource {
566+ URI : "git+https://github.com/tektoncd/stepactions" ,
567+ Digest : map [string ]string {"sha256" : "step2digest" },
568+ },
569+ },
570+ },
571+ {
572+ Name : "local-lint" ,
573+ ImageID : "gcr.io/test/lint@sha256:ccc333" ,
574+ },
575+ },
576+ },
577+ },
578+ }),
579+ want : []* intoto.ResourceDescriptor {
580+ {
581+ Uri : "oci://gcr.io/test/git" ,
582+ Digest : common.DigestSet {"sha256" : "aaa111" },
583+ },
584+ {
585+ Uri : "oci://gcr.io/test/build" ,
586+ Digest : common.DigestSet {"sha256" : "bbb222" },
587+ },
588+ {
589+ Uri : "oci://gcr.io/test/lint" ,
590+ Digest : common.DigestSet {"sha256" : "ccc333" },
591+ },
592+ {
593+ Name : "stepAction/git-clone" ,
594+ Uri : "git+https://github.com/tektoncd/stepactions" ,
595+ Digest : common.DigestSet {"sha256" : "step1digest" },
596+ },
597+ {
598+ Name : "stepAction/build" ,
599+ Uri : "git+https://github.com/tektoncd/stepactions" ,
600+ Digest : common.DigestSet {"sha256" : "step2digest" },
601+ },
602+ },
603+ },
492604 }
493605 for _ , tc := range tests {
494606 t .Run (tc .name , func (t * testing.T ) {
0 commit comments