Skip to content

Commit

Permalink
Address PR feedback for func signature
Browse files Browse the repository at this point in the history
Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
  • Loading branch information
maysunfaisal committed Nov 14, 2023
1 parent 59d3338 commit 509e179
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cdq-analysis/pkg/componentdetectionquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,21 @@ 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")
}

Check warning on line 140 in cdq-analysis/pkg/componentdetectionquery.go

View check run for this annotation

Codecov / codecov/patch

cdq-analysis/pkg/componentdetectionquery.go#L139-L140

Added lines #L139 - L140 were not covered by tests

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

Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 509e179

Please sign in to comment.