Skip to content

Restore settings by gist revision instead of most recent gist #294

@reallyely

Description

@reallyely

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions