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

utility function to get latest Version w/signoff #599

Merged
merged 4 commits into from
Oct 4, 2024

Conversation

Jougan-0
Copy link
Contributor

Description

This PR fixes #

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

}

// Function to get all version directories sorted in descending order
func GetAllVersionDirsSortedDesc(modelVersionsDirPath string) ([]string, error) {
Copy link

Choose a reason for hiding this comment

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

Should we consider to add unit test on this method ?

Copy link
Contributor

@MUzairS15 MUzairS15 Oct 1, 2024

Choose a reason for hiding this comment

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

+1. // @Jougan-0

return nil, fmt.Errorf("no valid version directories found in '%s'", modelVersionsDirPath)
}

sort.Slice(versions, func(i, j int) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Extract the logic and "Less" function implementation as under sorted semver version / similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay

@leecalcote
Copy link
Member

We're in need of fixing the lint check errors.

@Jougan-0 Jougan-0 merged commit 0777946 into meshery:master Oct 4, 2024
3 of 4 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.

4 participants