@@ -6,6 +6,7 @@ package runtime
66
77import (
88 "context"
9+ "fmt"
910 "io"
1011
1112 "github.com/docker/docker/client"
@@ -68,14 +69,20 @@ func (e *StepExecutorStateless) executeStep( //nolint:gocritic
6869 return engine .RunStep (ctx , engine.Opts {Opts : docker.Opts {DockerClient : dockerClient }}, step , output , cfg , isDrone , isHosted )
6970 }
7071 // Temporary: this should be removed once we have a better way of handling test intelligence.
71- tiConfig := getTiCfg (& r .TIConfig , & r .MtlsConfig )
72+ tiConfig := getTiCfg (& r .TIConfig , & r .MtlsConfig , r . Envs )
7273
7374 r .DeleteTempStepFiles = true
7475 return executeStepHelper (ctx , r , runFunc , writer , & tiConfig )
7576}
7677
77- func getTiCfg (t * api.TIConfig , mtlsConfig * spec.MtlsConfig ) tiCfg.Cfg {
78+ func getTiCfg (t * api.TIConfig , mtlsConfig * spec.MtlsConfig , envs map [string ]string ) tiCfg.Cfg {
79+ // Extract parent unique ID from environment variables
80+ parentUniqueID := ""
81+ if envs != nil {
82+ parentUniqueID = envs ["HARNESS_PARENT_UNIQUE_ID" ]
83+ }
84+ fmt .Println ("Parent Unique ID: " , parentUniqueID )
7885 cfg := tiCfg .New (t .URL , t .Token , t .AccountID , t .OrgID , t .ProjectID , t .PipelineID , t .BuildID , t .StageID , t .Repo ,
79- t .Sha , t .CommitLink , t .SourceBranch , t .TargetBranch , t .CommitBranch , pipeline .SharedVolPath , t .ParseSavings , false , mtlsConfig .ClientCert , mtlsConfig .ClientCertKey )
86+ t .Sha , t .CommitLink , t .SourceBranch , t .TargetBranch , t .CommitBranch , pipeline .SharedVolPath , parentUniqueID , t .ParseSavings , false , mtlsConfig .ClientCert , mtlsConfig .ClientCertKey )
8087 return cfg
8188}
0 commit comments