Edit: so im done with my preliminary research into this codebase.

Our corporate SSO provider is changing, so I’ve been updating our tools to take advantage of the new badges. I found this in a web application that I started on today. The original developer is long gone, and according to our PaaS, this app has been running for just under 3 years without an update.

There is no CI/CD, blue-green deployment, or back ups. The database is an H2 db with ddl-auto set to create-drop on startup, meaning that this database will delete itself if the app is restaged but thanks to this guys code, it won’t populate itself. 🤷

59 points

Dropping the database is not recoverable

This is the real problem

permalink
report
reply
16 points

I sure hope they can recover from last night’s backup. Right?

permalink
report
parent
reply
21 points

Recovering a database from a backup is often possible but often a pain in the ass, and depending on the application you may not consider it acceptable to lose a day of data

permalink
report
parent
reply
2 points

Then you need more frequent backups and possibly even live failovers imo

permalink
report
parent
reply
11 points

that’s assuming they tested the backup system

permalink
report
parent
reply
8 points

Ohh, valid point. So many organisations not testing their restore procedures.

permalink
report
parent
reply
6 points

👃👈

According to the documentation for the app, they got it classified as a shop aid tool, thereby circumventing production requirements.

The whole app is written like some college kids hello world mvc app

permalink
report
parent
reply
56 points

Found this in production while migrating SSO providers. Made me chuckle 🙃

permalink
report
reply
42 points
*

DO NOT RUN IN PROD

Found this in production

Classic

permalink
report
parent
reply
10 points

When I sat down today I thought I was just going to be updating some properties file with oauth end points.

This is so blatantly stupid that I now have to pick through the code base and write up a change request and incident avoidance report 😕

permalink
report
parent
reply
6 points

Actually, this code is also used in their side business manufacturing cattle prods, that line must be excluded from the prods or else they may become sentient and form a cattle prod based skynet.

permalink
report
parent
reply
6 points

Only thing better is finding commented out code below that which would actually prevent it from running in Prod. Bonus if there’s a code comment next to it saying “disabled per email” with no further explanation.

permalink
report
parent
reply
34 points

You wonder why spaceships have self-destruct option?

permalink
report
reply
6 points

Your comment is a blessing.

permalink
report
parent
reply
6 points

I’m stealing this. This is a fantastic way to say a comment was good.

permalink
report
parent
reply
4 points

Haha, feel free to! It’s actually a bit of a joke, since the person’s username is shukufuku, 祝福, meaning blessing or celebration.

permalink
report
parent
reply
31 points

Good Lord, this makes my hands sweaty. Why is your entire prod database leaning on one line of code that’s prone to human error? There should be 20 extra accidental steps taken to do something like this.

permalink
report
reply
29 points

Look, if you hold the lever tight you can safely put the pin back in the grenade!

permalink
report
parent
reply
10 points
*

^C^C^C^C^C^C

permalink
report
parent
reply
12 points

what do you mean? there’s 20 lines of comments warning about it!

permalink
report
parent
reply
4 points

Turns out we were always one copy paste error from a major incident.

Don’t worry, I’m fixing it 🤷

permalink
report
parent
reply
1 point

Heh. That looks like it has decent odds of being a “company ending event” incident, to be specific.

But at least there’s lots of comments. And maybe someone already put a safety net in somewhere else and just forgot to update the 20 comments. It could happen.

permalink
report
parent
reply
1 point

Under different circumstances, sure. As it is, worst they could expect is a fine from our regulators for data retention hits. We could recreate the info easily enough if our suppliers played nicely.

permalink
report
parent
reply
13 points

I usually tend to leave “written by ChatGPT” so colleagues can feed it back and ask to explain lol.

permalink
report
reply