3 ms·
> If the build fails, you should be able to re-run it without pushing to version control. I've uh, not seen one that doesn't? (I agree with you, it shouldn't.
by deathanatos 5y ago
> If the build fails, you should be able to re-run it without pushing to version control.
I've uh, not seen one that doesn't? (I agree with you, it shouldn't. Does your CI system not have a "retry" or "restart" button?)
> The most shocking of all, though, and I have actually seen this: If you deploy a broken build, a rollback to an earlier version should never, ever, require a rollback on your source control.
So, my company does this, and I love it; it gives even the least skilled of our devs a good shot at the "recognize things aren't working → problem started with last deploy → revert last deploy" debug path, and getting it right. Having that last step of revert a deploy literally correspond to a git revert is very useful & easy.
Keeping the "state of what is deployed" in code also gives us good confidence that there aren't random changes being made, allows for code review, provides a log of who changed what when — all the goodness of infrastructure as code.
Now, we keep the main production "monorepo" separate from our repo that describes what is deployed (let's call it "deploy-state". So a revert of a deployment happens in the "deploy-state" repo, not in the monorepo. So, someone's merged feature branch isn't going to get reverted. (Though, we should have a conversation about whatever the actual problem is: if it is code in the monorepo, why did it not fail tests there? We also have ways of saying "this range of commits, from [break, fix), should not get deployed to prevent repeats.)
Whether that setup is a "true monorepo" or not, since it literally involves more than one repo … well, you be the judge. It seemed to us pragmatic to have it be separate, and we've not regretted that.
- diablerouge 5y agoThis isn't that very different from having a "deploy-state" branch that runs alongside your master branch too, bringing it even closer to a true monorepo.
- pdpi 5y ago> So a revert of a deployment happens in the "deploy-state" repo, not in the monorepo. This makes me think you're disagreeing with the literal interpretation of what I wrote, while very much agreeing in spirit. I'm not trying to say that a VCS is an intrinsically wrong solution to managing deployment state (I'm not a fan, but it's an eminently reasonable approach). My issue is with deployment state and application source being enmeshed in the same repo such that you can't evolve one without messing with the other.
- morelisp 5y ago> Does your CI system not have a "retry" or "restart" button? It's pretty common on GitHub that PRs trigger a build but unless the author has some permission on the target project already, can't trigger a rebuild. I'd estimate 30%+ of the PRs I create fail for reasons unrelated to my changes and I have to ask someone to retry.
- deathanatos 5y agoAh, if the project is open-source & its CI is external, I guess I could see that. I was reading the remark in the context of "within a company", where devs would have access to the CI system (& thus, the "restart" button).