abcnews / aunty

A toolkit for working with ABC News projects
https://www.npmjs.com/package/@abcnews/aunty
MIT License
32 stars 5 forks source link

Data loss possibility on deploy or release #105

Closed phocks closed 1 year ago

phocks commented 4 years ago

Just had a thought that I thought I should bring up. Currently if someone has aunty and chooses a project name that is the same as a previously deployed project, I believe the default behaviour is to overwrite the content on the FTP without warning.

I'm thinking it might be a good idea to maybe build in a warning if a project already exists on the FTP in /www/res/sites/news-projects/

drzax commented 3 years ago

I think this is worth taking more seriously in light of the parallax kerfuffle. The longer we go on, the higher the chance someone will randomly choose a project name that's been used previously causing all kinds of (probably invisible until damage is done) havoc.

drzax commented 3 years ago

I'd say we want a // 5a ... at about https://github.com/abcnews/aunty/blob/master/src/cli/release/index.js#L115 and a // 3.5) ... at about https://github.com/abcnews/aunty/blob/master/src/cli/deploy/index.js#L69 which just check for the existence of the target directory and ask for confirmation if it exists.

drzax commented 2 years ago

The above comment no longer makes very much sense to me. But I just went to deploy a new project with a fairly generic name and got nervous about the existence of this issue all over again. 😬

phocks commented 2 years ago

Yep. It's definitely an issue. I can probably dedicate some time and implement it sometime, unless anyone else wants to tackle it @drzax @colingourlay @jtfell ?

phocks commented 2 years ago

Having a bit more of a think about this. I'm thinking it would make more sense to check when first naming the project instead of on every deploy or release, because we really only need to check 1 initial time and then the rest we actually do want to write over to the same directory because it will be from the same project.

phocks commented 1 year ago

Closing this issue now 🎉