Skip to content

Allow closed milestone to be selected #51

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

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

scottfrederick
Copy link
Contributor

Currently the generator will fail if the requested milestone is closed.
With this change open and closed milestones are queried, sorted by
the latest date in descending order to make it likely that recent
milestones appear in the first page of results.

Currently the generator will fail if the requested milestone is closed.
With this change open and closed milestones are queried, sorted by
the latest date in descending order to make it likely that recent
milestones appear in the first page of results.
@derTobsch
Copy link

Nice to see this PR. I ran into this behavior too. Are there any plans to add this into the 0.0.5?

Copy link
Collaborator

@snicoll snicoll left a comment

Choose a reason for hiding this comment

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

Thanks Scott. I've added a comment, can you please have a look?

@@ -45,7 +45,7 @@

private static final Pattern LINK_PATTERN = Pattern.compile("<(.+)>; rel=\"(.+)\"");

private static final String MILESTONES_URI = "/repos/{owner}/{name}/milestones";
private static final String MILESTONES_URI = "/repos/{owner}/{name}/milestones?state=all&sort=due_on&direction=desc&per_page=50";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am a bit nervous that sort=due_on would show milestones that don't have a due date first as it is the case on the Web UI. For projects with a large number of milestones, this may be a problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

That doesn't appear to be what happens with the REST API. Testing against spring-projects/spring-boot returns 50 milestones all of which have a non-null due_on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Querying just the open milestones confirms that those with a null due_on appear last when using a descending sort.

Copy link
Contributor

@wilkinsona wilkinsona Nov 13, 2020

Choose a reason for hiding this comment

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

Ah, the descending sort puts the furthest out milestones first, i.e. it's the same as the Web UI's "Furthest due date". If you switch to an ascending sort with open and closed milestones, you get all those with no due date first followed by lots of old milestones..

In short, a descending due_on sort is correct and it'll be fine as long as you don't have a 50 milestones scheduled after the one for which the change log is being generated.

@scottfrederick scottfrederick added this to the 0.0.5 milestone Dec 9, 2020
@scottfrederick scottfrederick merged commit f11315c into spring-io:master Dec 9, 2020
@scottfrederick scottfrederick deleted the milestone-closed branch December 9, 2020 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants