My main problem for now though is why is the backend deployed when the files corresponding to its ignored paths change. Is it because the preview environment was already created, and therefore it will work for subsequent preview environments? If so, how would it work for the main application that also has an environment that is already created?
When this happens, are all the changes in directories that are supposed to be ignored?
Or are you saying you commit a change in the frontend’s rootDir and both the frontend and backend are still deployed in the preview environment? If this is the case I believe that’s the expected behavior, the docs mention
Render will only create a Preview Environment if the files changed in a pull request match the Root Directory or Build Filter paths for at least one service.
So if at least one service sees changes, a preview environment is deployed. And preview environments include everything outlined in your render.yaml file.
I hope this helps clarify. Let me know if you still have any questions about this.
Thanks for clarifying. TL;DR - I think I’ve been able to reproduce the issue you’ve raised here and will have our Engineering team look into it. A few more details below. Let me know if what I’m describing matches what you’re experiencing.
Yes, it happens when a file that should be ignored is changed.
I’ve been able to reproduce this issue, where it seems build filters are not being respected for Preview Environments. I’ll send this to our engineering team to take a look into.
As for the rootDir and both services - we want both services to have preview environments created, but is it normal to have both deployed even when a change is made only to one of them?
I suspect this may be related to the other issue above. In my testing, this works as expected with the primary service, i.e. changes to the backend code only deploy the backend service. But does not work as expected in Preview Environments, i.e. changes to the backend code would deploy both the backend and frontend services. I’ll also have the team look into this.