Skip to content

Commit

Permalink
Fix: minor documentation issues (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
gailazar300 authored Jun 17, 2021
1 parent 06f7d34 commit f527001
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions artifactory/commands/container/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (pc *PushCommand) Run() error {
if err != nil {
return err
}
// Return if no build name and number was provided
// Return if build-info and detailed summary were not requested.
saveBuildInfo := pc.buildConfiguration.BuildName != "" && pc.buildConfiguration.BuildNumber != ""
if !saveBuildInfo && !pc.IsDetailedSummary() {
return nil
Expand Down Expand Up @@ -103,7 +103,7 @@ func (pc *PushCommand) Run() error {
// Save detailed summary if needed
if pc.IsDetailedSummary() {
if !saveBuildInfo {
// If we saved buildinfo earlier this update already happened.
// If we saved buildinfo earlier, this update already happened.
err = builder.UpdateArtifactsAndDependencies()
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions artifactory/commands/gradle/gradle.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ func (gc *GradleCommand) Run() error {
return err
}
if gc.IsDetailedSummary() {
return gc.UnmarshalDeployableArtifacts(gradleRunConfig.env[utils.DEPLOYABLE_ARTIFACTS])
return gc.unmarshalDeployableArtifacts(gradleRunConfig.env[utils.DEPLOYABLE_ARTIFACTS])
}
return nil
}

func (gc *GradleCommand) UnmarshalDeployableArtifacts(filesPath string) error {
func (gc *GradleCommand) unmarshalDeployableArtifacts(filesPath string) error {
result, err := commandsutils.UnmarshalDeployableArtifacts(filesPath)
if err != nil {
return err
Expand Down Expand Up @@ -172,8 +172,8 @@ func createGradleRunConfig(tasks, configPath string, configuration *utils.BuildC
if err != nil {
return nil, err
}
// Save path to temp file, where deployable artifacts details will be written by Buildinfo project.
if detailedSummary {
// Save the path to a temp file, where buildinfo project will write the deployable artifacts details.
runConfig.env[utils.DEPLOYABLE_ARTIFACTS] = vConfig.Get(utils.DEPLOYABLE_ARTIFACTS).(string)
}

Expand Down
4 changes: 2 additions & 2 deletions artifactory/commands/mvn/mvn.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (mc *MvnCommand) Run() error {
return err
}
if mc.IsDetailedSummary() {
return mc.UnmarshalDeployableArtifacts(mvnRunConfig.deployableArtifactsFilePath)
return mc.unmarshalDeployableArtifacts(mvnRunConfig.deployableArtifactsFilePath)
}
return nil
}
Expand Down Expand Up @@ -255,7 +255,7 @@ func (mc *MvnCommand) createMvnRunConfig(dependenciesPath string) (*mvnRunConfig
}, nil
}

func (mc *MvnCommand) UnmarshalDeployableArtifacts(filesPath string) error {
func (mc *MvnCommand) unmarshalDeployableArtifacts(filesPath string) error {
result, err := commandsutils.UnmarshalDeployableArtifacts(filesPath)
if err != nil {
return err
Expand Down
8 changes: 5 additions & 3 deletions artifactory/commands/utils/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ func (r *Result) SetReader(reader *content.ContentReader) {
r.reader = reader
}

// Reads and pars Deployed artifacts details from a given file.
// The details were written by Buildinfo project while deploying artifacts to maven and gradle repositories.
func UnmarshalDeployableArtifacts(filePath string) (*Result, error) {
modulesMap, err := jsonFileToModulesMap(filePath)
modulesMap, err := unmarshalDeployableArtifactsJson(filePath)
if err != nil {
return nil, err
}
// Iterate map for : counting seccesses/failures & save artifact's SourcePath, TargetPath and Sha256.
// Iterate over the modules map , counting seccesses/failures & save artifact's SourcePath, TargetPath and Sha256.
succeeded, failed := 0, 0
var artifactsArray []clientutils.FileTransferDetails
for _, module := range *modulesMap {
Expand All @@ -67,7 +69,7 @@ func UnmarshalDeployableArtifacts(filePath string) (*Result, error) {
return result, nil
}

func jsonFileToModulesMap(filesPath string) (*map[string][]clientutils.DeployableArtifactDetails, error) {
func unmarshalDeployableArtifactsJson(filesPath string) (*map[string][]clientutils.DeployableArtifactDetails, error) {
// Open the file
jsonFile, err := os.Open(filesPath)
defer jsonFile.Close()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ require (
gopkg.in/yaml.v2 v2.3.0
)

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v0.23.2-0.20210616180824-7e7eb3eace21
replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v0.23.2-0.20210617164909-62762d2bc8b2

replace github.com/jfrog/gocmd => github.com/jfrog/gocmd v0.2.1-0.20210616181221-7159cf844cc3
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ github.com/jfrog/gocmd v0.2.1-0.20210616181221-7159cf844cc3 h1:aBSJVLX1UcUKdCgA+
github.com/jfrog/gocmd v0.2.1-0.20210616181221-7159cf844cc3/go.mod h1:TeZBKJw38D3aKpkIH6tCCztECdhNLIkwHbnCZG8umKE=
github.com/jfrog/gofrog v1.0.6 h1:yUDxSCw8gTK6vC4PvtG0HTnEOQJSZ+O4lWGCgkev1nU=
github.com/jfrog/gofrog v1.0.6/go.mod h1:HkDzg+tMNw23UryoOv0+LB94BzYcl6MCIoz8Tmlb+s8=
github.com/jfrog/jfrog-client-go v0.23.2-0.20210616180824-7e7eb3eace21 h1:xIQYhaugt8Ka6LHZmYibx2Ee9l5jN0UuwcXcldYs3JQ=
github.com/jfrog/jfrog-client-go v0.23.2-0.20210616180824-7e7eb3eace21/go.mod h1:1XMLr/yzslzV9uABPrX4gpA0Bvc51ZX6LRvu/L0WQPc=
github.com/jfrog/jfrog-client-go v0.23.2-0.20210617164909-62762d2bc8b2 h1:OfZ5coJSiENCD/7JOFRYRVcRXtOnRh6c4JgDjlWYncg=
github.com/jfrog/jfrog-client-go v0.23.2-0.20210617164909-62762d2bc8b2/go.mod h1:1XMLr/yzslzV9uABPrX4gpA0Bvc51ZX6LRvu/L0WQPc=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
Expand Down

0 comments on commit f527001

Please sign in to comment.