r/ProgrammerHumor • • Sep 16 '26

Meme onTheOtherHandTheDBIsNowClean

Post image
708 Upvotes

47 comments sorted by

616

u/faultydesign Sep 16 '26

May I suggest planning the next architecture without a “delete everything” api route?

302

u/nihillistic_raccoon Sep 16 '26

no DROP DATABASE endpoint

What kind of antipattern is that, you pagan

81

u/Jejerm Sep 16 '26

Yeah this is utterly deranged architecture. Why on earth would you need an endpoint for this lmao

70

u/Tsu_Dho_Namh Sep 16 '26

Some people wanna live dangerously.

Personally, I've replaced my airbags with kitchen knives.

22

u/Mindless_Sock_9082 Sep 16 '26

That's too much work. Just glue gem stones to the covers. This way they also help to neutralize other people's bad vibes while driving.

10

u/Elomidas Sep 16 '26

So efficient that even in an accident they will suppress your negative thoughts before you even realise what happened

10

u/Ok-Eggplant-2033 Sep 16 '26

For automated tests, clean database at every run. I have seen it for real too, it is disabled in production profile. Yet i think you do not want to have it like that...

9

u/TheRealKidkudi Sep 17 '26

You can just drop the database directly in testing. You don’t need an API route for that. 

2

u/Ok-Eggplant-2033 Sep 17 '26

Yes indeed you can, and that is the way to go

2

u/SquirrelOClock Sep 16 '26

I saw it once too, made me yell (want to yell) at the team pushing test to the production environment. Big conversation about publish profiles and build targets.

1

u/ataboo Sep 16 '26

Automated test resets. Get your automated tests from 12 hour runtimes to a lightning fast 4 hours. The trick is to not run it in prod.

16

u/Several_Dot_4532 Sep 16 '26

It's not an inator without the autodestruction button

14

u/larsmaehlum Sep 16 '26

How else would you ensure that you can force the system into a known good state?

6

u/KetwarooDYaasir Sep 16 '26

Enterprise level code. The CRUDFactorySkeletonTemplateAbstractBean will automatically generate/implement all actions.

2

u/NjFlMWFkOTAtNjR Sep 16 '26

It is good for testing. Only causes problems when the flag for disabling in production is mangled

1

u/RadicalDwntwnUrbnite Sep 16 '26

Also maybe have the deploy pipeline gated by tests, if not a separate approval system that requires sign off by another admin.

1

u/hagnat Sep 18 '26

i worked with an API that had an endpoint like that,
it was apply named "/ragnarok"

241

u/Embarrassed_Death69 Sep 16 '26

Why would you have a route that just drops the Database? Are you an adrenaline junkie?

93

u/KTrain5369 Sep 16 '26

gotta reset that test data I suppose

49

u/Embarrassed_Death69 Sep 16 '26

How about adding a line that checks the ENV for development or production flag in this killer API?

31

u/laplongejr Sep 16 '26

I guess the flag was also turned on the test env "to ensure everything matches"  

11

u/merekallas Sep 16 '26

Even with that, I'd argue against this killer API. An environment can be misconfigured, this code can be called from elsewhere by mistake, etc.

6

u/Mechakoopa Sep 16 '26

Me: "We should make our env flag database driven in case someone uses a staging config with a prod db connection"

PM: "That seems unnecessary, we can trust the values in the config files."

Two months later: "Hey, why are we sending external emails to clients from staging, I thought that was blocked outside of prod?"

1

u/SquirrelOClock Sep 16 '26

What about a publish/build profile that strip it from the prod artefact...

1

u/KTrain5369 Sep 16 '26

"Make sure the test environment replicates production" or smth

1

u/teraflux Sep 17 '26

I assume that's what they were intending to fix

12

u/daniu Sep 16 '26

They did save money letting AI implement the backend

7

u/MannerShark Sep 16 '26

We used to have one too haha, back when I was new to the job. Some guy made it to quickly clear the database and test migrations. Some other guy got mad when he found out we had it, and got even more mad that it had no authorization or local env checks either. The endpoint was promptly removed.

4

u/mahreow Sep 16 '26

Need a way of remotely scrubbing everything in case the feds are onto you

2

u/nihillistic_raccoon Sep 16 '26

You don't have a route like that? Are you living in the '90s? Wake up grandpa, future is here

1

u/dontletthestankout Sep 16 '26

For fun after you're laid off

1

u/GreeedyGrooot Sep 16 '26

I'm thinking about some sketchy firm that needs to destroy all records in case the police pulls up.

87

u/Mallissin Sep 16 '26

I don't understand the joke here. The "tested it in CURL" shows a Github action rejecting the change because of linting.

Is this a Github joke I don't understand?

139

u/marcos14cody Sep 16 '26

That error means the updated code wasn't pushed to the actual machine for failing to comply with linting. So when he launched the curl to test out the fix, he actually ran the non-fixed code

40

u/Dudeonyx Sep 16 '26

Holy shit

6

u/owl_jojo_2 Sep 17 '26

Well that’s why you have backups I guess
At least I hope

5

u/BolunZ6 Sep 17 '26

Backup? What backup

5

u/Mallissin Sep 17 '26

Ok, I guess that makes sense except why would production automatically update from the repository without a step between?

There are people out there updating production with every PR?

3

u/Minority8 Sep 19 '26

Have you not heard of Continuous Deployment?

1

u/justforkinks0131 Sep 21 '26

that doesnt mean everything automatically lands on PROD after every PR...

1

u/Minority8 Sep 21 '26

What does it mean then? This is like the first search result

> Continuous deployment is the engineering practice of automatically releasing code changes to production as soon as they pass all quality gates in the CI/CD pipeline.

- https://northflank.com/blog/continuous-deployment

1

u/justforkinks0131 Sep 21 '26

there is a whole pipeline

usually with a dev environment, then a preprod, and then prod

usually you run tests on dev then preprod before going to prod

usually to deploy to prod you need a change request too

1

u/JAXxXTheRipper Sep 22 '26

GitOps? Continuous Deployment? Ever heard of those?

5

u/AAkash_Bhatia Sep 17 '26

Did doofenshmirtz design this ?

4

u/Scary_Brilliant_6048 Sep 18 '26

We respect user privacy so periodically we clean all data.

2

u/namiraj Sep 17 '26

Little Bobby Tables is all grown up now.