This message was deleted.
# opal
s
This message was deleted.
o
Hi @Avo Sepp , Just had a similar conversation with @Ben Wallis a few weeks ago https://permit-io.slack.com/archives/C01RUUYV3TP/p1684741048923209
👀 1
the file name needs to match
.*data.json
a
Okay, so if I have subscription-data.json it'll load it. But what happens when I load it, is that none of the other data that OPAL loads in fetchers populates.
If I remove the file from git. The fetchers work again.
o
I’m guessing the data path trees overlap and override one another
🤔 1
a
Is it possible my data json formatting is causing some issue?
o
Let me look at the code quickly - I’m not sure how the merge flow works here (@Asaf Cohen wrote that part 😛 )
The folder path the
.*data.json
is under is used as the path in OPA (Can’t say I’m a fan) https://github.com/permitio/opal/blob/a5ec96a11196957ee5b89d35352ec55a50b39f55/opal/common/git/bundle_maker.py#L36 and if it’s in the root folder that means it would override anything in the root
In general we support
data.json
only as a backward compatibility to vanilla OPA. But I guess we can improve this - there should be a better way to indicate the path that data.json should go within OPA @Asaf Cohen / @Ro'e Katz for your cosideration For now @Avo Sepp, you can just put the file under a folder
a
So if it's in a folder in the repo what will it resolve to in the directory? Like... /v1/data/foldername?
o
Yes (If I read the code correctly 😅)
a
And all *data.json files will merge together into one under that directory.
o
I think you should have only one per folder 😅 - or they’ll end up overriding one another
a
😂 Yeah that's... That's maybe not ideal behavior.
I can deal with it. It doesn't stop me. Just needs some really explicit documentation at least.
💜 1
1
o
I agree, that code hasn’t changed since @Asaf Cohen and I first wrote OPAL in my living room (over 2 years ago)
I’ll add something to the docs now
a
I’m testing this right now. Moved my data file under a folder. Waiting for OPAL to pick it up.
Hey that worked. I moved
subscriptions.json
to
subscriptions/data.json
and it picked up under the path
/v1/data/subscriptions
🙌🏻
💪 1
o
Yey! 🦜 I always believed 😛
😆 1
https://github.com/permitio/opal/pull/474 @Filip when you can please review / approve
a
I reviewed and approve. I think this will direct people the right way. Although, I am now curious about the tenant mechanism where you have multiple opal clients with different tenants. Does this mean all tenants load all static data.json? Or is it just because I left that env default that it grabbed everything.
I don't see the approve button on github mobile. Or I don't have rights to approve.
Nevermind.
o
Thanks Avo! 🙂