Fix: resolve short Trello board ID to full 24-char hex ID during init#3
Open
gonewest818 wants to merge 1 commit into
Open
Fix: resolve short Trello board ID to full 24-char hex ID during init#3gonewest818 wants to merge 1 commit into
gonewest818 wants to merge 1 commit into
Conversation
When `trache init` is called with `--board-url`, the board ID extracted from the URL (e.g. `aBcDeFgH` from `https://trello.com/b/aBcDeFgH/my-board`) is a short ID. Trello accepts short IDs in URL paths for GET operations (`GET /1/boards/aBcDeFgH`), but rejects them in `idBoard` parameter values for POST/PUT operations such as creating labels (`POST /1/labels`) or creating lists (`POST /1/lists`). The `--new` code path already resolved this by saving `board_obj.id`, but the `--board-url` / `--board-id` code path only saved `board_obj.name` and left the short ID in `config.board_id`. This caused a confusing partial-failure pattern: reading boards, cards, and lists worked fine, but label creation and list creation failed with `400 {"message":"Invalid id"}`. After fetching the board during init, save the full 24-char hex ID from the API response back to `config.board_id`.
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.
When
trache initis called with--board-url, the board ID extracted from the URL (e.g.aBcDeFgHfromhttps://trello.com/b/aBcDeFgH/my-board) is a short ID.And Trello accepts short IDs in URL paths for GET operations (
GET /1/boards/aBcDeFgH), but rejects them inidBoardparameter values for POST/PUT operations such as creating labels (POST /1/labels) or creating lists (POST /1/lists).The
--board-url/--board-idcode path only savedboard_obj.nameand left the short ID inconfig.board_id. This caused a confusing partial-failure pattern: reading boards, cards, and lists worked fine, but label creation and list creation failed with400 {"message":"Invalid id"}.The fix is, after fetching the board during init, save the full 24-char hex ID from the API response back to
config.board_id.