Create Preview Environment when PR submitted against different target branch

Hello Friends,
In my use case, I will create my branch off main branch
However, I want the preview environment spinning up when I submit a PR against staging branch. I enabled preview environment in our staging environment which is pointing to staging branch.

is that possible?

Hi @sama213 , I think you found out the solution to your issue - can you confirm? :pray:

Hey @rophilogene
yes, addressed. Basically preview environments watch the target branch (ex: staging) as pointed to by blueprint environment and any PR submitted for this target will trigger the preview environment creation.

I do have a followup question for you. It appears that the preview environment is cloning REDIS and Postgresql but is not cloning the actual data that we would have needed to test. Is there a way to effectively restore a copy of our target environment database into the preview so we are able to validate code changes against same dataset in target environment?

Thanks!!!

Hi @sama213, thank you :pray:

Let me reply to your second question:

This is where Lifecycle job and database seeding can help. You can find many resources on this topic here.

Let me know if you have complementary questions