Skip to content
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

Migration system for Supabase database #32

Open
gentlementlegen opened this issue Mar 13, 2024 · 6 comments
Open

Migration system for Supabase database #32

gentlementlegen opened this issue Mar 13, 2024 · 6 comments

Comments

@gentlementlegen
Copy link
Contributor

gentlementlegen commented Mar 13, 2024

We should have a migration system set for our new Supabase instance. To this day, everything is done through the Supabase Dashboard and there is no track of the changes. This become even more critical as we are starting to setup RLS and CLS, which won't be reflected by a db diff dump, as stated in their docs.

This means if we need to create a new db, move it, rollback, run it locally, we would be unable to do so and should do everything manually to mimic the current db's state.

Supabase has a migration system implemented, and a CLI, so we should use these to keep our db updated with the latest schema. Maybe it is better to create a separate repository, as this doesn't really belong to this project specifically. Relates to ubiquity/ubiquibot#919

@gentlementlegen gentlementlegen transferred this issue from ubiquity/ubiquibot Mar 13, 2024
@0x4007
Copy link
Member

0x4007 commented Mar 13, 2024

@rndquu rfc

@rndquu
Copy link
Member

rndquu commented Mar 14, 2024

As far as I understand the bot's kernel won't have a DB but chances are that we will need a DB for the kernel for some plugin keys or auth related features later.

This issue is relevant for kernel plugins. We should move this issue to some ready to use plugin (https://github.com/ubiquibot/comment-incentives or https://github.com/ubiquibot/conversation-rewards) and start from there.

@0x4007
Copy link
Member

0x4007 commented Mar 14, 2024

but chances are that we will need a DB for the kernel for some plugin keys or auth related features later.

Can you elaborate? These should be read from repository ubiquibot-config.yml I don't see why the kernel would need a database.

Also I assume that Cloudflare KV will be simpler to work with (it's just key-value storage) and I think we should consider this instead of traditional databases wherever possible for plugins and possibly the kernel (although I'm skeptical the kernel needs persistent storage)

@gentlementlegen
Copy link
Contributor Author

At least until now we do use a db hence the creation of this issue. But if indeed we don't for this repo it is not relevant, and I agree that it should moved. However I would like to talk about how we handle accounts / logins if we have one db per plugin.

@rndquu
Copy link
Member

rndquu commented Mar 15, 2024

Can you elaborate? These should be read from repository ubiquibot-config.yml I don't see why the kernel would need a database.

Check this comment in telegram. As far as I understand we will have to store a UUID of the invoked plugin action and check it on repository_dispatch event in order to make sure the response is from the plugin the kernel had called earlier. We don't necessarily need a fully fledged DB but at least some storage.

@0x4007
Copy link
Member

0x4007 commented Mar 15, 2024

Cloudflare KV should suffice. I like the idea of using it because it seems significantly easier to set up for developers compared to a full database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants