Skip to content

Commit f7d0ae7

Browse files
committed
Improve upload archive progress bar
Signed-off-by: Michael Sverdlov <[email protected]>
1 parent 8182394 commit f7d0ae7

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

artifactory/commands/dotnet/dotnetcommand.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ func GetConfigPathFromEnvIfProvided(cmdType dotnet.ToolchainType) string {
226226
return filepath.Join(customDotnetDir, "NuGet.Config")
227227
}
228228
}
229+
// The NUGET_CONFIG_FILE environment variable is supported by both NuGet and dotnet CLI.
229230
return os.Getenv("NUGET_CONFIG_FILE")
230231
}
231232

artifactory/commands/setup/setup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ func (sc *SetupCommand) Run() (err error) {
124124
return errorutils.CheckErrorf("unsupported package manager: %s", sc.packageManager)
125125
}
126126

127-
if sc.repoName == "" {
127+
// If the repository name is not provided, and the package manager is not Docker or Podman, prompt the user to select a repository.
128+
// Docker and Podman do not require a repository name.
129+
if sc.repoName == "" && sc.packageManager != project.Docker && sc.packageManager != project.Podman {
128130
// Prompt the user to select a virtual repository that matches the package manager.
129131
if err = sc.promptUserToSelectRepository(); err != nil {
130132
return err
@@ -170,7 +172,7 @@ func (sc *SetupCommand) promptUserToSelectRepository() (err error) {
170172
sc.repoName, err = utils.SelectRepositoryInteractively(
171173
sc.serverDetails,
172174
repoFilterParams,
173-
fmt.Sprintf("To configure %s, we need you to select a %s repository in Artifactory", repoFilterParams.PackageType, repoFilterParams.RepoType))
175+
fmt.Sprintf("To configure %s, we need you to select a %s repository in Artifactory:", repoFilterParams.PackageType, repoFilterParams.RepoType))
174176

175177
return err
176178
}
@@ -248,8 +250,6 @@ func (sc *SetupCommand) configureNpmPnpm() error {
248250
// For basic auth:
249251
//
250252
// yarn config set //your-artifactory-url/artifactory/api/npm/<repo-name>/:_auth "<base64-encoded-username:password>"
251-
//
252-
// Note: Custom configuration file can be set by setting the YARN_RC_FILENAME environment variable.
253253
func (sc *SetupCommand) configureYarn() (err error) {
254254
repoUrl := commandsutils.GetNpmRepositoryUrl(sc.repoName, sc.serverDetails.ArtifactoryUrl)
255255
if err = yarn.ConfigSet(commandsutils.NpmConfigRegistryKey, repoUrl, "yarn", false); err != nil {

artifactory/commands/setup/setup_test.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,17 @@ func TestSetupCommand_Pnpm(t *testing.T) {
6767
}
6868

6969
func testSetupCommandNpmPnpm(t *testing.T, packageManager project.ProjectType) {
70-
// Create a temporary directory to act as the environment's npmrc file location.
71-
tempDir := t.TempDir()
72-
npmrcFilePath := filepath.Join(tempDir, ".npmrc")
73-
74-
// Set NPM_CONFIG_USERCONFIG to point to the temporary npmrc file path.
75-
t.Setenv("NPM_CONFIG_USERCONFIG", npmrcFilePath)
76-
77-
loginCmd := createTestSetupCommand(packageManager)
78-
7970
for _, testCase := range testCases {
8071
t.Run(testCase.name, func(t *testing.T) {
72+
// Create a temporary directory to act as the environment's npmrc file location.
73+
tempDir := t.TempDir()
74+
npmrcFilePath := filepath.Join(tempDir, ".npmrc")
75+
76+
// Set NPM_CONFIG_USERCONFIG to point to the temporary npmrc file path.
77+
t.Setenv("NPM_CONFIG_USERCONFIG", npmrcFilePath)
78+
8179
// Set up server details for the current test case's authentication type.
80+
loginCmd := createTestSetupCommand(packageManager)
8281
loginCmd.serverDetails.SetUser(testCase.user)
8382
loginCmd.serverDetails.SetPassword(testCase.password)
8483
loginCmd.serverDetails.SetAccessToken(testCase.accessToken)

artifactory/utils/container/containermanager.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ func ContainerManagerLogin(imageRegistry string, config *ContainerManagerLoginCo
194194
password := config.ServerDetails.Password
195195
// If access-token exists, perform login with it.
196196
if config.ServerDetails.AccessToken != "" {
197-
log.Debug("Using access-token details in " + containerManager.String() + "-login command.")
198197
if username == "" {
199198
username = auth.ExtractUsernameFromAccessToken(config.ServerDetails.AccessToken)
200199
}

0 commit comments

Comments
 (0)