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

Add flag to get the latest release from a specified major version #12

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

jedkohjk
Copy link
Contributor

@jedkohjk jedkohjk commented Jul 3, 2024

Resolves reposense/RepoSense#2208

Proposed commit message

Add flag to get the latest release from a specified major version

Other information

Use the flag --latest or -l and specify the major version after the flag.

Was initially planning to make it as an extension of --tag or t, but parsing wildcards in the middle of strings may be complicated. It may also mean that we are unable to name versions containing * or the specific wildcard character used. Hence, I introduced a new flag instead.

@ckcherry23 ckcherry23 requested a review from a team July 6, 2024 13:29
Copy link
Contributor

@gok99 gok99 left a comment

Choose a reason for hiding this comment

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

Really sorry for the review delays! Introducing the latest flag will probably avoid confusion.

get-reposense.py Outdated
for i in releases:
release_tag = i['tag_name']
if release_tag[:len(tag)] == tag and \
not (release_tag[len(tag):len(tag)+1].isdigit() and tag[-1].isdigit()):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: some tags look like v1.9rc which could match with v1.9 depending on the order of releases but are not technically official releases - in general, release versions could include non-numeric characters.

Maybe we can split by . and compare each section (or something else that makes sense)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for the review, I've updated it accordingly

@gok99
Copy link
Contributor

gok99 commented Jul 24, 2024

@jedkohjk Did you intend to commit RepoSense.jar and logs? LGTM otherwise!

@jedkohjk
Copy link
Contributor Author

@jedkohjk Did you intend to commit RepoSense.jar and logs? LGTM otherwise!

Oh, I didn't notice. I've removed them. Thank you!

Copy link

@jonasongg jonasongg left a comment

Choose a reason for hiding this comment

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

LGTM!

@gok99 gok99 merged commit 8018580 into reposense:master Aug 1, 2024
@damithc
Copy link

damithc commented Aug 8, 2024

@jedkohjk Changes in this PR does not mention the use of wild card anywhere. So, the users will not be aware that a wildcard can be used?

@jedkohjk
Copy link
Contributor Author

jedkohjk commented Aug 8, 2024

@damithc A new flag is used instead of a wildcard for an existing flag

@damithc
Copy link

damithc commented Aug 8, 2024

@damithc A new flag is used instead of a wildcard for an existing flag

So, --latest v1.6 can resolve to v1.6.1, v1.6.1.5 etc. (whichever the latest of them)? If yes, this is not mentioned any user-visible place.

@jedkohjk
Copy link
Contributor Author

jedkohjk commented Aug 8, 2024

@damithc It is mentioned in run.sh, which users will have to edit anyway if they do not just want the most recent release of RepoSense. Of course, it will be good to update the RepoSense user guide too, but that's in a different repo and will require a different pull request. I can do it later today.

@damithc
Copy link

damithc commented Aug 8, 2024

@damithc It is mentioned in run.sh, which users will have to edit anyway if they do not just want the most recent release of RepoSense. Of course, it will be good to update the RepoSense user guide too, but that's in a different branch and will require a different pull request. I can do it later today.

It says ### ./get-reposense.py --latest v1.6 # Gets the latest version of a specific tag
But it's not clear what is meant by latest version of a specific tag.

Perhaps something like the following?
### ./get-reposense.py --latest v1.6 # Gets the latest version with the given version prefix e.g., v1.6.1

@jedkohjk
Copy link
Contributor Author

jedkohjk commented Aug 8, 2024

@damithc It is mentioned in run.sh, which users will have to edit anyway if they do not just want the most recent release of RepoSense. Of course, it will be good to update the RepoSense user guide too, but that's in a different branch and will require a different pull request. I can do it later today.

It says ### ./get-reposense.py --latest v1.6 # Gets the latest version of a specific tag
But it's not clear what is meant by latest version of a specific tag.

Perhaps something like the following?
### ./get-reposense.py --latest v1.6 # Gets the latest version with the given version prefix e.g., v1.6.1

Alright, I'll do it later today (probably tonight) as I do not have access to my laptop at the moment.

@jedkohjk jedkohjk changed the title Add flag to get the latest release from a specified major version Add flag to get the latest release from a specified major version gp Olli I'm mmet g free cd c Aug 8, 2024
@jedkohjk jedkohjk changed the title Add flag to get the latest release from a specified major version gp Olli I'm mmet g free cd c Add flag to get the latest release from a specified major version Aug 8, 2024
@jedkohjk
Copy link
Contributor Author

jedkohjk commented Aug 8, 2024

I've made the following 2 PRs addressing the discussion today:

#13
reposense/RepoSense#2244

gok99 pushed a commit to reposense/RepoSense that referenced this pull request Aug 13, 2024
…se (#2244)

The user guide section for `run.sh` requires updating after the PR to publish-RepoSense: reposense/publish-RepoSense#12

Let's update the User Guide to describe `--latest` tag in the `run.sh` section.
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.

run.sh: provide a flag to indicate major version
4 participants