Bug 241272 - `git-webkit setup` should offer to regenerate expired GitHub personal access tokens
Summary: `git-webkit setup` should offer to regenerate expired GitHub personal access ...
Status: RESOLVED DUPLICATE of bug 240883
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 239082
  Show dependency treegraph
 
Reported: 2022-06-03 09:41 PDT by Wenson Hsieh
Modified: 2023-01-05 16:09 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2022-06-03 09:41:59 PDT
Currently, attempting `git-webkit setup` with an access token that has expired causes the setup script to offer to create a WebKit fork; picking either option (Yes or No) causes the script to fail.

```
% gw setup
WARNING:webkitscmpy:Setting merging behavior for changelogs...
WARNING:webkitscmpy:Set merging behavior for changelogs!
Create a private fork of 'WebKit' belonging to 'whsieh' ([Yes]/No): Yes
Failed to create a fork of 'WebKit' belonging to 'whsieh'
URL: https://api.github.com/repos/WebKit/WebKit/forks
Server replied with status code 401:
{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
Setup failed
% gw setup
WARNING:webkitscmpy:Setting merging behavior for changelogs...
WARNING:webkitscmpy:Set merging behavior for changelogs!
Create a private fork of 'WebKit' belonging to 'whsieh' ([Yes]/No): No
Setup failed
```

The workaround was to regenerate my expired token via https://github.com/settings/tokens and update the token stored in my keychain; it would be nice if the script detected this scenario and surfaced a better error message.
Comment 1 Radar WebKit Bug Importer 2022-06-10 09:42:12 PDT
<rdar://problem/94819991>
Comment 2 Jonathan Bedard 2023-01-05 16:08:51 PST

*** This bug has been marked as a duplicate of bug 240883 ***
Comment 3 Jonathan Bedard 2023-01-05 16:09:27 PST
We ended up fixing this in 240883 by checking the expiration of a user's token.