Port Perforce backend to use run_process() instead of execute()

Review Request #14484 — Created June 27, 2025 and updated

Information

RBTools
master

Reviewers

This change updates the Perforce client to use run_process() instead
of execute(). In order to simplify the implementation here, I've added
new input_string and timeout parameters to run_process and
friends, which allows passing in data to send to the command's standard
input stream.

Ran unit tests.

Summary ID
Port Perforce backend to use run_process() instead of execute()
This change updates the Perforce client to use `run_process()` instead of `execute()`. In order to simplify the implementation here, I've added new `input_string` and `timeout` parameters to `run_process` and friends, which allows passing in data to send to the command's standard input stream. Testing Done: Ran unit tests.
70fb055a6ae05c010b337fa44b5b0857be168aa8
Description From Last Updated

This can just be True now.

chipx86chipx86

No need for this else.

chipx86chipx86

Probably should be Sequence[Mapping[str, Any]].

chipx86chipx86

Same here.

chipx86chipx86

Mapping here. And similar for other functions below.

chipx86chipx86

This is missing a return type.

chipx86chipx86

This is missing a :py:class: (and then only single backticks).

chipx86chipx86

:py:class:

chipx86chipx86

Ordering here is wrong.

chipx86chipx86

The other arguments are (mostly) alphabetically-sorted. Can you update this to sort? That'll just keep this organized as run_process() expands.

chipx86chipx86

We should probably update this to use Mapping.

chipx86chipx86

Why this? Can we document it here and in the docstring? I feel like maybe the timeout needs to be …

chipx86chipx86

And timeout

maubinmaubin
chipx86
  1. 
      
  2. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    This can just be True now.

  3. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    No need for this else.

    1. I feel like it's more clear here with it.

  4. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    Probably should be Sequence[Mapping[str, Any]].

  5. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    Same here.

  6. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    Mapping here. And similar for other functions below.

  7. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    This is missing a return type.

  8. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    This is missing a :py:class: (and then only single backticks).

  9. rbtools/clients/perforce.py (Diff revision 1)
     
     
    Show all issues

    :py:class:

  10. rbtools/clients/tests/test_p4.py (Diff revision 1)
     
     
     
     
    Show all issues

    Ordering here is wrong.

  11. rbtools/utils/process.py (Diff revision 1)
     
     
    Show all issues

    The other arguments are (mostly) alphabetically-sorted. Can you update this to sort? That'll just keep this organized as run_process() expands.

  12. rbtools/utils/process.py (Diff revision 1)
     
     
    Show all issues

    We should probably update this to use Mapping.

  13. rbtools/utils/process.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    Why this? Can we document it here and in the docstring? I feel like maybe the timeout needs to be flexible too.

  14. 
      
david
maubin
  1. 
      
  2. rbtools/utils/process.py (Diff revision 2)
     
     
    Show all issues

    And timeout

  3. 
      
david
Review request changed
Commits:
Summary ID
Port Perforce backend to use run_process() instead of execute()
This change updates the Perforce client to use `run_process()` instead of `execute()`. In order to simplify the implementation here, I've added new `input_string` and `timeout` parameters to `run_process` and friends, which allows passing in data to send to the command's standard input stream. Testing Done: Ran unit tests.
20ec5f0d70be244bce4714e524491b5c8c0ed40f
Port Perforce backend to use run_process() instead of execute()
This change updates the Perforce client to use `run_process()` instead of `execute()`. In order to simplify the implementation here, I've added new `input_string` and `timeout` parameters to `run_process` and friends, which allows passing in data to send to the command's standard input stream. Testing Done: Ran unit tests.
70fb055a6ae05c010b337fa44b5b0857be168aa8

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
chipx86
  1. Ship It!
  2.