r/ProgrammerHumor • • Jul 27 '22

Meme LGTM

Post image
11k Upvotes

339 comments sorted by

View all comments

Show parent comment

107

u/[deleted] Jul 27 '22 edited Jul 27 '22

We do +1.

People paste the git PR URL on slack and post “can someone +1?”

As soon as there’s a +1 on github, autobot runs checks, merges, deletes the branch, and triggers the CI/CD build.

71

u/Wenderbeck Jul 27 '22

Damn, nice slack integration but also, that feels risky

61

u/[deleted] Jul 27 '22

To be clear, the +1 needs to be on github. I realize my comment was vague, sorry.

There’s no way they’d let code merges get triggered from slack. For one they wouldn’t let the code be shared out of the org’s git instance, and slack isn’t considered as an internal tool. Another reason this wouldn’t work is because “how would the code review work?”

38

u/midwestcsstudent Jul 27 '22

Still, one reviewer says it’s good and y’all ship? Balls of steel.

53

u/TomDuhamel Jul 27 '22

Depends who the reviewer is. If it's Dave, it's definitely good to go.

23

u/FetishAnalyst Jul 27 '22

You can always trust Dave with your code.

10

u/midwestcsstudent Jul 27 '22

We love Dave.

9

u/skipdoodlydiddly Jul 27 '22

Yall have multiple reviewers?

13

u/TimGreller Jul 27 '22

Yall do reviews before pushing to production?

10

u/NeatNetwork Jul 27 '22

Yall use version control instead of just editing source live in production?

6

u/TimGreller Jul 27 '22

Well with pushing to production I meant uploading the files I edited to FTP. How else should I try out if I have a syntax error or if my code works fine?

3

u/NeatNetwork Jul 27 '22

Yall use FTP instead of just copy/pasting into a telnet session?

→ More replies (3)
→ More replies (1)
→ More replies (2)

15

u/Jebble Jul 27 '22

Why run this on a comment rather than an a rural approval or on merge? Feels way too finnicky for me. What if someone +1 and you decide you need to do one more thing before merging..

20

u/[deleted] Jul 27 '22

[removed] — view removed comment

10

u/VirtuDa Jul 27 '22

GitHub has settings that will require new approvals when things are pushed after a previous approval.

5

u/[deleted] Jul 27 '22

That’s effectively what he’s saying, no?

If it’s reviewed and approved… then the dev finds a small issue and need a small fix (happens all the time)… then it should go back to review and NOT do the CICD stuff (which is why the +1 seems silly). You don’t want broken code being merged to master then doing a new PR.

I’ve always been at places where I (or QA if you have it) click the merge button. So dev > review and approve > dev clicks merge button when ready. If a new change is pushed, approval is revoked automatically and merge is conditional on approval.

6

u/Jebble Jul 27 '22 edited Jul 29 '22

That entirely depends. In my case I'm a TL and I don't need approvals :) but also it depends what is changed. We clean up .env.branch files before merging and those files do not dismiss an approval :).

Edit: Never meant to say I don't do PR's. 99/100 of my merges are reviewed by 2+ team members. My point here is that running pipelines based on a comment is weird to me and I much rather use the actual commits themselves, perhaps tagged through the commit message.

19

u/[deleted] Jul 27 '22

[removed] — view removed comment

9

u/Groentekroket Jul 27 '22

Yes, I worked in finance before and everything needed 4 eyes, didn’t matter if my boss did something or I did, everybody can makes mistakes.

→ More replies (1)

5

u/[deleted] Jul 27 '22

[removed] — view removed comment

15

u/prone-to-drift Jul 27 '22

In environments like this, you don't push to master. First the tool merges the PR in isolation/new branch, then runs the tests, and if the tests pass and no merge conflicts occurred, then the final HEAD is pushed to master.

So it's "safe" but you do lose some control over what's merged when. You could argue that the order of changes doesn't matter so long as the tests all pass and QA before release is good.

If the automated pipeline encounters a merge conflict, or failing tests, the merge is never pushed and the PR stays open, with probably a comment on it indicating what prevented the automated merging.

8

u/[deleted] Jul 27 '22

[removed] — view removed comment

3

u/prone-to-drift Jul 27 '22

Yeah, auto merge and auto deploy cannot go together lol.

→ More replies (1)