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

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

Merged
merged 6 commits into from
Oct 21, 2024

Conversation

ap0calypse8
Copy link
Contributor

@ap0calypse8 ap0calypse8 commented Oct 16, 2024

Description

References

Fixes #368

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

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

@ap0calypse8 ap0calypse8 requested a review from a team as a code owner October 16, 2024 09:41
Copy link

linux-foundation-easycla bot commented Oct 16, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@ap0calypse8 ap0calypse8 changed the title Fix progress bar error when tuple section is empty in store import Fix progress bar error when tuple section is empty in store import (issue: #368) Oct 16, 2024
@ap0calypse8 ap0calypse8 changed the title Fix progress bar error when tuple section is empty in store import (issue: #368) Fix progress bar error when tuple section is empty in store import (issue: #368) 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 Oct 16, 2024
@ap0calypse8 ap0calypse8 changed the title Fix progress bar error when tuple section is empty in store import (issue: #368) 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 Fix progress bar error when tuple section is empty in store import (issue: #368) Oct 16, 2024
@ap0calypse8
Copy link
Contributor Author

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 ap0calypse8 reopened this Oct 16, 2024
@ap0calypse8
Copy link
Contributor Author

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

@ap0calypse8 ap0calypse8 changed the title Fix progress bar error when tuple section is empty in store import (issue: #368) Fix progress bar error when tuple section is empty in store import (store import #368) Oct 18, 2024
@ap0calypse8 ap0calypse8 changed the title Fix progress bar error when tuple section is empty in store import (store import #368) Fix progress bar error when tuple section is empty in store import ( store import openfga/cli#368 ) Oct 18, 2024
@ap0calypse8 ap0calypse8 changed the title Fix progress bar error when tuple section is empty in store import ( store import openfga/cli#368 ) Fixes #368 progress bar error when tuple section is empty in store import ( store import openfga/cli#368 ) Oct 18, 2024
cmd/store/import.go Outdated Show resolved Hide resolved
@ap0calypse8
Copy link
Contributor Author

hey any update from the side of the reviewer?

@ewanharris ewanharris changed the title Fixes #368 progress bar error when tuple section is empty in store import ( store import openfga/cli#368 ) fix: don't attempt to import tuples if none are present Oct 21, 2024
Copy link
Member

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ap0calypse8!

@ewanharris ewanharris added this pull request to the merge queue Oct 21, 2024
Merged via the queue into openfga:main with commit d05efa8 Oct 21, 2024
15 checks passed
@ap0calypse8
Copy link
Contributor Author

you are welcome!

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.

store import without tuples always fails
2 participants