Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The high-level summary is that this replaces all the git log parsing for issue numbers with calls to the Search and Commit endpoints in the GitHub REST API. The Search endpoints are used to find the issues and PRs linked to a specific milestone. The Commit endpoint is used to find the unique commit authors (as opposed to the creator and/or assignees of issues and PRs). So, a lot of code was outright removed, a lot was replaced, and a lot of things were renamed to better align with that they are. Hopefully, this makes things more clear. Also, while adding and replacing code, tests have been added so the overall coverage is now closes to 90%. The only major thing not tested is in the App class. Major renames and refactorings: * ChangelogGeneratorMain renamed to App * GenerateChangelog renamed to ChangelogGenerator * Merge RepoHostConfig and RepoConfig, with the final result in RepoConfig * GitHubListFetcher renamed to GitHubPagingHelper, and refactored as a helper class for pagination (not specific to issues) * Rename things that have GitHub in their name to have a capital H (i.e., GitHub not Github) Additions/Changes: * Add GitHubCategoryFinder as a utility to find a category given a list of labels; this was extracted from GithubTicketFetcher, which has been deleted * Add GitHubChange to represent the information from an issue or PR that we need for the change log * Make outputFile in ChangelogConfig have a null default value * Tests and a bunch of test resources (JSON sample responses) * Enhance ConfigHelpers#externalConfig to use a kiwi LoggingDeserializationProblemHandler to log deserialization errors (for example if there's something unexpected in a YAML config file) at WARN level. There is a TODO to find a better way to report these errors to a user, rather than an ugly log message. * Add a milestone function to RepoConfig which returns an explicitly-provided milestone, or else assumes the revision is in format vX.Y.Z and removes the leading "v" * Add several handy-dandy extension methods to MapExtensions * Update GitHubApi#GitHubResponse#from method to allow for the (odd) possibility of seeing a negative duration for the rate limit reset. Yes, it happened to me which is why I added the code... * Change the println in GitHubApi to DEBUG-level logging * Add new tests for things that did not have a test, e.g., add AppTest for App Command line args: * Remove working directory ( -w / --working-dir ) * Remove "alwaysIncludePRsFrom" ( -i / --include-prs-from ) * Change --milestone-to-close to just --milestone (short arg remains -M) * Make previous revision required * Remove default from revision (was HEAD) and made it required Removals: * GitCommit * GitLogProvider * Ticket * TicketParser * RepoHostConfig (merged into RepoConfig) Misc: * Add MockWebServerExtension JUnit Jupiter extension to start/stop a MockWebServer * Update several tests to use MockWebServerExtension * Refactored internals of App#main so that we can test it without System.exit being called. Did this by extracting an internal "execute" method which returns an AppResult containing the exit code and the App itself, which allows us to test the argument parsing. App#main calls execute and then calls exitProcess with the AppResult.exitCode Documentation * Update the main README to reflect all the changes to usage * Update the documentation in App for the top-level description and several argument * Remove the "alwaysIncludePRsFrom" property from the sample kiwi changelog (sample-kiwi-changelog.yml) Closes #194
- Loading branch information