N
Neon7mo ago
helpful-purple

Preventing production data from scheduling application workflows on preview branch

Hey all! I'm currently building an application which includes a task scheduler. The idea is that I have a scheduler running on a fixed interval which schedules tasks based on the user-defined configuration in my database. However, when branching out from main the configuration data is actually copied from the production database. This would mean that if i have the same scheduler running in my preview environment, this would essentially start scheduling workflows for my users (which would in turn fail due to missing credentials from my KV storage). I was wondering what the recommended setup is for these types of workflows? I can imagine a range of possible options: - Running a DELETE FROM schedule_table in my pipeline immediately after branching out, downside of this is that creating a branch from the UI may still cause the same concerns - Prevent access to the production rows from a specific Postgres role using RLS, and only allowing access to my "test data" (however unsure how to configure correctly) - Prevent scheduling the production rows from the task scheduler in the application runtime by using a specific SQL query which only fetches my "test data" Are there any other possibilities I might have missed as an oversight? I feel like every solution has its own set of drawbacks. The most important for me is that the logic does not unintentionally trigger user-defined workflows on non-production environments.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?