BreadMoirai / github-release-gradle-plugin

A Gradle Plugin to send Releases to Github
Apache License 2.0
108 stars 26 forks source link

Changelogs periodically empty #46

Open kyhule opened 2 years ago

kyhule commented 2 years ago

I recently integrated this plugin into a project and had success with it while testing the integration with dryRun as well as against a fork of the project but when I eventually merged the changes to main and ran the release process, the changelogs were empty. I just ran githubRelease again twice locally with dryRun enabled and the first run resulted in no changelogs while the second had them. Nothing changed between runs. It seems as though the first run failed to get the previous releases. Is it possible that the request timed out silently?

First run:

:githubRelease
:githubRelease CHANGELOG [Creating...]
:githubRelease CHANGELOG [Searching for previous release on Github]
:githubRelease CHANGELOG [RETRIEVING RELEASES]
:githubRelease CHANGELOG [Running `git rev-list --format=oneline --abbrev-commit --max-count=50 ..HEAD --`]
:githubRelease CHANGELOG [
        ]
:githubRelease [This task is a dry run. All API calls that would modify the repo are disabled. API calls that access the repo information are not disabled. Use this to show what actions would be executed.]
:githubRelease [CHECKING FOR PREVIOUS RELEASE]
:githubRelease [CREATING NEW RELEASE 
{
    tag_name         = 0.11.0-SNAPSHOT
    target_commitish = main
    name             = 0.11.0-SNAPSHOT
    body             = 
        ### Changelog

    draft            = false
    prerelease       = false
}]

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

Second run:

:githubRelease
:githubRelease CHANGELOG [Creating...]
:githubRelease CHANGELOG [Searching for previous release on Github]
:githubRelease CHANGELOG [RETRIEVING RELEASES]
:githubRelease CHANGELOG [0 : 0.10.0]
:githubRelease CHANGELOG [1 : 0.9.0]
:githubRelease CHANGELOG [2 : 0.7.0]
:githubRelease CHANGELOG [Found previous release with tag 0.10.0 at commit fdba18c27cd98ac7444c748394580eee0a6c3324]
:githubRelease CHANGELOG [Running `git rev-list --format=oneline --abbrev-commit --max-count=50 fdba18c27cd98ac7444c748394580eee0a6c3324..HEAD --`]
:githubRelease CHANGELOG [
        29c64b1 Update intellij coverage engine version (#23)
        ]
:githubRelease [This task is a dry run. All API calls that would modify the repo are disabled. API calls that access the repo information are not disabled. Use this to show what actions would be executed.]
:githubRelease [CHECKING FOR PREVIOUS RELEASE]
:githubRelease [CREATING NEW RELEASE 
{
    tag_name         = 0.11.0-SNAPSHOT
    target_commitish = main
    name             = 0.11.0-SNAPSHOT
    body             = 
        ### Changelog

        * 29c64b1 Update intellij coverage engine version (#23)
    draft            = false
    prerelease       = false
}]

BUILD SUCCESSFUL in 700ms
1 actionable task: 1 executed
kyhule commented 2 years ago

After creating this issue, I thought that I should actually look at the source code which led me to seeing this: https://github.com/BreadMoirai/github-release-gradle-plugin/blob/1e0d2ca36f29173e61b79b44fc01ad1ca3ee9f71/src/main/groovy/com/github/breadmoirai/githubreleaseplugin/ChangeLogSupplier.groovy#L99-L102 So that confirms that an error thrown while retrieving the releases would in fact do so silently. I suppose that I can increase the timeouts by providing my own okhttp client and see if that improves things.

As for the silent error handling, it would be nice to see some sort of messaging that something went wrong.