Page MenuHomeVyOS Platform

Incorrect completion for rollback-soft
Closed, ResolvedPublicBUG

Description

The idea of rollback-soft is to allow rollbacks without reboots. However, currently that command shares its completion with the old rollback, and that creates an impression that it also requires reboot:

vyos@test# rollback-soft <TAB> 
Possible completions:
  <N>	Rollback to revision N (currently requires reboot)

  Revisions:
  0  2024-05-22 15:56:42  vyos  by cli

I did some experiments around the completion helper, like creating a vyatta_rollback-soft_complete, but either I'm missing something about the way bash completion works or bash just looks at the first and ignores the -soft part.

If nothing else, we may rename the command to "revert" or similar.

Details

Difficulty level
Unknown (require assessment)
Version
1.4.0-epa1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Cosmetic issue (typos etc.)

Event Timeline

Only recently moved from 1.3 to 1.5 and noticed rollback-soft immediately (great stuff), the completion message was annoying me too.

There's some separate stuff in vyatta-cfg-run that tells bash what to call for the completion - at the moment rollback and rollback-soft both point to vyatta_rollback_complete().

Not sure which suits best, so I dummied up and tested both a full-copy patch (completely duplicating vyatta_rollback_complete() to vyatta_rollback-soft_complete()) and what seemed neater, just patching vyatta_rollback_complete() to check which version of the command it was completing.

Hopefully either one of these is useful.

dmbaturin triaged this task as Normal priority.May 27 2024, 7:48 AM

I made a PR that uses an implementation with a separate function: https://github.com/vyos/vyatta-cfg/pull/79