Earlier quoted context omitted.
I'm baffled by this too. Unnecessary bridge burning I'd call it. It's not even necessary to the story.
Its explained on the first line: " I'm a Junior Developer with less than one year of actual experience. Some of the things that might seem obvious to some might not be so for me". I guess it applies to this, too, not just the technical aspects.
I Accidentally Deleted 7TB of Videos Before Going to Production
51–60 of 362 posts
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#52Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#53You can automate using puppeteer or selenium
The author used Playwright in the end to automate uploads. Using e2e tools for automating tasks is clever, I'm not sure I would've thought of it.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#54> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…
I was involved with archiving of data that was legally required to be retained for PSD2 compliance. So it was pretty important that the data was correctly archived, but it was just as important that it was properly removed from other places due to data protection. This is basically the approach that was taken: log before and after every action exactly what data or files is being acted on and how. Don't actually do it…
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#55> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…
SELECT COUNT(1) FROM table
-- UPDATE table SET col='val'
WHERE 1=1Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#56Earlier quoted context omitted.
Yes, I find command line tools that have a "--dry-run" flag to be very helpful. If the tool (or script or whatever) is performing some destructive or expensive change, then having the ability to ask "what do you think I want to do?" is great. It's like the difference between "do what I say" and "do what I mean"...
The rule we have is that anything that is not idempotent and not run as a matter of daily routine must dry-run by default, and not take action unless you pass --really. This has saved my bacon many times!
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#57> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…
SELECT COUNT(1) FROM table -- UPDATE table SET col='val' WHERE 1=1
BEGIN TRANSACTION
UPDATE table SET col='val' WHERE 1=1
ROLLBACKRe: I Accidentally Deleted 7TB of Videos Before Going to Production
#58Controversial opinion: And this is why block syntax by white space is not for production.
Re: I Accidentally Deleted 7TB of Videos Before Going to Production
#59> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…