That seems reasonable to perform on protected branches, but I’m not a fan of protecting all branches. That could leave valuable code with a single copy on a dev machine. I’d rather have it pushed to an unprotected branch and then be checked on merge instead of push.
No, it does not prevent pushing (as long as the pre-hooks work) but you cannot deploy from a failed pipeline/branch because you have defective software, as proven by failed tests.
Not quite.
That’s an extremely very basic overview with many steps and concepts omitted but you get the idea.
That seems reasonable to perform on protected branches, but I’m not a fan of protecting all branches. That could leave valuable code with a single copy on a dev machine. I’d rather have it pushed to an unprotected branch and then be checked on merge instead of push.
Only main is protected, you can force push on feature branches.
So, what if I want to push some debug or preliminary code to a topic branch, would this system prevent this if all tests don’t pass?
No, it does not prevent pushing (as long as the pre-hooks work) but you cannot deploy from a failed pipeline/branch because you have defective software, as proven by failed tests.