Expose public Go APIs for model test functionality
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 102
- Forks
- 49
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 16
Description
description
The CLI currently implements functionality that is useful outside a command-line process, but the reusable pieces live under internal and are not consumable by external Go applications.
We would like to programmatically use the equivalent of fga model test, given an in-memory struct matching the documented .fga.yaml test file format, execute the tests and return structured results/summary.
example
func main() {
result, err := modeltest.Run(ctx, modeltest.StoreData{
Model: "...",
Tuples: []client.ClientContextualTupleKey{...},
Tests: []modeltest.ModelTest{...},
}, modeltest.WithMaxTypesPerAuthorizationModel(100))
if result.Summary.Passing {
// ...
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing CLI implementation of fga model test and the documented .fga.yaml test format. Define the public modeltest entry point around the shown StoreData, ModelTest, options, and structured summary; done means an external Go application can run equivalent tests and inspect the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100