-
Notifications
You must be signed in to change notification settings - Fork 59
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
Conversation
sverdlov93
commented
Nov 20, 2024
•
edited
Loading
edited
- 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
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]>
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>
There was a problem hiding this 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]>
There was a problem hiding this 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.
slices.SortFunc(allSupportedPackageManagers, func(a, b project.ProjectType) int { | ||
return int(a) - int(b) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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
// 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 | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jfrog-cli @yahavi
artifactory/commands/packagemanagerlogin/packagemanagerlogin.go
Outdated
Show resolved
Hide resolved
artifactory/commands/packagemanagerlogin/packagemanagerlogin.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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jem @yahavi
Signed-off-by: Michael Sverdlov <[email protected]>
Signed-off-by: Michael Sverdlov <[email protected]>