From 509e17937bdb8a43ae4828b0aabc0496860fc5ba Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Tue, 14 Nov 2023 14:09:04 -0500 Subject: [PATCH] Address PR feedback for func signature Signed-off-by: Maysun J Faisal --- cdq-analysis/pkg/componentdetectionquery.go | 16 ++++++++-------- codecov.yml | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cdq-analysis/pkg/componentdetectionquery.go b/cdq-analysis/pkg/componentdetectionquery.go index c6e5cf12c..063f6af6c 100644 --- a/cdq-analysis/pkg/componentdetectionquery.go +++ b/cdq-analysis/pkg/componentdetectionquery.go @@ -132,8 +132,9 @@ func clone(k K8sInfoClient, cdqInfo *CDQInfo, namespace, name, context string) e return nil } -// CloneAndAnalyze clones and analyzes the Git repo with Alizer if necessary -func CloneAndAnalyze(k K8sInfoClient, namespace, name, context string, cdqInfo *CDQInfo, cdqUtil CDQUtil) (map[string][]byte, map[string]string, map[string]string, map[string][]int, string, error) { +// CloneAndAnalyze clones and analyzes the Git repo with Alizer if necessary and returns +// devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, revision and an error +func CloneAndAnalyze(k K8sInfoClient, namespace, name, context string, cdqInfo *CDQInfo, cdqUtil CDQUtil) (devfilesMap map[string][]byte, devfilesURLMap map[string]string, dockerfileContextMap map[string]string, componentPortsMap map[string][]int, revision string, err error) { if cdqInfo == nil { return nil, nil, nil, nil, "", fmt.Errorf("CDQ cannot clone and analyze because no information was passed to it") } @@ -141,12 +142,11 @@ func CloneAndAnalyze(k K8sInfoClient, namespace, name, context string, cdqInfo * log := k.Log var clonePath, componentPath string alizerClient := AlizerClient{} - devfilesMap := make(map[string][]byte) - devfilesURLMap := make(map[string]string) - dockerfileContextMap := make(map[string]string) - componentPortsMap := make(map[string][]int) + devfilesMap = make(map[string][]byte) + devfilesURLMap = make(map[string]string) + dockerfileContextMap = make(map[string]string) + componentPortsMap = make(map[string][]int) var Fs afero.Afero - var err error var components []model.Component @@ -178,7 +178,7 @@ func CloneAndAnalyze(k K8sInfoClient, namespace, name, context string, cdqInfo * Fs = cdqInfo.ClonedRepo.Fs componentPath = cdqInfo.ClonedRepo.ComponentPath clonePath = cdqInfo.ClonedRepo.ClonedPath - revision := cdqInfo.GitURL.Revision + revision = cdqInfo.GitURL.Revision devfilePath := cdqInfo.devfilePath dockerfilePath := cdqInfo.dockerfilePath diff --git a/codecov.yml b/codecov.yml index 0ecb5911f..f6512a022 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,7 +5,8 @@ ignore: - "controllers/start_test_env.go" # setup of a test environment for unit and Pact tests - "controllers/application_pact_test_state_handlers.go" # state handlers for the Pact tests - "controllers/application_pact_test_utils.go" # utils file for the Pact tests - - "cdq-analysis/pkg/detect_mock.go" # mock file for testing + - "cdq-analysis/pkg/detect_mock.go" # mock file for testing CDQ detection logic + - "cdq-analysis/pkg/mock.go" # mock file for CDQUtil interface methods - "cdq-analysis/main.go" # entry point for cdq-analysis docker image - "pkg/github/mock.go" # mock file for testing - "pkg/github/token_mock.go" # mock file for testing