Which environment should I test?

I was recently working with a client and in-house development team who were working in a Git Flow-like way with different branches for each sprint and feature..

Each sprint branch has its own environment that can be reviewed and tested.

Once the sprint is complete, the sprint branch is merged into the mainline branch.

Due to the number of branches and environments, it was hard to tell what was where.

If they wanted to test a particular change, it could be in various places depending on which branches had been merged and had been deployed.

Here's the thing

My suggestion was to simplify things by limiting the number of branches and environments.

If they used trunk-based development on a single branch, it would be much easier to find a change and less likely for there to be differences or regressions.

If they used feature flags, they could control features by toggling them on and off as needed, or enable features for users with a certain role, in a group or a particular email domain.

There would also be less overhead and process, allowing the team to focus on delivery and not working which branch their change was on or which environment they need to test.