Support multiple Starling accounts linked to a single developer account#42
Open
open-dave wants to merge 4 commits into
Open
Support multiple Starling accounts linked to a single developer account#42open-dave wants to merge 4 commits into
open-dave wants to merge 4 commits into
Conversation
Stop discarding all but the first account returned by get_accounts(). Iterate over every linked account per token so a single STARLING_ACCESS_TOKEN covering Personal, Joint and Business accounts is fully ingested, deriving each index and sheet label from the account rather than the env-var key. Per-type tokens keep their existing labels for backward compatibility. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cover get_accounts() returning several accounts, the token/label helpers, and parametrise the balance integration fixture over every account per token. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pass the single-token secret into both populate workflows and describe the single-token option in the forking instructions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The new tests/test_variables.py covering resolve_labels/token_sources was never exercised by CI, which only ran tests/test_starling.py. Point it at tests/ so the multi-account label logic is actually verified; integration tests self-skip without live tokens. Co-Authored-By: Claude Opus 4.8 <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.
What changed
Starling now lets one developer token access several linked accounts (Personal/Joint/Business). The pipeline previously took only
get_accounts()[0]per token and derived the index/sheet label from the env-var key, silently dropping every other account.variables.py— addstoken_sources()(yields every configured token that's present, including a new singleSTARLING_ACCESS_TOKENwith aNonesource key) andresolve_labels(), which maps every account a token exposes to a stable, unique slug (name→accountType→accountUid, collisions disambiguated by uid). A legacy per-type token holding a single account keeps its env-key label so existing indices/sheets are reused.starling_to_elastic.py/starling_to_sheets.py— iterate over every token and every account it returns, building the index/sheet label from the account rather than the env key.STARLING_ACCESS_TOKENsecret.tests/test_variables.pyfor label/token resolution, a multi-accountget_accounts()case, andtest_balance_integration.pyparametrised over all accounts per token.forking-instructions.mddocuments the single-token option.Review findings addressed
CI only ran
tests/test_starling.py, so the newtests/test_variables.pycovering the coreresolve_labels/token_sourceslogic never executed. Pointed the workflow attests/(integration tests self-skip without live tokens). Verified the whole suite passes (12 passed, 2 skipped). The rest of the implementation matched the plan — backward-compatible per-type labels, collision handling, and no dropped accounts.Closes #39
🤖 Generated with Claude Code