Handle enterprise branches better on platform push
Right now, on an enterprise project with staging and production branches, platform push only warns on the master environment about being production.
Would be nice to detect that and instead warn on the actual production branch and just push to master without confirmation.
I agree it would be nice. I don't think the API currently supports what we need for this... unless we just consider an environment named production worth warning about too for now - see the above PR.
For what it's worth, git push doesn't warn for any branch.
Surprised there's nothing in the project info that allows to detect this. There is at least one thing I suppose:
platform ssh --pipe
[email protected]
So the ssh username tells you if a production branch really is an enterprise thingy :)
Up to you if you want add a workaround somehow, I just thought I created this as an idea, because I've had to double check several times that I'm pushing to the right environment now.
For what it's worth, git push doesn't warn for any branch.
True, but warning for the wrong branch is in some ways worse than not warning at all, "wait, am I now deploying to production or master.."
Surprised there's nothing in the project info that allows to detect this.
Yes, there's nothing reliable that's in a user-accessible API, yet. The ent- prefix is a good point (it always indicates an Enterprise environment ... for now).
At least I feel naming a branch "production" is a fairly solid indicator that it is intended to be production.
We're going to improve this API.