Rolling, rolling, rolling back nothing I love more than communicating why we had to roll back again (⁠ノ⁠ಠ⁠益⁠ಠ⁠)⁠ノ

  • JackLSauce@lemmy.world
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    1 month ago

    Pre-commit hooks don’t require a pipeline nor any money. In most cases it’s one line of code to make the tests run every commit

      • kkj@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        21
        ·
        1 month ago

        Fix your shit and it won’t stop you from committing.

        It’s also usually only on certain branches, so you can make a branch where you break things and then fix them before you merge to testing/main/whatever.

        • SandmanXC@lemmy.world
          link
          fedilink
          arrow-up
          6
          ·
          1 month ago

          TIL precommit hooks can be set per branch. I was being facetious to begin with but this sounds pretty good actually.

          • kkj@lemmy.dbzer0.com
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 month ago

            What do you do if you have code that isn’t complete enough to work? Do you have to just leave it untracked?

            • chellomere@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              1 month ago

              I don’t know what others do, but I personally whip out git commit -n and bypass the hooks in this situation.

              • kkj@lemmy.dbzer0.com
                link
                fedilink
                English
                arrow-up
                2
                ·
                1 month ago

                Every branch you have deploys on commit? You have to fully QA all of your code before it goes into any sort of source control?

                  • kkj@lemmy.dbzer0.com
                    link
                    fedilink
                    English
                    arrow-up
                    2
                    ·
                    1 month ago

                    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.

                  • chellomere@lemmy.world
                    link
                    fedilink
                    arrow-up
                    1
                    ·
                    1 month ago

                    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?

      • 4am@lemmy.zip
        link
        fedilink
        arrow-up
        3
        ·
        1 month ago

        Take down prod while I’m on call and seeing my kid and I shall return the favor

      • chellomere@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        edit-2
        1 month ago

        I agree. I absolutely hate when some pesky git hook rejects some debug code I wrote that I want to commit. Mind you, commit, not integrate. This is the situation where I whip out git commit -n.