Skip to content

docs: Add comprehensive store file format documentation #518

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Siddhant-K-code
Copy link
Member

@Siddhant-K-code Siddhant-K-code commented Jun 14, 2025

Description

Adds comprehensive documentation for the OpenFGA store file format (.fga.yaml) as requested in #490.

Documentation Coverage

  • Complete file structure and syntax
  • All core components (store metadata, authorization model, tuples, tests)
  • Support for both inline and file reference approaches
  • Context support for ABAC (Attribute-Based Access Control)
  • CLI commands that use store files
  • Comprehensive examples (basic, advanced ABAC, multi-test)
  • Best practices and conventions

Verification

The documentation covers all CLI commands that use store files:

  • fga store import --file store.fga.yaml
  • fga model test --tests store.fga.yaml
  • fga store export (outputs store file format)

Next Steps

References

fixes #490

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

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the OpenFGA store file format, including structure, usage, and examples.
    • Enhanced command-line documentation by linking relevant commands to the new Store File Format documentation and providing clearer guidance on file formats and test file examples.

@Siddhant-K-code Siddhant-K-code requested review from a team as code owners June 14, 2025 20:42
Copy link

coderabbitai bot commented Jun 14, 2025

Walkthrough

A new documentation file, docs/STORE_FILE.md, was added to provide a comprehensive explanation of the OpenFGA store file format, its structure, usage, and examples. The README.md was updated to reference this new documentation wherever the store file format is discussed, enhancing user guidance.

Changes

File(s) Change Summary
docs/STORE_FILE.md Added new documentation detailing the OpenFGA store file format, usage, examples, and best practices.
README.md Enhanced references to the store file format by linking to docs/STORE_FILE.md in relevant sections.

Sequence Diagram(s)

No sequence diagram generated as the changes are limited to documentation and do not affect control flow or feature logic.

Assessment against linked issues

Objective Addressed Explanation
Create docs/STORE_FILE.md detailing store file format, usage, and examples (#490)
Update README.md to reference the new store file documentation wherever relevant (#490)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

In docs we trust, with YAML in sight,
A store file guide shines ever so bright.
The README now points the curious hare,
To STORE_FILE.md—clarity everywhere!
🐇 With paws on the keyboard and whiskers that twitch,
We hop through the docs—our knowledge enriched!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
docs/STORE_FILE.md (1)

1-385: Comprehensive and well-structured documentation
The new STORE_FILE.md provides a thorough, organized overview of the OpenFGA store file format, covering structure, CLI usage, examples, and best practices. It aligns well with the CLI commands and user workflows.
A few optional refinements to polish the docs:

  1. Consistent context field naming – examples alternate between timestamp and current_time. Consider standardizing on one key.
  2. In section headings (“The store file uses YAML syntax and supports the following top-level properties”), add “the” before “following” for grammatical flow.
  3. Under Tests (line 126), note that each test must include at least one of check, list_objects, or list_users.
  4. Capitalize “YAML” in inline notes (e.g., “Must be in YAML format”).
  5. In CLI examples, clarify parameter descriptions to refer consistently to store files (e.g., “Path to the store file”).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~155-~155: Possible missing preposition found.
Context: ...ner: false #### List Objects Tests Validate which objects a user can access: ya...

(AI_HYDRA_LEO_MISSING_TO)


[duplication] ~247-~247: Possible typo: you repeated a word.
Context: ...I Commands Using Store Files ### Store Import Import a complete store configuration: ```bash...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~259-~259: Possible typo: you repeated a word.
Context: ...t --tests store.fga.yaml ### Store Export Export store configuration to file:bash fg...

(ENGLISH_WORD_REPEAT_RULE)

README.md (2)

231-231: Clarify and standardize parameter description
The --file parameter should explicitly reference the store file and uppercase “YAML”. For example:

-* `--file`: File containing the store. See [Store File Format](docs/STORE_FILE.md) for detailed documentation.
+* `--file`: Path to the store file (YAML). See [Store File Format](docs/STORE_FILE.md) for detailed documentation.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

231-231: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


528-528: Standardize and clarify the --tests parameter
Update to uppercase “YAML” and clarify it refers to a store test file. For example:

-* `--tests`: Name of the tests file. Must be in yaml format. See [Store File Format](docs/STORE_FILE.md) for detailed documentation.
+* `--tests`: Path to the store test file (YAML). Must be in YAML format. See [Store File Format](docs/STORE_FILE.md) for detailed documentation.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~528-~528: Loose punctuation mark.
Context: ...test ###### Parameters * --tests: Name of the tests file. Must be in yaml...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 markdownlint-cli2 (0.17.2)

528-528: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb88057 and 230f11c.

📒 Files selected for processing (2)
  • README.md (3 hunks)
  • docs/STORE_FILE.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

231-231: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


528-528: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

🪛 LanguageTool
README.md

[uncategorized] ~528-~528: Loose punctuation mark.
Context: ...test ###### Parameters * --tests: Name of the tests file. Must be in yaml...

(UNLIKELY_OPENING_PUNCTUATION)

docs/STORE_FILE.md

[uncategorized] ~155-~155: Possible missing preposition found.
Context: ...ner: false #### List Objects Tests Validate which objects a user can access: ya...

(AI_HYDRA_LEO_MISSING_TO)


[duplication] ~247-~247: Possible typo: you repeated a word.
Context: ...I Commands Using Store Files ### Store Import Import a complete store configuration: ```bash...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~259-~259: Possible typo: you repeated a word.
Context: ...t --tests store.fga.yaml ### Store Export Export store configuration to file:bash fg...

(ENGLISH_WORD_REPEAT_RULE)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Release Process
  • GitHub Check: Tests

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.

Document the store file options
1 participant