• 
      

    Fix regressions in rbt status-update and convert it to a multi-command.

    Review Request #12189 — Created March 21, 2022 and submitted

    Information

    RBTools
    release-3.x

    Reviewers

    rbt status-update didn't survive some of the changes to commands in
    RBTools 3. Attempting to set or get a status update would fail at a few
    different points. Mainly these had to do with trying to pass in things the
    api_root to functions that no longer took them.

    Even with those fixed, this command's invocation was a bit strange. It
    worked like a multi-command, but had the action last. This meant that
    the entire list of options had to be shared across all subcommands.

    This change fixes the broken code paths and, in the meantime, redoes
    this as a multi-command.

    Each subcommand has its own options that pertain to it, and this allows
    us to move some validation into the options themselves. For instance,
    the status update ID is now required for delete, but is optional for
    the other subcommands.

    To support backwards-compatibility, we check at option parsing time if
    the last parameter is the action name (indicating an old invocation,
    where this had to appear last). If found, we warn and then fix up the
    order of arguments.

    Tested each subcommand on my dev server, along with each available option.
    This includes --review with a JSON document. Every subcommand and option
    gave me the results I expected.

    Tested the validation of the options that support it.

    Tested help output for the main command and all subcommands.

    Summary ID
    Fix regressions in rbt status-update and convert it to a multi-command.
    `rbt status-update` didn't survive some of the changes to commands in RBTools 3. Attempting to set or get a status update would fail at a few different points. Mainly these had to do with trying to pass in things the `api_root` to functions that no longer took them. Even with those fixed, this command's invocation was a bit strange. It worked like a multi-command, but had the action last. This meant that the entire list of options had to be shared across all subcommands. This change fixes the broken code paths and, in the meantime, redoes this as a multi-command. Each subcommand has its own options that pertain to it, and this allows us to move some validation into the options themselves. For instance, the status update ID is now required for `delete`, but is optional for the other subcommands. To support backwards-compatibility, we check at option parsing time if the last parameter is the action name (indicating an old invocation, where this had to appear last). If found, we warn and then fix up the order of arguments.
    17569871c7690fb58931d4e6cb1afa1c6797ec9a
    Description From Last Updated

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Docstring?

    daviddavid
    david
    1. 
        
    2. rbtools/commands/status_update.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    3. rbtools/commands/status_update.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    4. rbtools/commands/status_update.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    5. rbtools/commands/status_update.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    6. 
        
    chipx86
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-3.x (47d8fed)