JoshuaKGoldberg/create-typescript-app

๐Ÿ› Bug: --mode migrate crashes on editing an "accepting prs" label if "status: accepting prs" already exists

JoshuaKGoldberg opened this issue ยท 1 comments

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

Regardless of how labels are set up in a repository, migrating should normalize them nicely.

Actual

Migrating https://github.com/JoshuaKGoldberg/Emojisplosion:

Error: Failed initializing GitHub repository
    at withSpinner (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/shared/cli/spinners.js:16:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async migrateWithOptions (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/migrate/migrateWithOptions.js:45:5)
    at async run (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/migrate/index.js:21:9)
    at async runOrRestore (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/shared/runOrRestore.js:7:5)
    at async Object.migrate (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/migrate/index.js:19:11)
    at async bin (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/bin/index.js:67:36)
    at async file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/bin/index.js:4:20 {
  [cause]: Error: Command failed with exit code 1: gh label edit accepting prs --color 0E8A16 --description Please, send a pull request to resolve this! ๐Ÿ™ --name status: accepting prs
  label with name "status: accepting prs" already exists
      at makeError (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/execa/lib/error.js:60:11)
      at handlePromise (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/execa/index.js:124:26)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async initializeRepositoryLabels (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js:25:9)
      at async initializeGitHubRepository (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/steps/initializeGitHubRepository/index.js:9:3)
      at async file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/migrate/migrateWithOptions.js:46:7
      at async withSpinner (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/shared/cli/spinners.js:11:20)
      at async migrateWithOptions (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/migrate/migrateWithOptions.js:45:5)
      at async run (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/migrate/index.js:21:9)
      at async runOrRestore (file:///Users/josh/.npm/_npx/a296d102f6ed205b/node_modules/create-typescript-app/lib/shared/runOrRestore.js:7:5) {
    shortMessage: 'Command failed with exit code 1: gh label edit accepting prs --color 0E8A16 --description Please, send a pull request to resolve this! ๐Ÿ™ --name status: accepting prs',

Additional Info

I didn't think to check what the labels looked like in that repo ahead of time. ๐Ÿ˜ฌ so I don't know what the exact combo is that made this not work.

I have fixed some variation of this bug so many times... ๐Ÿ˜ก. #529, #687, #735, #767... why is this so difficult to get right?!

I re-ran migration and everything passed. Sigh. Note that before re-running migration, both accepting prs and status: accepting prs existed.