Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing with --store-id leads to invalid state if store does not exist #428

Open
isaacharrisholt opened this issue Dec 5, 2024 · 4 comments

Comments

@isaacharrisholt
Copy link

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.

@aaguiarz
Copy link
Member

aaguiarz commented Dec 5, 2024

Hi @isaacharrisholt

Can you describe your current workflow for local development?

We are discussing some options here to allow using a unique store name openfga/rfcs#27. You'd be able to configure SDKs/CLI to use the store name instead of the ID. The CLI/SDK will retrieve the store Id once and then use it. Do you think that would help?

Thanks a lot in advance

@isaacharrisholt
Copy link
Author

Hey @aaguiarz, yes, a name would be fantastic! Would save us a lot of headaches.

In the meantime, I'd say the current behaviour is still a bug 😅

@rhamzeh
Copy link
Member

rhamzeh commented Dec 5, 2024

@aaguiarz While the name would help - that's a separate issue.

The main issue here is:

@aaguiarz
Copy link
Member

aaguiarz commented Dec 5, 2024

Yep, the behavior is a bug.

The way they'd prefer us to fix the bug is to use the store-id they send, but we'll be fixing by returning an error :). What they need is to have a predictable identifier for the store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants