fix: resolve short board IDs, 24-char list names, and unhandled FileNotFoundError#1
Open
alexprivalov wants to merge 2 commits into
Open
fix: resolve short board IDs, 24-char list names, and unhandled FileNotFoundError#1alexprivalov wants to merge 2 commits into
alexprivalov wants to merge 2 commits into
Conversation
Two bugs fixed: 1. handle_resolve_errors decorator didn't catch FileNotFoundError, so commands like `card list` would dump a full traceback when no active board was set instead of printing a clean error message. 2. `trache init --board-id` accepted Trello short links (e.g. 6WMY6Kls) but stored them verbatim. Trello GET endpoints accept short links but POST/PUT require the full 24-char ID, causing all write operations to fail with 400 Bad Request. Now init canonicalizes to the full ID via the API response.
Both functions assumed any 24-character string was a Trello ID, but Trello IDs are specifically 24-char lowercase hex strings. A list name that happened to be exactly 24 characters (e.g. "Phase 6: Build in Public") would be returned as-is instead of being looked up, causing cards to be stored with the list name as their list_id. This made all writes to that list fail with 400 Bad Request from the Trello API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
initnow canonicalizes board IDs: when a Trello short link (e.g.6WMY6Kls) is passed via--board-id,initresolves it to the full 24-char hex ID via the API. Previously, the short link was stored verbatim, causing all write operations (POST/PUT) to fail with 400 Bad Request since Trello only accepts full IDs for mutations.resolve_list_id/resolve_card_idnow validate hex format: both functions assumed any 24-character string was a Trello ID, but a list name that happens to be exactly 24 characters (e.g."Phase 6: Build in Public") would bypass the DB lookup and be used as a raw ID. Cards created in such lists got the list name stored as theirlist_id, causing push to fail with 400.handle_resolve_errorsnow catchesFileNotFoundError: sub-commands (card, checklist, comment, list) would dump a full traceback when no active board was set. Now they print a clean error message and exit with code 1.Test plan
trache list createworks after board ID canonicalization