adagios icon indicating copy to clipboard operation
adagios copied to clipboard

Revert config from git commit

Open hakong opened this issue 10 years ago • 6 comments

It would be sweet if I could just revert the config to commit xyz from git. Say for example if I accidentally delete a contact, I could just click a "Revert to" button in the object history Any thoughts?

hakong avatar Nov 27 '14 12:11 hakong

Agreed the feature is nice, but i wonder if it is simpler to install something that has a strong focus on being a full-fledged git ui. git-webui comes to mind.

palli avatar Dec 14 '14 15:12 palli

This can get complicated quite fast, if the change you want to revert is not the latest one.

palli avatar Dec 14 '14 15:12 palli

Wouldn't a full blown git UI be an overkill for a simple git reset <commit hash> <filename>.

savamane avatar Dec 21 '14 14:12 savamane

It would be git revert (not reset), and from adagios perspective this is complicated, because adagios user might not be aware of how git works.

For example, consider the situation where a user makes 2 changes to an object, and then clicks the first change and does 'undo', will what happens be unexpected to the user ?

This would be save if it was only possible to 'undo' last change made.

However, considering that, doing a git 'revert' creates a new commit (instead of erasing an older commit) so we would have to be semantically aware of what was in a single git commit.

I am open to pull requests if anyone wants to implement this, but please make sure that the feature implemented will make sense to users who are not aware of git fundamentals.

palli avatar Dec 21 '14 16:12 palli

it would be fine to revert to the last good configuration, that is, the configuration of the previous sucessful restart.

Since adagios checks the config before restarting nagios it would be enough to label the git state as "good" after a sucessful verify+restart (via adagios reload button).

In this way, the rollback button would appear after changes are made and disappear once a sucessful restart is done. It would revert to the "good" git commit.

ghomem avatar Feb 18 '15 15:02 ghomem

Good idea.

hakong avatar Feb 18 '15 16:02 hakong