atom-community / atom-community/sync-settings

Restore settings by gist revision instead of most recent gist

Open
#294 2 comments 8 reactions 0 assignees View on GitHub
enhancement has pr
Dominant language
JavaScript
Stars
1.1k
Forks
99
PR merge metrics
No merged PRs in 30d

Description

While it's possible to restore from a gist, it appears that we can only restore from our latest backup. In some cases, however, we might want to restore from a specific _revision_ instead. This proposed enhancement would provide an interface by which to select or opt into a specific gist revision.

**Background / Why this might be useful**

I encountered a situation where got myself into a bad config. Upon attempting to revert to my last good gist (as saved with sync-settings), I accidentally hit "Backup" instead, thereby committing my bad config. 100% my fault, but I couldn't find a way to use sync-settings directly and restore my desired gist. Providing an interface to opt into a specific revision could help clumsy and overly hasty developers (like me) recover from their own mistakes.

My fix was to use Postman to directly get a list of my gist revision from the GitHub API (because I also couldn't find an interface by which to do this on github) in order to get the SHA of my last known good config by date. Then, I 'hacked' the restore() function in sync-settings to use @createClient().gists.getRevision() instead of gists.get() and passed in the revision SHA to the request object.

**2 approaches to applying the enhancement**

I'd fork and add this myself, but given that I couldn't find a direct way of browsing the history of gist revisions, there may be some choices in how this would be provided.

As a result, should sync-settings also provide a means of getting and listing these revisions from within Atom? Should a field simply be provided under sync-settings > settings that allows the user to paste in the SHA (if known) to always restore from if present? Something else? Or is there an interface for all of this I somehow missed?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.