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

Changelog must be edited and committed manually during release process #936

Closed
heuermh opened this issue Feb 10, 2016 · 7 comments
Closed

Changelog must be edited and committed manually during release process #936

heuermh opened this issue Feb 10, 2016 · 7 comments
Assignees
Milestone

Comments

@heuermh
Copy link
Member

@heuermh heuermh commented Feb 10, 2016

Note this change to the release script, which was necessary for the 0.18.x releases
https://github.com/bigdatagenomics/adam/blob/master/scripts/release/release.sh#L20

@heuermh heuermh added this to the 0.19.0 milestone Feb 10, 2016
@heuermh
Copy link
Member Author

@heuermh heuermh commented Feb 26, 2016

For the 0.19.0 change log, I used https://github.com/skywinder/Github-Changelog-Generator and manually edited the results. It doesn't bring in pull requests that were closed (such as those where we merge manually) and had trouble sorting by milestone/tag.

@heuermh heuermh modified the milestones: 0.19.1, 0.19.0 Feb 26, 2016
@fnothaft fnothaft removed this from the 0.19.1 milestone May 18, 2016
@fnothaft
Copy link
Member

@fnothaft fnothaft commented May 18, 2016

@heuermh I'm deleting the 0.19.1 milestone (in favor of 0.20.0), do you think we can get this into 0.20.0 or should we untag it?

@heuermh
Copy link
Member Author

@heuermh heuermh commented May 18, 2016

I don't know what the fix would be. I created this as a reminder to the developer cutting the release.

@heuermh
Copy link
Member Author

@heuermh heuermh commented Dec 7, 2017

While there is probably a better way to do this (I started with curl | jq but it isn't trivial to handle pagination), it gets the job done for me.

Build github-api fat jar

$ git clone https://github.com/kohsuke/github-api.git
$ cd github-api/
$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies -DskipTests=true

Add credentials to ~/.github.

Create file issuesForChangelog.java

import java.util.*;
import org.kohsuke.github.*;

public final class issuesForChangelog {
    public static void main(final String[] args) throws Exception {
        if (args.length < 1) {
            System.out.println("usage:\njava issuesForChangelog [milestone number]");
        }
        GitHub github = GitHub.connect();
        GHRepository adam = github.getRepository("bigdatagenomics/adam");
        GHMilestone milestone = adam.getMilestone(Integer.parseInt(args[0]));
        List<GHIssue> pulls = new ArrayList<GHIssue>();
        System.out.println("**Closed issues:**\n");
        for (GHIssue issue : adam.getIssues(GHIssueState.CLOSED, milestone)) {
            if (issue.isPullRequest()) {
                pulls.add(issue);
            }
            else {
                System.out.println(" - " + issue.getTitle() + " [/#" + issue.getNumber() + "](" + issue.getHtmlUrl() + ")");
            }
        }
        System.out.println("\n**Merged and closed pull requests:**\n");
        for (GHIssue pull : pulls) {
            System.out.println(" - " + pull.getTitle() + " [/#" + pull.getNumber() + "](" + pull.getHtmlUrl() + ") ([" + pull.getUser().getLogin() + "](" + pull.getUser().getHtmlUrl() + "))");
        }
    }
}

Compile and run, provide milestone number as parameter

$ javac \
  -classpath "target/github-api-1.91-SNAPSHOT-jar-with-dependencies.jar" \
  issuesForChangelog.java

$ java \
  -classpath "target/github-api-1.91-SNAPSHOT-jar-with-dependencies.jar:." \
  issuesForChangelog 16

**Closed issues:**

 - Readme link to bigdatagenomics/lime 404s [/#1819](https://github.com/bigdatagenomics/adam/issues/1819)
...

**Merged and closed pull requests:**

 - Fix link to documentation [/#1820](https://github.com/bigdatagenomics/adam/pull/1820) ([nzachow](https://github.com/nzachow))
...

Ping @fnothaft for feedback.

@heuermh
Copy link
Member Author

@heuermh heuermh commented Dec 27, 2017

I suppose the above code could be built into a Maven plugin for proper reuse. Will think on doing that for ADAM release version 0.24.0.

@fnothaft
Copy link
Member

@fnothaft fnothaft commented Dec 27, 2017

That's awesome! Strong +1! Thank you for continuing to hack on this, @heuermh!

@heuermh
Copy link
Member Author

@heuermh heuermh commented Jun 7, 2018

Maven plugin repo, licensed Apache v2.0
https://github.com/heuermh/github-changes-maven-plugin

$ mvn com.github.heuermh.maven.plugin.changes:github-changes-maven-plugin:1.0-SNAPSHOT:github-changes -DmilestoneId=20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants