timmyomahony / craft-remote-sync

Sync your database and assets across Craft environments using a remote destination like AWS S3
https://plugins.craftcms.com/remote-sync
Other
12 stars 4 forks source link

FR: Setting to only allow pull/restore of most recent database sync #9

Closed chadcrowell closed 4 years ago

chadcrowell commented 4 years ago

Not sure if this would work for anyone else, but in my situation, I'd be interested in only being able to see, pull, or restore the most recently pushed database, in order to avoid pulling and restoring the wrong one. Maybe there could be a setting to "show X most recent pushes" or something.

Also, is there any pruning with this plugin?

timmyomahony commented 4 years ago

Thanks for the feedback, I'm inclined to agree as I use the plugin myself. Usually I just want to push something then pull it down again elsewhere.

Regarding pruning, I've purposely excluded it as it felt like a "backup" feature that is more suited to craft-remote-backup. Could reincluded it if needs be

zizther commented 4 years ago

Agree with the first point.

Re: the second, I think it would be nice to have some control over pruning that you could control, as it could help keep things cleaner, as one example; for a site we deal with would end up having a long list of possible syncs, where as we probably only need to see the last 3 incase we need to rollback, so would be good to be able to control that.

timmyomahony commented 4 years ago

Thanks @zizther (and @chadcrowell). As a matter of interest, how would you be using this for sycning? Between a number of developers working locally? Going from local/staging > production?

Could certainly add pruning if it's a useful feature. Regarding the latest backup, what about a simple "show more" on the interface? By default that would show the latest, but if you hit "show more" you'd see the rest?

zizther commented 4 years ago

In our case, it would be syncing between envs, such a production to staging and/or local, and between devs working on the project.

I think the Show more is a nice UI touch and definite something which maybe nice to have. If I could get away with only storing the latest X versions of the back up, that is what I would prefer. So that not as many DB or Assets dumps are stored in S3.

We would use the CLI to sync, and I can imagine it building up over time, so would be nice to have it remove the clutter.

timmyomahony commented 4 years ago

Yeah, the pruning approach I was using before (and is now in the remote-backup plugin) keeps hourly, daily, weekly .... which I don't think is appropriate in this case (it's more appropriate for regular backups). Maybe like you both mentioned, just a "keep last X syncs" would work better in this approach

zizther commented 4 years ago

Yeah, i think that approach works for the remote-backup, and a more simplistic version would be ideal here

timmyomahony commented 4 years ago

So I've been working on a few changes to accomodate this. First of all, you can choose to hide either the database or volumes in the utilities panel altogether if you're not interested in syncing them:

Screenshot 2020-04-26 at 15 07 50

You can also now prune backups like remote-backup. This will allow you to keep X most recent database and volumes files:

Screenshot 2020-04-26 at 15 07 48

Furthermore I've added a "latest" tag on the utilities page to indicate the latest synced file. I've also made it only show 3 of the most recent synced files by default with a small "show all" button if you want to see all files:

Screenshot 2020-04-26 at 15 09 20

I think this combination should work for most circumstances. If you want to only ever have 1 most recent backup, you can use the prune settings. Otherwise if you have a number of files it will be neater and easier to manage them.

zizther commented 4 years ago

Amazing work man. These are all great features and the little UX things like the Latest tag are great.

Good work.