openfga / openfga/language

model diff and update only if needed?

Open
#526 12 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Go
Stars
35
Forks
17
Avg merge
48m
Merged PRs (30d)
10

Description

Checklist
Describe the problem you'd like to have solved

Currently it is pretty difficult to manage different versions of models automatically in openfga. For instance, If I add model to my application and always on (kubernetes pod) startup I will "create model" it will create TONS OF different models to database. What I would like to see is that, it could check what is the latest model and apply new model only if needed. Could there be like somekind of mechanism to check is update needed?

It is not really great situation that models needs to be managed manually basically in production environments. Otherwise the database is full of trash.

Describe the ideal solution

I have been thinking way how database migrations are working. Own table which will store the state which version of model is in use and is there newer version available which should be applied.

Is it possible to calculate like checksum for current model and to be applied model? That way we could compare is the model apply needed (perhaps worth of provide functions for that in openfga itself).

Alternatives and current workarounds

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by tracing the existing model-creation and storage flow, then define how model identity or versions should be compared and what tests would demonstrate that unchanged models are not created repeatedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.