This message was deleted.
# opal
s
This message was deleted.
s
Hello @Abdullah Al Rifat , I’ll check with the team members and get back to you
o
As I answered on the separate thread, there's no standalone revert. You can simply push updates to the tracked Git to bring it back to the old policy. Same with data state, using data updates
If you want you, for data updates you can store the entire state as a snapshot in a database or even another OPA instance and pull all the data from there
a
for data update i have seen something like this
Copy code
try:
    await store_transaction.set_policy_data(
        policy_data, path=policy_store_path
    )
if i written something like this before
Copy code
old_policy_store_data = store_transaction.get_data(path=policy_store_path)
i can store the previous data and after monitoring i can reset the data right ? can i do something like this for policies too?
o
Technically yes … But the data can be huge (hundreds of MB or even GB) - you won’t be able to just load it into a variable smoothly. If you limit the data volume, it could work, you’d also need to decide which snapshots to keep and which to revert to. You can do so for policy, for sure; though I think it makes more sense to track thing from Git - I don’t really see the downside to it
Either-way we’d be happy to review any feature you create here; and would love it if you contribute it back to the project with a PR 🙂
CC: @Asaf Cohen
a
to track things from git you mean if there is something wrong we need to push new commit to revert the changes right? i am just trying to find a way just to revert to last state of opal client (policy+data) without any human interaction
o
Yes. Without that push your deployment and git would be out of sync, and it won't be as good a s a source of truth and history
I think the cost of that Git push, especially if you automate it, is totally worth having a single source of truth
a
yes, we will eventually had to make the push but in the meantime we revert manually by push it can take some time and other services with wrong policy/data can cause issues. that's why looking for some better way to handle it.
o
Won't it be easier to test the policy before deploying it? That way you know the update to the policy is going to work
Data is a different matter I agree, though can also be tested to somw degree
These tests can (and I'd say - should) be part of your CI process
Anyway I think a temp in memory revert feature can be cool, if handled safely. And I'd be happy to help review whatever you come up with 🙂
🙏 1