Skip to content

feat: default stores get to the active store and clarify two flag names - #111

Merged
sergiught merged 1 commit into
mainfrom
feat/store-default-and-flag-names
Aug 3, 2026
Merged

feat: default stores get to the active store and clarify two flag names#111
sergiught merged 1 commit into
mainfrom
feat/store-default-and-flag-names

Conversation

@sergiught

Copy link
Copy Markdown
Owner

📝 Summary

stores get now defaults to the active store. It was the only store-scoped command that demanded the ID be typed even when one was configured (fga store get doesn't either):

$ ofga stores get          # before: accepts 1 arg(s), received 0
$ ofga stores get          # after: shows the configured store

An explicit ID still wins, so another store can be inspected without switching profiles.

Two flags said something other than what they did.

tuples changes --token-file writes a changelog cursor, while --token-file on profiles add reads an API token — the same name pointing in opposite directions. It becomes --cursor-file.

model test --timeout is a per-test bound that shadowed the global per-request --timeout, so one flag name meant two different things depending on the command. It becomes --test-timeout.

Both old names keep working as hidden aliases, so no existing script or poller breaks; they just no longer appear in help. Passing a name together with its alias is rejected rather than silently letting one win (they write the same variable).

The --timeout shadowing itself is preserved for compatibility — the alias is still a local flag — but help now shows only --test-timeout, so the ambiguity is gone from the surface a user reads.

🏷 Type of change

  • 🐛 Bug fix (non-breaking)
  • ✨ Feature (non-breaking)
  • 💥 Breaking change (users must update)
  • ♻️ Refactor (no functional change)
  • 📚 Docs only
  • 🛠 Build / CI / tooling

✅ How to verify

make check

Checked against the built binary with a fake server: stores get with no argument fetches the configured store, with an ID fetches that one, and the old binary still errors on the no-argument form. Both deprecated aliases were driven end to end, as was the both-at-once rejection. The generated command reference is regenerated.

Note: touches internal/command/tuple/command.go, so it may need a trivial rebase against #106/#107.

📋 Checklist

  • 🧪 Tests added or updated where it makes sense
  • 📖 Docs updated (README / command --help / examples) if behavior changed — help, examples and the generated reference
  • 🏷 PR title follows Conventional Commits
  • 🟢 make check passes locally

`ofga stores get` demanded a store ID even when one was configured, unlike
every other store-scoped command; the argument is now optional and falls back
to the active store.

Two flags meant something other than what their names suggested.
`tuples changes --token-file` writes a changelog cursor, while --token-file on
`profiles add` reads an API token — opposite directions for the same name; it
becomes --cursor-file. `model test --timeout` is a per-test bound that shadowed
the global per-request --timeout; it becomes --test-timeout.

Both old names keep working as hidden aliases, so nothing breaks, and passing
a name together with its alias is rejected rather than silently picking one.
@sergiught
sergiught force-pushed the feat/store-default-and-flag-names branch from 9a96afe to b53cf9b Compare August 3, 2026 07:15
@sergiught
sergiught merged commit d617212 into main Aug 3, 2026
9 checks passed
@sergiught
sergiught deleted the feat/store-default-and-flag-names branch August 3, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant