phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
2 stars 5 forks source link

protect-branches-for-repo.js fails with "Did not find repository: geometric-optics-basics" #262

Closed pixelzoom closed 2 years ago

pixelzoom commented 2 years ago

I'm trying to follow the instructions in https://github.com/phetsims/phet-info/blob/master/checklists/new_repo_checklist.md for creating a new sim repo. The repo is geometric-optics-basics. I'm having problems with this step:

Following the instructions at the top of protect-branches-for-repo.js, I'm getting this failure:

% node perennial/js/scripts/protect-branches-for-repo.js geometric-optics-basics
(node:46912) UnhandledPromiseRejectionWarning: Error: Did not find repository: geometric-optics-basics
    at handleJSONResponse (/Users/cmalley/PhET/GitHub/perennial/js/common/githubProtectBranches.js:136:13)
    at IncomingMessage.<anonymous> (/Users/cmalley/PhET/GitHub/perennial/js/common/githubProtectBranches.js:247:32)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:46912) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:46912) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
jessegreenberg commented 2 years ago

Hmm, I am not sure. I just ran the script successfully

$ node perennial/js/scripts/protect-branches-for-repo.js geometric-optics-basics
master protection rule set for geometric-optics-basics
main protection rule set for geometric-optics-basics
*[0-9].[0-9]* protection rule set for geometric-optics-basics

One thought, which may impact setting github labels as well - is your developerGithubAccessToken still usable in buildLocal.json? Perhaps it expired. I would have expected a more direct error for that but maybe I am not handling it well in this script.

pixelzoom commented 2 years ago

Thanks for running the script.

developerGithubAccessToken does exist in my build-local.json, and I don't recall changing it on GitHub. I'l leave this issue open to investigate.

pixelzoom commented 2 years ago

This was indeed a problem with my GitHub PAT. After putting a valid PAT in my build-local.json, the script succeeds.

Closing.