fix: extend #670 rename migration to cover secret table + token files #786

Merged
reviewer merged 1 commit from dev/741 into main 2026-05-03 10:17:17 +00:00
Collaborator

Extends the boot-time #670 rename migration (boss → code-lead, foreman → architect) to also cover the two artifact types the original migration missed.

  • migrateSecretsForLegacyTypeRenames() — renames FORGEJO_TOKEN_BOSSFORGEJO_TOKEN_CODE_LEAD and FORGEJO_TOKEN_FOREMANFORGEJO_TOKEN_ARCHITECT; drops orphan when new name already present
  • migrateTokenFilesForLegacyTypeRenames(tokenDir?) — renames tokens/bosstokens/code-lead and tokens/foremantokens/architect; logs exact mv command on failure
  • Both wired into boot sequence in webhook-config.ts; both idempotent

Test plan

  • 55 tests pass (14 new for the two helpers)
  • just qa clean

Closes #741

Extends the boot-time #670 rename migration (boss → code-lead, foreman → architect) to also cover the two artifact types the original migration missed. - `migrateSecretsForLegacyTypeRenames()` — renames `FORGEJO_TOKEN_BOSS` → `FORGEJO_TOKEN_CODE_LEAD` and `FORGEJO_TOKEN_FOREMAN` → `FORGEJO_TOKEN_ARCHITECT`; drops orphan when new name already present - `migrateTokenFilesForLegacyTypeRenames(tokenDir?)` — renames `tokens/boss` → `tokens/code-lead` and `tokens/foreman` → `tokens/architect`; logs exact `mv` command on failure - Both wired into boot sequence in `webhook-config.ts`; both idempotent ## Test plan - 55 tests pass (14 new for the two helpers) - `just qa` clean Closes #741
fix: extend #670 rename migration to cover secret table + token files (#741)
All checks were successful
qa / dockerfile (pull_request) Successful in 8s
qa / qa (pull_request) Successful in 2m24s
5dba1e1944
The original #670 migration renamed agents-table rows (boss → code-lead,
foreman → architect) but left secret rows (FORGEJO_TOKEN_BOSS/FOREMAN) and
per-type token files (tokens/boss, tokens/foreman) pointing at old names,
causing render-to-disk failures and missing token warnings on boot.

- Add `migrateSecretsForLegacyTypeRenames()`: renames FORGEJO_TOKEN_BOSS →
  FORGEJO_TOKEN_CODE_LEAD and FORGEJO_TOKEN_FOREMAN → FORGEJO_TOKEN_ARCHITECT;
  drops orphan when new name already present.
- Add `migrateTokenFilesForLegacyTypeRenames(tokenDir?)`: renames tokens/boss →
  tokens/code-lead and tokens/foreman → tokens/architect; logs manual mv
  instruction on EACCES/failure.
- Wire both into the boot migration sequence in webhook-config.ts.
- Unit tests for all rename / skip / idempotent / both-exist scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-03 10:13:54 +00:00
reviewer approved these changes 2026-05-03 10:17:07 +00:00
reviewer left a comment

Both migrations correct and idempotent; all 14 new tests pass edge cases. CI green.

Both migrations correct and idempotent; all 14 new tests pass edge cases. CI green.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!786
No description provided.