No not even on the other branches, my CI fails when the program has warnings regardless of what branch you're on, never letting warnings touch the dev branch in the first place is the only way
I guess it depends on your source control strategy. If it were me and I was using using gitflow (assumption since you said dev branch) then protect the dev, test, stage, prod, main or whichever branches actually represent an environment... but I personally don't like to force too strict of rules on every branch or even run CI if there's no PR/MR, it burns lots of build minutes, generates noise, and can run counter to commit/push early and often. That said, I'd still prefer your approach to the wild-west, no rules nonsense that I've seen waaay too much in the industry.
Oh yeah totally, my wording might have been a bit off I was talking about PRs to any of the main branches (the ones you mentioned)
People can do whatever they want on their own feature branch but when it's time to push the code into one of them then they gotta pass all the checks first
That's sorta what we did at my job. If you have warnings, it will still successfully build and run the tests, but a check at the end of the CI pipeline will fail the pipeline if you have introduced warnings. And as long as the pipeline is failing, you can't merge. But yeah, that does mean we get a pipeline failure message even if we haven't created an MR yet.
View all comments
Show parent comment
44
u/FabioTheFox 13h ago
No not even on the other branches, my CI fails when the program has warnings regardless of what branch you're on, never letting warnings touch the dev branch in the first place is the only way