openfga / cli

A cross-platform CLI to interact with an OpenFGA server
https://openfga.dev
Apache License 2.0
50 stars 26 forks source link

fix: don't attempt to import tuples if none are present #408

Closed ap0calypse8 closed 1 month ago

ap0calypse8 commented 1 month ago

Description

References

Fixes #368

Review Checklist

If you haven't done so yet, we would appreciate it if you could star the OpenFGA repository. :)

linux-foundation-easycla[bot] commented 1 month ago

CLA Signed

The committers listed above are authorized under a signed CLA.

ap0calypse8 commented 1 month ago

To summarize the changes: We added a check for len(storeData.Tuples) == 0 after initializing the FGA client. 2. If there are no tuples, we print a message and return the response immediately. The progress bar initialization and tuple import process only occur if there are tuples to import. This should resolve the issue you're experiencing while still allowing the model to be imported successfully

ap0calypse8 commented 1 month ago

You can review and help me out with running the tests.

ap0calypse8 commented 1 month ago

hey any update from the side of the reviewer?

ap0calypse8 commented 1 month ago

you are welcome!