Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Oct 18, 2023
1 parent 12593e3 commit cf88797
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions artifactory/commands/transferfiles/delayedartifactshandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ func consumeDelayFilesIfNoErrors(phase phaseBase, addedDelayFiles []string) erro
return nil
}

func countDelayFilesContent(filePaths []string) (int, int64, error) {
count := 0
var storage int64 = 0
func countDelayFilesContent(filePaths []string) (count int, storage int64, err error) {
for _, file := range filePaths {
delayFile, err := readDelayFile(file)
if err != nil {
Expand All @@ -142,7 +140,7 @@ func countDelayFilesContent(filePaths []string) (int, int64, error) {
storage += delay.Size
}
}
return count, storage, nil
return
}

func handleDelayedArtifactsFiles(filesToConsume []string, base phaseBase, delayUploadComparisonFunctions []shouldDelayUpload) error {
Expand Down
2 changes: 1 addition & 1 deletion artifactory/commands/transferfiles/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func setRepositoryStatus(stateManager *state.TransferStateManager, output *strin
if stateManager.CurrentRepoPhase == api.Phase1 {
addString(output, "🔢", "Phase", "Transferring all files in the repository (1/3)", 3)
} else {
addString(output, "🔢", "Phase", "Retrying transfer failures and deploy delayed files (3/3)", 3)
addString(output, "🔢", "Phase", "Retrying transfer failures and transfer delayed files (3/3)", 3)
}
addString(output, "🗄 ", "Storage", sizeToString(currentRepo.Phase1Info.TransferredSizeBytes)+" / "+sizeToString(currentRepo.Phase1Info.TotalSizeBytes)+calcPercentageInt64(currentRepo.Phase1Info.TransferredSizeBytes, currentRepo.Phase1Info.TotalSizeBytes), 3)
addString(output, "📄", "Files", fmt.Sprintf("%d / %d", currentRepo.Phase1Info.TransferredUnits, currentRepo.Phase1Info.TotalUnits)+calcPercentageInt64(currentRepo.Phase1Info.TransferredUnits, currentRepo.Phase1Info.TotalUnits), 3)
Expand Down
2 changes: 1 addition & 1 deletion artifactory/commands/transferfiles/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestShowBuildInfoRepo(t *testing.T) {
// Check repository status
assert.Contains(t, results, "Current Repository Status")
assert.Contains(t, results, "Name: repo1")
assert.Contains(t, results, "Phase: Retrying transfer failures and deploy delayed files (3/3)")
assert.Contains(t, results, "Phase: Retrying transfer failures and transfer delayed files (3/3)")
assert.Contains(t, results, "Delayed files: 20 (Files to be transferred last, after all other files)")
assert.Contains(t, results, "Storage: 4.9 KiB / 9.8 KiB (50.0%)")
assert.Contains(t, results, "Files: 500 / 10000 (5.0%)")
Expand Down
2 changes: 1 addition & 1 deletion utils/progressbar/transferprogressbarmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
const (
phase1HeadLine = "Phase 1: Transferring all files in the repository"
phase2HeadLine = "Phase 2: Transferring newly created and modified files"
phase3HeadLine = "Phase 3: Retrying transfer failures and deploy delayed files"
phase3HeadLine = "Phase 3: Retrying transfer failures and transfer delayed files"
DelayedFilesContentNote = "Files to be transferred last, after all other files"
RetryFailureContentNote = "In Phase 3 and in subsequent executions, we'll retry transferring the failed files"
)
Expand Down

0 comments on commit cf88797

Please sign in to comment.