Importing with `--store-id` leads to invalid state if store does not exist
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 102
- Forks
- 49
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 16
Description
Running fga store import with the --store-id flag will result in an incorrect state if the store does not exist.
Essentially, it'll create the authorization_model record just fine, but the store_id column will be referencing a store that does not exist. Personally, my preferred behaviour in this case would be that the store is created, but the Go SDK doesn't currently support creating a store with a preset ID, as far as I can tell.
The reason for doing so would be to allow teams using shared environment variables to have a consistent setting for the store ID, as opposed to having to change it in local development every time a new store is created - this has become a bit of a pain for us at Documatic.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fga store import path that handles --store-id, then check the Go SDK's store-creation capabilities. Reproduce the import with a nonexistent store ID and verify the result does not leave an authorization_model referencing a missing store; the intended behavior for creating a store with a preset ID still needs resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100