Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package manager login command - Docker, Podman #1304

Merged
merged 66 commits into from
Dec 28, 2024

Conversation

sverdlov93
Copy link
Contributor

@sverdlov93 sverdlov93 commented Nov 20, 2024

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

  • Added Docker and Podman to Package Manager login command
  • Added projectKey filter support.
  • Some small improvements for interactive quiestionire

sverdlov93 and others added 30 commits October 25, 2024 18:11
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
…m-login

# Conflicts:
#	artifactory/commands/python/python.go
#	artifactory/commands/python/utils_test.go
#	common/cliutils/utils.go
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
@sverdlov93 sverdlov93 requested a review from eyalbe4 November 28, 2024 15:12
@yahavi yahavi self-requested a review December 24, 2024 10:35
Copy link
Member

@yahavi yahavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sverdlov93
Before I dive into the code, please add the following:

  • Pull Request Description - It's essential to have a description as it helps me understand the author's intent. Comparing the description with the code allows me to identify potential bugs.
  • Unit Tests - This pull request introduces non-trivial code, and it's difficult to ascertain its correctness without some basic tests in place.

Thanks! 🙏🏼

Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
Copy link
Member

@yahavi yahavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Well done!
Please consider my comments.

Comment on lines +76 to +78
slices.SortFunc(allSupportedPackageManagers, func(a, b project.ProjectType) int {
return int(a) - int(b)
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slices.SortFunc(allSupportedPackageManagers, func(a, b project.ProjectType) int {
return int(a) - int(b)
})
slices.Sort(allSupportedPackageManagers)

Also - what is the reason for the sorting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to show the interactive list according to the order I prefer, npm near yarn, docker near podman and etc
@yahavi

Comment on lines +72 to +80
// GetSupportedPackageManagersList returns a sorted list of supported package managers.
func GetSupportedPackageManagersList() []project.ProjectType {
allSupportedPackageManagers := maps.Keys(packageManagerToRepositoryPackageType)
// Sort keys based on their natural enum order
slices.SortFunc(allSupportedPackageManagers, func(a, b project.ProjectType) int {
return int(a) - int(b)
})
return allSupportedPackageManagers
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is unused in the jfrog-cli-core. Is this code intended to be used in other libraries?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jfrog-cli @yahavi

common/project/projectconfig.go Outdated Show resolved Hide resolved
}

func (projectType ProjectType) String() string {
return ProjectTypes[projectType]
}

// FromString converts a string to its corresponding ProjectType
func FromString(value string) ProjectType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this function used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jem @yahavi

common/project/projectconfig_test.go Outdated Show resolved Hide resolved
common/project/projectconfig_test.go Outdated Show resolved Hide resolved
utils/ioutils/questionnaire.go Outdated Show resolved Hide resolved
Signed-off-by: Michael Sverdlov <[email protected]>
@sverdlov93 sverdlov93 merged commit 203c916 into jfrog:dev Dec 28, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants