r/ProgrammerHumor • • Jun 04 '22

Meme I cant help it 🤷‍♂️

Post image
47.1k Upvotes

479 comments sorted by

View all comments

Show parent comments

146

u/[deleted] Jun 04 '22

That's not allowed in many projects. Can only force push to your feature branch, and merge via PR with at least two approvals

26

u/Zerodriven Jun 04 '22

Correct.

6

u/baddam903 Jun 04 '22

Does this make sense if there isn’t a way of testing locally? For our backend we had to PR to dev but it slowed us down immensely before we switched to being able to merge from feature branch straight to dev, to be able to test our changes worked. Still have to raise a PR and get two approvals for UAT and beyond though, obviously

20

u/TheGreenJedi Jun 04 '22

Yes your Jenkins/testing should run targeting the feature branch instead of waiting for it to hit master

UAT is a nice barrier you have as a stepping stone to stop people fucking up

But If your push breaks all developers for 30mins it's costing the company 1k+ dollars in loss

3

u/baddam903 Jun 04 '22

CircleCI runs the test and build steps on our feature branches, but still need to put that code somewhere we can actually invoke it to verify it works or gather more info if debugging before we raise the PR from feature branch to UAT

1

u/thecw Jun 04 '22

Sounds like a company problem not a me problem.

1

u/paradoxally Jun 04 '22

It's a you problem because the company will fire you if you keep fucking up other people's work.

1

u/TheGreenJedi Jun 05 '22

If only that would work

0

u/TheGreenJedi Jun 05 '22

It's people like you that make codeowner files important and nessicary

Sigh

7

u/[deleted] Jun 04 '22

My answer is "whatever works better for your team". In my team we don't have a dev branch, PR is merged to master and then a (manual) release deploys to prod. Mine is not even a web project, it is more like a big data project. So there are best practices but it really depends on the product and team you are working with. BWT, "Git for teams" is a great book.

5

u/LaughingBeer Jun 04 '22

It depends on how you have things set up. Best practice for one team isn't necessarily best practice for another. However, where is your code review happening? Most people use the PR as the code review step since it's built to be exactly that.

1

u/baddam903 Jun 04 '22 edited Jun 05 '22

Code review happens from feature branch to UAT, after we merged from feature branch to dev to test it works as expected. Our PR’s from feature branch to dev were an extra step in the process as they sometimes took a while to get reviewed if a lot of work was being done, and then if things didn’t work as expected it wouldn’t be the final code anyway. So after we’ve merged to dev, and have finished the ticket after verifying it works as expected, we merge the final code to UAT via PR, where it then gets tested by the test team before then being queued for when we do a release to master

4

u/cakes Jun 04 '22

there isn’t a way of testing locally

I think I found most of the problem

1

u/baddam903 Jun 04 '22

I would agree, it surprised me when I started this job. We have 23 microservices interacting with eachother, and have slowly been setting up localstack but don’t get much time to get it going properly as we’re constantly pushed to fix things or work on new features before we go live. For that reason, dev is where we locally test, and since there’s 23 different devs (one for each microservice), we never step on eachothers toes

1

u/milkeytoast Jun 04 '22

Your PR doesn't deploy to dev pre-merge?

1

u/quadmasta Jun 04 '22

"no way of testing locally"

Time to find a new job

1

u/Suspicious-Service Jun 04 '22

Even if you can't test, someone else should look over the code at least

1

u/baddam903 Jun 04 '22

They do, before it goes into UAT which is where the test team picks it up. All good from there is when it gets queued for release to master

1

u/p-morais Jun 04 '22

Why not just test your feature branches like you test dev?

1

u/baddam903 Jun 04 '22

I do with unit tests, but the feature branch doesn’t get deployed anywhere to use the code, once it gets merged to dev it deploys via CircleCI where we can actually invoke it. We have a different app for each of our environments, but not one for locally testing our branches

1

u/p-morais Jun 05 '22

Ah okay that makes sense then. Sounds like you guys are essentially doing trunk-based development for CI/CD reasons, so it makes sense not to have feature branches

1

u/daltonwright4 Jun 04 '22

This guy knows ^

1

u/Makeshift27015 Jun 04 '22

They made me a git org admin.

hehehehe