From 01022fee69f64be4585f7e6e72ac58861565cc08 Mon Sep 17 00:00:00 2001 From: smorihira Date: Mon, 9 Sep 2024 11:37:25 +0900 Subject: [PATCH] fix: delete appendpath funcs --- hack/actions/gen/main.go | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/hack/actions/gen/main.go b/hack/actions/gen/main.go index 9892907bcd3..1f51be97500 100644 --- a/hack/actions/gen/main.go +++ b/hack/actions/gen/main.go @@ -356,36 +356,30 @@ const ( buildkitSyftScanner = "buildkit-syft-scanner" ) -func (data *Data) appendPaths(paths ...string) { - data.PullRequestPaths = append(data.PullRequestPaths, paths...) -} - -func (data *Data) appendComponentsPaths() { +func (data *Data) setPullRequestPaths() { switch data.Name { // the benchmark components trigger each other, not just themselves case benchJob: - data.appendPaths( + data.PullRequestPaths = append(data.PullRequestPaths, cmdBenchOperatorsPath, pkgBenchOperatorsPath, ) case benchOperator: - data.appendPaths( + data.PullRequestPaths = append(data.PullRequestPaths, cmdBenchJobsPath, pkgBenchJobsPath, ) case agentFaiss, agentNgt: - data.appendPaths(agentInternalPath) + data.PullRequestPaths = append(data.PullRequestPaths, agentInternalPath) default: if strings.Contains(strings.ToLower(data.Name), gateway) { - data.appendPaths(gatewayInternalPath) + data.PullRequestPaths = append(data.PullRequestPaths, gatewayInternalPath) } } -} -func (data *Data) appendContainerTypeDependingPaths() { switch data.ContainerType { case HelmOperator: - data.appendPaths( + data.PullRequestPaths = append(data.PullRequestPaths, chartPath, valuesPath, templatesPath, @@ -395,13 +389,13 @@ func (data *Data) appendContainerTypeDependingPaths() { operatorSDKVersionPath, ) case DevContainer, CIContainer: - data.appendPaths( + data.PullRequestPaths = append(data.PullRequestPaths, apisGrpcPath, apisProtoPath, hackPath, ) case Go: - data.appendPaths( + data.PullRequestPaths = append(data.PullRequestPaths, apisGrpcPath, apisProtoPath, goModPath, @@ -415,10 +409,10 @@ func (data *Data) appendContainerTypeDependingPaths() { switch data.Name { case discovererK8s, indexOperator, gatewayMirror, readreplicaRotate, agentNgt, benchJob, benchOperator: default: - data.appendPaths(excludeK8sPath) + data.PullRequestPaths = append(data.PullRequestPaths, excludeK8sPath) } case Rust: - data.appendPaths( + data.PullRequestPaths = append(data.PullRequestPaths, apisGrpcPath, apisProtoPath, cargoLockPath, @@ -433,22 +427,17 @@ func (data *Data) appendContainerTypeDependingPaths() { ) } if strings.EqualFold(data.Name, agentFaiss) || data.ContainerType == Rust { - data.appendPaths(faissVersionPath) + data.PullRequestPaths = append(data.PullRequestPaths, faissVersionPath) } if strings.EqualFold(data.Name, agentNgt) || data.ContainerType == Rust { - data.appendPaths(ngtVersionPath) + data.PullRequestPaths = append(data.PullRequestPaths, ngtVersionPath) } -} - -func (data *Data) setPullRequestPaths() { - data.appendComponentsPaths() - data.appendContainerTypeDependingPaths() if data.Name == agentSidecar { - data.appendPaths(internalStoragePath) + data.PullRequestPaths = append(data.PullRequestPaths, internalStoragePath) } if !data.AliasImage { - data.appendPaths(makefilePath, makefileDirPath) + data.PullRequestPaths = append(data.PullRequestPaths, makefilePath, makefileDirPath) } }