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

Unable to update the release on some project #346

Open
sbrunner opened this issue Feb 20, 2023 · 0 comments
Open

Unable to update the release on some project #346

sbrunner opened this issue Feb 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@sbrunner
Copy link

Describe the bug

I run:

docker run --env=AEON_AUTOMATION_GH_TOKEN=*** --rm --volume=$(pwd)/.cache2:/cache aeonphp/automation changelog:generate:all camptocamp/c2c.template --github-release-update --cache-path=/cache --skip-from=dependabot-preview[bot] --skip-from=dependabot[bot] --skip-from=renovate[bot] -vvv

I get:

...
 ! [NOTE] All commits analyzed, generating changelog:                           

[info] Sending request:
GET /repos/camptocamp/c2c.template/releases?per_page=100 HTTP/1.1


[info] Received response:
HTTP/1.1 200 OK
server: GitHub.com
date: Mon, 20 Feb 2023 15:32:50 GMT
content-type: application/json; charset=utf-8
cache-control: private, max-age=60, s-maxage=60
vary: Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With
etag: W/"58d44516d6725f73f6bfea8ab18d0084dfd1e9dfe28f68379a9bb4f459064314"
x-oauth-scopes: delete:packages, read:org, repo, workflow, write:packages
x-accepted-oauth-scopes: repo
x-github-media-type: github.v3; format=json
x-github-api-version-selected: 2022-11-28
x-ratelimit-limit: 5000
x-ratelimit-remaining: 4804
x-ratelimit-reset: 1676909883
x-ratelimit-used: 196
x-ratelimit-resource: core
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
content-encoding: gzip
x-github-request-id: C193:7E48:10F8176:1138666:63F392A1

[{"url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619742","assets_url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619742/assets","upload_url":"https://uploads.github.com/repos/camptocamp/c2c.template/releases/86619742/assets{?name,label}","html_url":"https://github.com/camptocamp/c2c.template/releases/tag/2.3.0","id":86619742,"author":{"login":"sbrunner","id":353872,"node_id":"MDQ6VXNlcjM1Mzg3Mg==","avatar_url":"https://avatars.githubusercontent.com/u/353872?v=4","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"node_id":"MDc6UmVsZWFzZTg2NjE5NzQy","tag_name":"2.3.0","target_commitish":"master","name":"2.3.0","draft":false,"prerelease":false,"created_at":"2021-04-14T13:56:17Z","published_at":"2022-12-20T08:07:23Z","assets":[],"tarball_url":"https://api.github.com/repos/camptocamp/c2c.template/tarball/2.3.0","zipball_url":"https://api.github.com/repos/camptocamp/c2c.template/zipball/2.3.0","body":"Description of the release"},{"url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619741","assets_url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619741/assets","upload_url":"https://uploads.github.com/repos/camptocamp/c2c.template/releases/86619741/assets{?name,label}","html_url":"https://github.com/camptocamp/c2c.template/releases/tag/2.2.1","id":86619741,"author":{"login":"sbrunner","id":353872,"node_id":"MDQ6VXNlcjM1Mzg3Mg==","avatar_url":"https://avatars.githubusercontent.com/u/353872?v=4","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"node_id":"MDc6UmVsZWFzZTg2NjE5NzQx","tag_name":"2.2.1","target_commitish":"master","name":"2.2.1","draft":false,"prerelease":false,"created_at":"2019-12-09T10:33:14Z","published_at":"2022-12-20T08:07:22Z","assets":[],"tarball_url":"https://api.github.com/repos/camptocamp/c2c.template/tarball/2.2.1","zipball_url":"https://api.github.com/repos/camptocamp/c2c.template/zipball/2.2.1","body":"## What's Changed\n* Add missing format by @sbrunner in https://github.com/camptocamp/c2c.template/pull/63\n\n\n**Full Changelog**: https://github.com/camptocamp/c2c.template/compare/2.2.0...2.2.1","mentions_count":1},{"url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619739","assets_url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619739/assets","upload_url":"https://uploads.github.com/repos/camptocamp/c2c.template/releases/86619739/assets{?name,label}","html_url":"https://github.com/camptocamp/c2c.template/releases/tag/2.2.0","id":86619739,"author":{"login":"sbrunner","id":353872,"node_id":"MDQ6VXNlcjM1Mzg3Mg==","avatar_url":"https://avatars.githubusercontent.com/u/353872?v=4","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"node_id":"MDc6UmVsZWFzZTg2NjE5NzM5","tag_name":"2.2.0","target_commitish":"master","name":"2.2.0","draft":false,"prerelease":false,"created_at":"2019-12-06T13:51:01Z","published_at":"2022-12-20T08:07:21Z","assets":[],"tarball_url":"https://api.github.com/repos/camptocamp/c2c.template/tarball/2.2.0","zipball_url":"https://api.github.com/repos/camptocamp/c2c.template/zipball/2.2.0","body":"## What's Changed\n* Be more tolerant on update_path configuration by @sbrunner in https://github.com/camptocamp/c2c.template/pull/59\n* Better for IDE by @sbrunner in https://github.com/camptocamp/c2c.template/pull/60\n* Be able to include an external file.  by @sbrunner in https://github.com/camptocamp/c2c.template/pull/62\n* Better error handling by @sbrunner in https://github.com/camptocamp/c2c.template/pull/61\n\n\n**Full Changelog**: https://github.com/camptocamp/c2c.template/compare/2.1.0...2.2.0","mentions_count":1},{"url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619735","assets_url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619735/assets","upload_url":"https://uploads.github.com/repos/camptocamp/c2c.template/releases/86619735/assets{?name,label}","html_url":"https://github.com/camptocamp/c2c.template/releases/tag/2.1.0","id":86619735,"author":{"login":"sbrunner","id":353872,"node_id":"MDQ6VXNlcjM1Mzg3Mg==","avatar_url":"https://avatars.githubusercontent.com/u/353872?v=4","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"node_id":"MDc6UmVsZWFzZTg2NjE5NzM1","tag_name":"2.1.0","target_commitish":"master","name":"2.1.0","draft":false,"prerelease":false,"created_at":"2018-06-27T11:00:40Z","published_at":"2022-12-20T08:07:20Z","assets":[],"tarball_url":"https://api.github.com/repos/camptocamp/c2c.template/tarball/2.1.0","zipball_url":"https://api.github.com/repos/camptocamp/c2c.template/zipball/2.1.0","body":"## What's Changed\n* Be able to iter on a dict by @sbrunner in https://github.com/camptocamp/c2c.template/pull/54\n* Add a config singleton by @sbrunner in https://github.com/camptocamp/c2c.template/pull/55\n* Add pattern for runtime environment in mako files by @sbrunner in https://github.com/camptocamp/c2c.template/pull/56\n* Removes debbuging log by @sbrunner in https://github.com/camptocamp/c2c.template/pull/57\n* Fix some error print by @sbrunner in https://github.com/camptocamp/c2c.template/pull/58\n\n\n**Full Changelog**: https://github.com/camptocamp/c2c.template/compare/2.0.9...2.1.0","mentions_count":1},{"url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619733","assets_url":"https://api.github.com/repos/camptocamp/c2c.template/releases/86619733/assets","upload_url":"https://uploads.github.com/repos/camptocamp/c2c.template/releases/86619733/assets{?name,label}","html_url":"https://github.com/camptocamp/c2c.template/releases/tag/2.0.9","id":86619733,"author":{"login":"sbrunner","id":353872,"node_id":"MDQ6VXNlcjM1Mzg3Mg==","avatar_url":"https://avatars.githubusercontent.com/u/353872?v=4","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"node_id":"MDc6UmVsZWFzZTg2NjE5NzMz","tag_name":"2.0.9","target_commitish":"master","name":"2.0.9","draft":false,"prerelease":false,"created_at":"2018-03-16T08:25:16Z","published_at":"2022-12-20T08:07:19Z","assets":[],"tarball_url":"https://api.github.com/repos/camptocamp/c2c.template/tarball/2.0.9","zipball_url":"https://api.github.com/repos/camptocamp/c2c.template/zipball/2.0.9","body":"## What's Changed\n* Fix override of runtime environment with default values by @sbrunner in https://github.com/camptocamp/c2c.template/pull/53\n\n\n**Full Changelog**: https://github.com/camptocamp/c2c.template/comp

for request:
GET /repos/camptocamp/c2c.template/releases?per_page=100 HTTP/1.1


 ! [NOTE] Updating release description...                                       

[info] Sending request:
PATCH /repos/camptocamp/c2c.template/releases/86619742 HTTP/1.1

{"body":"## [2.3.0] - 2021-04-14\n\n### Changed\n- [76e194](https:\/\/github.com\/camptocamp\/c2c.template\/commit\/76e194da628e93e54a27474197a601577a4f6270) - **Do the release 2.3.0** - [@sbrunner](https:\/\/github.com\/sbrunner)\n- [#64](https:\/\/github.com\/camptocamp\/c2c.template\/pull\/64) - **Use GitHub Actions** - [@sbrunner](https:\/\/github.com\/sbrunner)\n\n### Fixed\n- [#66](https:\/\/github.com\/camptocamp\/c2c.template\/pull\/66) - **unexisting key** - [@sbrunner](https:\/\/github.com\/sbrunner)\n\nGenerated by [Automation](https:\/\/github.com\/aeon-php\/automation)"}
[error] Error:
Not Found
when sending request:
PATCH /repos/camptocamp/c2c.template/releases/86619742 HTTP/1.1

{"body":"## [2.3.0] - 2021-04-14\n\n### Changed\n- [76e194](https:\/\/github.com\/camptocamp\/c2c.template\/commit\/76e194da628e93e54a27474197a601577a4f6270) - **Do the release 2.3.0** - [@sbrunner](https:\/\/github.com\/sbrunner)\n- [#64](https:\/\/github.com\/camptocamp\/c2c.template\/pull\/64) - **Use GitHub Actions** - [@sbrunner](https:\/\/github.com\/sbrunner)\n\n### Fixed\n- [#66](https:\/\/github.com\/camptocamp\/c2c.template\/pull\/66) - **unexisting key** - [@sbrunner](https:\/\/github.com\/sbrunner)\n\nGenerated by [Automation](https:\/\/github.com\/aeon-php\/automation)"}

In GithubExceptionThrower.php line 123:
                                             
  [Github\Exception\RuntimeException (404)]  
  Not Found                                  
                                             

Exception trace:
  at /composer/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php:123
 Github\HttpClient\Plugin\GithubExceptionThrower->Github\HttpClient\Plugin\{closure}() at /composer/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php:31
 Http\Client\Promise\HttpFulfilledPromise->then() at /composer/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php:124
 Github\HttpClient\Plugin\GithubExceptionThrower->handleRequest() at /composer/vendor/php-http/client-common/src/PluginChain.php:45
 Http\Client\Common\PluginChain->Http\Client\Common\{closure}() at /composer/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php:44
 Http\Client\Common\Plugin\HeaderDefaultsPlugin->handleRequest() at /composer/vendor/php-http/client-common/src/PluginChain.php:45
 Http\Client\Common\PluginChain->Http\Client\Common\{closure}() at /composer/vendor/php-http/logger-plugin/src/LoggerPlugin.php:37
 Http\Client\Common\Plugin\LoggerPlugin->doHandleRequest() at /composer/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php:22
 Http\Client\Common\Plugin\LoggerPlugin->handleRequest() at /composer/vendor/php-http/client-common/src/PluginChain.php:45
 Http\Client\Common\PluginChain->Http\Client\Common\{closure}() at /composer/vendor/php-http/client-common/src/PluginChain.php:60
 Http\Client\Common\PluginChain->__invoke() at /composer/vendor/php-http/client-common/src/PluginClient.php:87
 Http\Client\Common\PluginClient->sendRequest() at /composer/vendor/php-http/client-common/src/HttpMethodsClient.php:148
 Http\Client\Common\HttpMethodsClient->sendRequest() at /composer/vendor/php-http/client-common/src/HttpMethodsClient.php:108
 Http\Client\Common\HttpMethodsClient->send() at /composer/vendor/php-http/client-common/src/HttpMethodsClient.php:80
 Http\Client\Common\HttpMethodsClient->patch() at /composer/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php:167
 Github\Api\AbstractApi->patch() at /composer/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php:103
 Github\Api\Repository\Releases->edit() at /composer/vendor/aeon-php/automation/src/Aeon/Automation/GitHub/GitHubClient.php:276
 Aeon\Automation\GitHub\GitHubClient->updateRelease() at /composer/vendor/aeon-php/automation/src/Aeon/Automation/Console/Command/ChangelogGenerateAll.php:149
 Aeon\Automation\Console\Command\ChangelogGenerateAll->execute() at /composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /composer/vendor/symfony/console/Application.php:1005
 Symfony\Component\Console\Application->doRunCommand() at /composer/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at /composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /composer/vendor/aeon-php/automation/bin/automation:75
 {closure}() at /composer/vendor/aeon-php/automation/bin/automation:76

changelog:generate:all [--tag-start TAG-START] [--tag-end TAG-END] [--tag-skip TAG-SKIP] [--tag-only-stable] [--skip-from SKIP-FROM] [--only-commits] [--only-pull-requests] [--compare-reverse] [--format FORMAT] [--theme THEME] [--github-release-update] [--github-file-update-path GITHUB-FILE-UPDATE-PATH] [--github-file-update-ref GITHUB-FILE-UPDATE-REF] [--file-update-path FILE-UPDATE-PATH] [--] <project>

Expected behavior

Release updated

Additional context

The thing I found relay strange is that's the request done by automation is effectively not working with curl:

curl \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer ***"\
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/camptocamp/c2c.template/releases/86619742 \
  -d '{"body":"Description of the release"}'

-> 404

But she is working with the GitHub cli:

gh api \
  --method PATCH \
  -H "Accept: application/vnd.github+json" \
  /repos/camptocamp/c2c.template/releases/86619742 \
 -f body='Description of the release' 

-> working

Does anyone know what's wrong on my repository?

@sbrunner sbrunner added the bug Something isn't working label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant