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

feat(main): Filter list-available to latest #368

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arepala-uml
Copy link
Contributor

  1. Modified the default list-available to show only the latest version of each package.
  2. Added a verbose (-v or --verbose) flag to show all the versions of each package.

Closes #352

…atest version and a verbose flag

Signed-off-by: Akhil Repala <[email protected]>
@arepala-uml arepala-uml marked this pull request as ready for review February 27, 2025 03:48
@arepala-uml arepala-uml requested review from a team as code owners February 27, 2025 03:48
}

// Compare semantic version of packages
func compareVersions(v1 string, v2 string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this one doesn't handle the version correctly. Could you add tests for "10.1.1", "2.0.0" expect true?

Copy link
Member

Choose a reason for hiding this comment

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

Check if hashicorp/go-version works here. It's already a dependency and used in the resolver. It makes sense to be consistent in how we evaluate package versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, I will look for hashicorp/go-version dependency and will write an unit test as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have modified the comparing semantic version function using hashicorp/go-version and to test that function with some test cases, I did not find any specific _test.go file. Can I create a file called list_test.go to test the changes with some test cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a written a function to the list_test.go file and added a test function to test. Is this way correct or can you please tell me where to add specific test function?

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.

Filter list-available to latest
3 participants