JuliaRegistries / TagBot

Creates tags, releases, and changelogs for your Julia packages when they're registered
https://github.com/marketplace/actions/julia-tagbot
MIT License
91 stars 18 forks source link

TagBot is unable to release multiple versions in one job run #304

Open thazhemadam opened 7 months ago

thazhemadam commented 7 months ago

TagBot seems to be unable to create GitHub releases when there are multiple releases that need to be made.

Noticed in SciMLSensitivity. SciMLSensitivity's TagBot setup was broken for a while, due to which a few git tags were not automatically created, and the subsequent GitHub Releases were not published.

Running the TagBot workflow, with a lookback from (approximately) the last time a GitHub release was made^1, throws an error while trying to create the GitHub release. The corresponding git tag, however, gets created.

Error stacktrace ```python Processing version v7.49.0 (aa07de7ffad1000011b83204f7054b2eb6113a8c) Generating changelog for version v7.49.0 (aa07de7ffad1000011b83204f7054b2eb6113a8c) Creating release v7.49.0 at aa07de7ffad1000011b83204f7054b2eb6113a8c {'server': 'GitHub.com', 'date': 'Thu, 18 Jan 2024 10:59:59 GMT', 'content-type': 'application/json; charset=utf-8', 'transfer-encoding': 'chunked', 'x-github-media-type': 'github.v3; format=json', 'x-accepted-github-permissions': 'contents=write; contents=write,workflows=write', 'x-github-api-version-selected': '2022-11-28', 'x-ratelimit-limit': '1000', 'x-ratelimit-remaining': '196', 'x-ratelimit-reset': '1705576468', 'x-ratelimit-used': '804', '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'", 'vary': 'Accept-Encoding, Accept, X-Requested-With', 'content-encoding': 'gzip', 'x-github-request-id': '5000:137E:C1BAE3:19273D6:65A904AF'} Error: GitHub returned a 403 permissions-related error. Please check that your ssh key and TagBot permissions are up to date https://github.com/JuliaRegistries/TagBot#setup Traceback (most recent call last): File "/root/tagbot/action/__main__.py", line 96, in repo.create_release(version, sha) File "/root/tagbot/action/repo.py", line 607, in create_release self._repo.create_git_release( File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 1112, in create_git_release headers, data = self._requester.requestJsonAndCheck( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 398, in requestJsonAndCheck return self.__check( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 423, in __check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/releases/releases#create-a-release"} Traceback (most recent call last): File "/root/tagbot/action/__main__.py", line 96, in repo.create_release(version, sha) File "/root/tagbot/action/repo.py", line 607, in create_release self._repo.create_git_release( File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 1112, in create_git_release headers, data = self._requester.requestJsonAndCheck( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 398, in requestJsonAndCheck return self.__check( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 423, in __check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/releases/releases#create-a-release"} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/root/tagbot/action/__main__.py", line 99, in repo.handle_error(e) File "/root/tagbot/action/repo.py", line 645, in handle_error raise Abort("Cannot continue due to internal failure") tagbot.action.Abort: Cannot continue due to internal failure Error: Issue reporting failed Traceback (most recent call last): File "/root/tagbot/action/__main__.py", line 96, in repo.create_release(version, sha) File "/root/tagbot/action/repo.py", line 607, in create_release self._repo.create_git_release( File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 1112, in create_git_release headers, data = self._requester.requestJsonAndCheck( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 398, in requestJsonAndCheck return self.__check( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 423, in __check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/releases/releases#create-a-release"} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] File "/usr/local/lib/python3.8/site-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) File "/usr/local/lib/python3.8/site-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 237, in _get return self.get(url, **self._set_request_timeout(kwargs)) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 497, in _make_request conn.request( TypeError: request() got an unexpected keyword argument 'chunked' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/root/tagbot/action/repo.py", line 640, in handle_error self._report_error(trace) File "/root/tagbot/action/repo.py", line 442, in _report_error "image": self._image_id(), File "/root/tagbot/action/repo.py", line [43](https://github.com/SciML/SciMLSensitivity.jl/actions/runs/7568969251/job/20611271359#step:3:44)1, in _image_id client = docker.from_env() File "/usr/local/lib/python3.8/site-packages/docker/client.py", line 96, in from_env return cls( File "/usr/local/lib/python3.8/site-packages/docker/client.py", line [45](https://github.com/SciML/SciMLSensitivity.jl/actions/runs/7568969251/job/20611271359#step:3:46), in __init__ self.api = APIClient(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 1[97](https://github.com/SciML/SciMLSensitivity.jl/actions/runs/7568969251/job/20611271359#step:3:98), in __init__ self._version = self._retrieve_server_version() File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( docker.errors.DockerException: Error while fetching server API version: request() got an unexpected keyword argument 'chunked' 0s ```

However, triggering the same workflow, with the lookback adjusted to include only the latest release v7.52.0, runs successfully^2, with the tag and release being created as expected.

aarontrowbridge commented 7 months ago

i think i'm seeing the same issue

ericphanson commented 7 months ago

I'm not at all familiar with the code here, but it looks like TagBot does try to release all the possible versions it can find: https://github.com/JuliaRegistries/TagBot/blob/d15ddfa21e0b7081e0d1b08c952ae8c260337722/tagbot/action/__main__.py#L92-L96

In the included stacktrace I see

TypeError: request() got an unexpected keyword argument 'chunked'

Googling that leads me to https://github.com/docker/docker-py/issues/3113, and I think we are using docker-py. From the last comment https://github.com/docker/docker-py/issues/3113#issuecomment-1918468897, maybe we just need to update our dependencies?

prbzrg commented 3 months ago

I'm getting the same error.