-
Notifications
You must be signed in to change notification settings - Fork 36
feat: support grouping user/object checks in store tests #513
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
feat: support grouping user/object checks in store tests #513
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for group user checks in store tests by adding a new "Users" field to the ModelTestCheck struct and adjusting related test functions and import logic. Key changes include:
- Adding a "Users" field to ModelTestCheck for multi-user assertions.
- Updating remote and local test functions to iterate over multiple users when provided.
- Extending the import and README documentation to demonstrate multi-user syntax in store tests.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
internal/storetest/storedata.go | Added new "Users" field in ModelTestCheck |
internal/storetest/remotetest.go | Modified remote check test logic to handle multiple users |
internal/storetest/localtest.go | Modified local check test logic to handle multiple users |
cmd/store/import_test.go | Updated tests to include multi-user assertions |
cmd/store/import.go | Revised user handling in check assertions extraction |
README.md | Documented new multi-user checks syntax |
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThe changes enhance OpenFGA CLI test definitions and processing to support multiple users and multiple objects per check. Documentation and examples illustrate this new capability. Core logic, test runners, and validation functions are updated to handle and enforce correct usage of singular versus plural user and object fields in test assertions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant StoreData
participant Validator
participant TestRunner
User->>CLI: Provide test YAML with multiple users/objects
CLI->>StoreData: Parse YAML
StoreData->>Validator: Validate single/multi user/object fields
Validator-->>StoreData: Return validation result
StoreData-->>CLI: Return parsed and validated data
CLI->>TestRunner: Run checks for all user-object combinations
TestRunner->>StoreData: Get effective users/objects
loop For each user-object pair
TestRunner->>CLI: Run check/assertion
end
CLI-->>User: Output test results
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
internal/storetest/storedata.go (1)
32-38
: 🛠️ Refactor suggestionAmbiguity when both
User
andUsers
are populatedAll call-sites treat
Users
as authoritative when non-empty, silently ignoringUser
. Accidentally filling in both fields will therefore drop the single user without warning.
Consider validating the struct at read time to guarantee mutual exclusivity, e.g.:func (c ModelTestCheck) EffectiveUsers() ([]string, error) { if len(c.Users) > 0 && c.User != "" { - // silently prefer Users today + return nil, fmt.Errorf("both 'user' and 'users' are set – choose one") } if len(c.Users) > 0 { return c.Users, nil } return []string{c.User}, nil }Centralising the “effective users” logic also removes the duplication noted in other files.
♻️ Duplicate comments (3)
cmd/store/import.go (1)
235-238
: Same ‘effective users’ logic duplicated across 3 files
This was already flagged in previous reviews – extracting a helper (e.g.checkTest.EffectiveUsers()
) avoids drift.internal/storetest/remotetest.go (1)
37-41
: Shared logic – please extract helper
Same comment as before:users := …
/ fallback to single user appears inlocaltest.go
,remotetest.go
, andimport.go
. One helper onModelTestCheck
will keep behaviour consistent.internal/storetest/localtest.go (1)
28-33
: Extract duplicated “effective users” logic into a helperThe same
users := ... ; if len(checkTest.Users) > 0 { … }
pattern now appears in both local and remote test runners (see previous review). Centralising this in a small helper (e.g.getEffectiveUsers(single string, multi []string) []string
) removes duplication, keeps precedence rules in one place and prevents drift.
🧹 Nitpick comments (3)
cmd/store/import.go (1)
240-249
: Minor optimisation – pre-allocate sliceIf a check has many relations and many users the inner
append
may trigger multiple reallocations. Pre-allocating once per check is cheap and removes that cost:- for _, user := range users { - for relation, expectation := range checkTest.Assertions { - assertions = append(assertions, client.ClientAssertion{ + for _, user := range users { + for relation, expectation := range checkTest.Assertions { + assertions = append(assertions, client.ClientAssertion{ User: user, Relation: relation, Object: checkTest.Object, Expectation: expectation, }) - } + } }Not critical but easy to include.
cmd/store/import_test.go (1)
148-155
: Hard-coding expected assertions based on test casename
couples data & controlInstead of branching on the string literal, include the expected assertions inside each table entry:
- mockWriteAssertions: true, - ... - testStore: …, + mockWriteAssertions: true, + expected: multiUserAssertions, + testStore: …,and use that directly in the setup helper. Reduces indirection and makes adding new cases trivial.
internal/storetest/localtest.go (1)
47-55
: Avoid repeated context marshaling
structpb.NewStruct(*checkTest.Context)
is invoked once per (user, relation) pair even though the context is identical for all of them. Moving the conversion outside both loops (or cachingctx
after the first conversion) would save work and simplify error handling.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md
(2 hunks)cmd/store/import.go
(1 hunks)cmd/store/import_test.go
(4 hunks)internal/storetest/localtest.go
(1 hunks)internal/storetest/remotetest.go
(1 hunks)internal/storetest/storedata.go
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cmd/store/import_test.go (1)
internal/storetest/storedata.go (3)
StoreData
(68-75)ModelTest
(58-66)ModelTestCheck
(32-38)
🔇 Additional comments (1)
internal/storetest/remotetest.go (1)
42-56
: Potential large-fan-out loopThe nested loops generate
len(users) * len(assertions)
remote calls. For big test sets you may want to cap or parallelise them to keep test time reasonable.
There was a problem hiding this 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 (2)
internal/storetest/utils.go (2)
4-5
: Return a defensive copy of the slice
checkTest.Users
is returned directly, so any caller that appends/modifies the slice mutates the same backing array captured in the copied struct. This can create non-obvious test coupling. A trivial, allocation-cheap fix:- return checkTest.Users + return append([]string(nil), checkTest.Users...)
3-3
: Minor: accept pointer to avoid unnecessary struct copy
ModelTestCheck
carries several fields (maps, slices). Passing it by value copies the slice/map headers each call; passing*ModelTestCheck
avoids this and signals immutability intent. Low impact but worth considering.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
cmd/store/import.go
(1 hunks)internal/storetest/localtest.go
(1 hunks)internal/storetest/remotetest.go
(1 hunks)internal/storetest/utils.go
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- internal/storetest/remotetest.go
- internal/storetest/localtest.go
- cmd/store/import.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/storetest/utils.go (1)
internal/storetest/storedata.go (1)
ModelTestCheck
(32-38)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Tests
🔇 Additional comments (1)
internal/storetest/utils.go (1)
3-9
: Guard against empty “user(s)” definition to avoid downstream panics
If aModelTestCheck
arrives with bothUsers
andUser
unset / empty, the function will silently return[]string{""}
.
Any caller that iterates over this result and uses the value as a principal ID will likely produce confusing authorization errors or panics further away from the root-cause. Consider returningnil
+ an error (or at least logging) when neither field is populated.
Let's:
|
There was a problem hiding this 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
🔭 Outside diff range comments (1)
internal/storetest/read-from-input.go (1)
34-40
: Close the opened file to avoid descriptor leaks
os.Open
leaves the descriptor open for the lifetime of the process ifClose
is never called.
Add adefer testFile.Close()
immediately after the error check to ensure resources are released even on early returns.testFile, err := os.Open(fileName) if err != nil { return format, nil, fmt.Errorf("failed to read file %s due to %w", fileName, err) } +defer testFile.Close() // always close the file handle
🧹 Nitpick comments (3)
internal/storetest/read-from-input.go (1)
57-60
: Validation already happens again inRunTests
– minor duplication
storeData.Validate()
is also invoked at the top ofRunTests
.
Running it here is harmless but redundant; if the method ever becomes expensive, this double-call could be avoided by trusting the caller or documenting the expectation.No action required now, just flagging for awareness.
internal/storetest/tests.go (1)
39-42
: Second call toValidate()
– consider consolidating responsibility
RunTests
performs its own validation, butReadFromFile
already does so.
If every consumer comes throughReadFromFile
, you can drop this call.
Conversely, if callers may constructStoreData
programmatically, leave it here and document thatRunTests
must receive validated data.Your call – just ensure the contract is explicit.
internal/storetest/storedata_test.go (1)
10-32
: Split into named sub-tests for clearer failure outputAll four scenarios run in the same function; when one fails, it’s harder to see which.
Usingt.Run
gives granular reporting and keeps the table extensible.-func TestStoreDataValidate(t *testing.T) { - t.Parallel() - - validSingle := ... - assert.NoError(t, validSingle.Validate()) - - validUsers := ... - assert.NoError(t, validUsers.Validate()) - - invalidBoth := ... - require.Error(t, invalidBoth.Validate()) - - invalidNone := ... - require.Error(t, invalidNone.Validate()) -} +func TestStoreDataValidate(t *testing.T) { + t.Parallel() + + cases := []struct { + name string + data StoreData + wantErr bool + }{ + {"single user", validSingle, false}, + {"multiple users", validUsers, false}, + {"both fields", invalidBoth, true}, + {"no user fields", invalidNone, true}, + } + + for _, tc := range cases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + if tc.wantErr { + require.Error(t, tc.data.Validate()) + } else { + assert.NoError(t, tc.data.Validate()) + } + }) + } +}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md
(2 hunks)cmd/store/import.go
(2 hunks)internal/storetest/read-from-input.go
(1 hunks)internal/storetest/storedata.go
(2 hunks)internal/storetest/storedata_test.go
(1 hunks)internal/storetest/tests.go
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- internal/storetest/storedata.go
- cmd/store/import.go
- README.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test Release Process
- GitHub Check: Tests
There was a problem hiding this 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 (1)
internal/storetest/remotetest.go (1)
40-56
: Minor perf tweak – pre-allocateresults
slice
With nested loops overusers
,objects
, andassertions
, the slice can grow rapidly. Pre-computing its capacity prevents multiple re-allocations and marginally speeds large test suites.- results := []ModelTestCheckSingleResult{} + capacity := len(users) * len(objects) * len(checkTest.Assertions) + results := make([]ModelTestCheckSingleResult, 0, capacity)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
README.md
(2 hunks)cmd/store/import.go
(2 hunks)cmd/store/import_test.go
(4 hunks)internal/storetest/localtest.go
(1 hunks)internal/storetest/remotetest.go
(1 hunks)internal/storetest/storedata.go
(2 hunks)internal/storetest/storedata_test.go
(1 hunks)internal/storetest/utils.go
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- internal/storetest/storedata_test.go
- cmd/store/import_test.go
- internal/storetest/localtest.go
- README.md
- internal/storetest/storedata.go
- cmd/store/import.go
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Tests
🔇 Additional comments (3)
internal/storetest/remotetest.go (1)
37-39
: Good move: shared helper eliminates duplicated logic
Switching toGetEffectiveUsers
/GetEffectiveObjects
centralises the singular-vs-plural handling that was repeated across runners. This clearly addresses the earlier duplication comment and improves maintainability.internal/storetest/utils.go (2)
3-9
: I’d like to inspect theModelTestCheck
definition and howGetEffectiveUsers
is used to confirm whether guarding against an emptyUser
and returning a copy makes sense.#!/bin/bash # Find the ModelTestCheck struct definition rg "type ModelTestCheck" -A5 # Find all call sites of GetEffectiveUsers rg "GetEffectiveUsers" -n -A3
11-17
: Let’s inspect the full definition ofModelTestCheck
to confirm the presence and order of its fields:#!/bin/bash # Show full struct definition of ModelTestCheck rg -n 'type ModelTestCheck struct' -A20 internal/storetest/storedata.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
example/model.fga.yaml (2)
51-59
: LGTM: Excellent demonstration of multi-entity testingThe new test case effectively demonstrates the
users
andobjects
functionality, testing multiple entities with a single assertion block. However, please fix the trailing spaces.Remove trailing spaces:
assertions: can_view: true - can_write: true + can_write: true
83-83
: Remove trailing whitespace- +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
example/folder-document-access_tuples.json
(0 hunks)example/model.fga
(1 hunks)example/model.fga.yaml
(2 hunks)example/school.yaml
(1 hunks)internal/storetest/storedata.go
(2 hunks)
💤 Files with no reviewable changes (1)
- example/folder-document-access_tuples.json
🧰 Additional context used
🪛 YAMLlint (1.37.1)
example/model.fga.yaml
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 83-83: trailing spaces
(trailing-spaces)
example/school.yaml
[warning] 1-1: too many blank lines
(1 > 0) (empty-lines)
[error] 3-3: trailing spaces
(trailing-spaces)
[error] 13-13: trailing spaces
(trailing-spaces)
[error] 47-47: trailing spaces
(trailing-spaces)
[warning] 51-51: wrong indentation: expected 10 but found 8
(indentation)
[warning] 54-54: wrong indentation: expected 14 but found 12
(indentation)
[warning] 54-54: too many spaces before colon
(colons)
[error] 55-55: trailing spaces
(trailing-spaces)
[warning] 59-59: wrong indentation: expected 14 but found 12
(indentation)
[warning] 59-59: too many spaces before colon
(colons)
[warning] 64-64: wrong indentation: expected 14 but found 12
(indentation)
[warning] 64-64: too many spaces before colon
(colons)
[warning] 69-69: wrong indentation: expected 14 but found 12
(indentation)
[warning] 69-69: too many spaces before colon
(colons)
[warning] 74-74: wrong indentation: expected 14 but found 12
(indentation)
[warning] 74-74: too many spaces before colon
(colons)
[error] 74-74: no new line character at the end of file
(new-line-at-end-of-file)
🪛 GitHub Check: Lints
internal/storetest/storedata.go
[failure] 160-160:
do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("%s", msg)" (err113)
[failure] 155-155:
do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("%s", msg)" (err113)
[failure] 152-152:
do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("%s", msg)" (err113)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test Release Process
- GitHub Check: Tests
🔇 Additional comments (2)
example/model.fga (1)
24-24
: LGTM: Enhanced document access permissionsThe addition of
[user]
to thecan_view
relation broadens document access permissions appropriately, supporting the multi-user testing framework while maintaining existing viewer-based access patterns.internal/storetest/storedata.go (1)
35-37
: LGTM: Well-designed extension for multi-entity supportThe addition of
Users
andObjects
fields enables the multi-user and multi-object testing capabilities while maintaining backward compatibility with existing singular field usage.
There was a problem hiding this 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
♻️ Duplicate comments (1)
internal/storetest/storedata.go (1)
144-173
: Fix dynamic error creation to use static errors.This issue was already flagged in previous reviews. The validation logic correctly enforces mutual exclusivity, but the error creation should use static errors instead of dynamic ones to follow Go best practices.
Please refer to the previous review comment which provided a comprehensive solution using static error variables.
🧹 Nitpick comments (1)
internal/storetest/storedata.go (1)
34-37
: Fix struct tag alignment for consistency.The struct tags are not aligned consistently, affecting code readability.
Apply this diff to align the tags:
- User string `json:"user,omitempty" yaml:"user,omitempty"` - Users []string `json:"users,omitempty" yaml:"users,omitempty"` - Object string `json:"object,omitempty" yaml:"object,omitempty"` - Objects []string `json:"objects,omitempty" yaml:"objects,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` + Users []string `json:"users,omitempty" yaml:"users,omitempty"` + Object string `json:"object,omitempty" yaml:"object,omitempty"` + Objects []string `json:"objects,omitempty" yaml:"objects,omitempty"`
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
internal/storetest/storedata.go
(2 hunks)internal/storetest/storedata_test.go
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: Lints
internal/storetest/storedata.go
[failure] 37-37:
tag is not aligned, should be: json:"objects,omitempty" yaml:"objects,omitempty" (tagalign)
[failure] 36-36:
tag is not aligned, should be: json:"object,omitempty" yaml:"object,omitempty" (tagalign)
[failure] 35-35:
tag is not aligned, should be: json:"users,omitempty" yaml:"users,omitempty" (tagalign)
[failure] 34-34:
tag is not aligned, should be: json:"user,omitempty" yaml:"user,omitempty" (tagalign)
[failure] 160-160:
do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("%s", msg)" (err113)
[failure] 155-155:
do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("%s", msg)" (err113)
[failure] 152-152:
do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("%s", msg)" (err113)
internal/storetest/storedata_test.go
[failure] 8-8:
import 'gopkg.in/yaml.v3' is not allowed from list 'test' (depguard)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test Release Process
- GitHub Check: Tests
- GitHub Check: Analyze (go)
🔇 Additional comments (3)
internal/storetest/storedata_test.go (3)
11-43
: Excellent test coverage for validation logic.The test comprehensively covers all validation scenarios including valid configurations (single user/object, multiple users, multiple objects) and invalid configurations (conflicting fields, missing required fields).
45-153
: Thorough testing of YAML marshaling behavior.The test effectively verifies that the
omitempty
tags work correctly for all field combinations and ensures empty fields are properly omitted from YAML output.
8-8
: I’ll re-run the search more precisely to locate the GolangCI config and extract any depguard rules:#!/bin/bash # Locate GolangCI configuration files echo "GolangCI config files:" fd ".golangci.*" -t f # Extract depguard settings from them echo -e "\nDepguard rules:" fd ".golangci.*" -t f --exec rg -n "depguard" {} \;
There was a problem hiding this 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 (2)
example/model.fga.yaml (2)
57-57
: Remove trailing spaces.Static analysis detected trailing spaces on this line.
- can_write: true + can_write: true
81-81
: Remove trailing spaces.Static analysis detected trailing spaces on this line.
- +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
example/model.fga.yaml
(2 hunks)internal/storetest/storedata.go
(2 hunks)internal/storetest/storedata_test.go
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- internal/storetest/storedata.go
🧰 Additional context used
🪛 YAMLlint (1.37.1)
example/model.fga.yaml
[error] 57-57: trailing spaces
(trailing-spaces)
[error] 81-81: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test Release Process
🔇 Additional comments (3)
example/model.fga.yaml (1)
50-57
: LGTM! New group user check syntax demonstrated correctly.The new test case properly demonstrates the
users
andobjects
array syntax for group checks, which aligns with the PR objectives to support multiple users and objects in a single test assertion.internal/storetest/storedata_test.go (2)
10-42
: Excellent comprehensive validation test coverage.The
TestStoreDataValidate
function thoroughly covers all the validation scenarios:
- Valid single user/object configurations
- Valid multiple users/objects configurations
- Invalid combinations (both single and multiple fields set)
- Missing required fields
This aligns perfectly with the PR objectives to enforce mutual exclusivity between singular and plural user/object fields.
44-78
: Well-structured struct field behavior tests.The
TestModelTestCheckStructTagsOmitEmpty
function effectively validates:
- Proper handling of single vs. multiple user/object fields
- Correct struct field assignments and empty states
- Array length validation for multiple users/objects
The test cases provide good coverage for the new struct field behavior and demonstrate the expected omitempty behavior.
There was a problem hiding this 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 (2)
example/model.fga.yaml (2)
55-58
: Clarify assertion coverage for generated combinations.
Add a brief comment here to note that theassertions
block applies to all user‐object pairs produced by the cross product of the two lists. This will improve readability for someone unfamiliar with the new syntax.
81-81
: Remove trailing whitespace.
yamllint
flags a trailing space on this blank line—please delete it to keep the file clean.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
example/model.fga.yaml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
example/model.fga.yaml
[error] 81-81: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test Release Process
- GitHub Check: Tests
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
example/model.fga.yaml (1)
50-54
: Validate multi-field syntax consistency.
This example introduces the newusers
andobjects
keys in a single check. Confirm that:
- Each entry in
users
follows the same “user:‹id›” format as the singularuser
field.- Each entry in
objects
matches the expected identifier format.- The implementation enforces mutual exclusivity between
user
vs.users
andobject
vs.objects
.
There was a problem hiding this 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 (2)
example/model.fga.yaml (2)
50-57
: Remove trailing whitespace in comment
Static analysis flagged a trailing space at the end of the comment line.--- a/example/model.fga.yaml +++ b/example/model.fga.yaml @@ line 55 - # These assertions are run for each user + # These assertions are run for each user
58-65
: Remove trailing whitespace in list and assertion value
Static analysis flagged trailing spaces at the end of the user mapping and thecan_write
value.--- a/example/model.fga.yaml +++ b/example/model.fga.yaml @@ line 58 - - user: user:anne + - user: user:anne @@ line 65 - can_write: true + can_write: true
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
example/model.fga.yaml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
example/model.fga.yaml
[error] 55-55: trailing spaces
(trailing-spaces)
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 65-65: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Tests
- GitHub Check: Test Release Process
🔇 Additional comments (1)
example/model.fga.yaml (1)
66-75
: Multi-user and multi-object assertions look correct
The combinedusers
andobjects
block is properly structured and requires no changes.
Summary
users
andobjects
list field to ModelTestCheck for store testsTesting
make test-unit
https://chatgpt.com/codex/tasks/task_e_6846fd0c3ad0832298cc760e9adbbe8d
Summary by CodeRabbit