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

Upload of change log to GitHub fails #3

Closed
tschulte opened this issue Sep 14, 2015 · 3 comments
Closed

Upload of change log to GitHub fails #3

tschulte opened this issue Sep 14, 2015 · 3 comments
Labels
Milestone

Comments

@tschulte
Copy link
Owner

The upload of the change log to GitHub fails frequently with

{"message":"Validation Failed","errors":[{"resource":"Release","code":"custom","message":"Published releases must have a valid tag"}],"documentation_url":"https://developer.github.com/v3/repos/releases/#create-a-release"}

Expected: HTTP response with status 201

     but: was <422 Unprocessable Entity [https://api.github.com/repos/tschulte/gradle-semantic-release-plugin/releases]

I think this is a timing issue. The tag is created and pushed to GitHub. Upload of the change log to GitHub using the Rest-API does require the existence of the tag. Maybe the API caches the tags.

One possible solution might be to first poll the tags using the API after creating and pushing the tag.

@tschulte tschulte added the bug label Sep 14, 2015
@tschulte tschulte added this to the 1.0 milestone Sep 14, 2015
@tschulte
Copy link
Owner Author

I have created a test project https://github.com/tschulte/github-releasetest with corresponding travis job https://travis-ci.org/tschulte/github-releasetest/. With that project, upload of the releasenotes does work OK every time.

@tschulte
Copy link
Owner Author

Not reproducible any more.

@tschulte
Copy link
Owner Author

Now the problem happens sometime in the test project. E.g. https://travis-ci.org/tschulte/github-releasetest/builds/80699738

:release

Executing task ':release' (up-to-date check took 0.001 secs) due to:

  Task has not declared any outputs.

Tagging repository as v2.2.1

Pushing changes in [refs/heads/master, v2.2.1] to origin

The following authentication options are allowed (though they may not be available): [INTERACTIVE, PAGEANT, SSHAGENT, HARDCODED]

using hardcoded credentials from system properties

jcabi-aspects 0.20.1/f0aff93 started new daemon thread jcabi-loggable for watching of @Loggable annotated methods

#fetch(POST api.github.com /repos/tschulte/github-releasetest/releases): [422 Unprocessable Entity] in 676ms

#create('v2.2.1'): thrown java.lang.AssertionError(HTTP response status is not equal to 201:

422 Unprocessable Entity [https://api.github.com/repos/tschulte/github-releasetest/releases]

Server: GitHub.com

Date: Wed, 16 Sep 2015 19:11:02 GMT

Content-Type: application/json; charset=utf-8

Content-Length: 221

Status: 422 Unprocessable Entity

X-RateLimit-Limit: 5000

X-RateLimit-Remaining: 4986

X-RateLimit-Reset: 1442433476

X-OAuth-Scopes: public_repo

X-Accepted-OAuth-Scopes: 

X-GitHub-Media-Type: github.v3

X-XSS-Protection: 1; mode=block

X-Frame-Options: deny

Content-Security-Policy: default-src 'none'

Access-Control-Allow-Credentials: true

Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval

Access-Control-Allow-Origin: *

X-GitHub-Request-Id: 3400F07A:0948:11BDCED:55F9BEC6

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

X-Content-Type-Options: nosniff

{"message":"Validation Failed","errors":[{"resource":"Release","code":"custom","message":"Published releases must have a valid tag"}],"documentation_url":"https://developer.github.com/v3/repos/releases/#create-a-release"}

Expected: HTTP response with status 201

     but: was <422 Unprocessable Entity [https://api.github.com/repos/tschulte/github-releasetest/releases]

Server: GitHub.com

Date: Wed, 16 Sep 2015 19:11:02 GMT

Content-Type: application/json; charset=utf-8

Content-Length: 221

Status: 422 Unprocessable Entity

X-RateLimit-Limit: 5000

X-RateLimit-Remaining: 4986

X-RateLimit-Reset: 1442433476

X-OAuth-Scopes: public_repo

X-Accepted-OAuth-Scopes: 

X-GitHub-Media-Type: github.v3

X-XSS-Protection: 1; mode=block

X-Frame-Options: deny

Content-Security-Policy: default-src 'none'

Access-Control-Allow-Credentials: true

Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval

Access-Control-Allow-Origin: *

X-GitHub-Request-Id: 3400F07A:0948:11BDCED:55F9BEC6

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

X-Content-Type-Options: nosniff

{"message":"Validation Failed","errors":[{"resource":"Release","code":"custom","message":"Published releases must have a valid tag"}],"documentation_url":"https://developer.github.com/v3/repos/releases/#create-a-release"}>) out of org.hamcrest.MatcherAssert#assertThat[20] in 721ms

:release FAILED

@tschulte tschulte reopened this Sep 16, 2015
@tschulte tschulte removed the wontfix label Sep 16, 2015
@tschulte tschulte modified the milestones: 1.1, 1.0 Sep 16, 2015
@tschulte tschulte self-assigned this Sep 16, 2015
@tschulte tschulte removed their assignment Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant