Add support for interactive child processes
Adds status function to Command instances to allow running of child processes with stdin connected, such as a shell like bash. Unlike spawn this implicitly waits for the child process to exit.
The function's name status is borrowed from the Rust standard library.
Changes are visible to end-users: yes
- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes
Support for interactive child processes via
ctx.std.process.command("APP_NAME").status().
Test plan
- ~Covered by existing test cases~ New API surface.
- ~New test cases added~ No test cases for
spawn(), so nothing to build upon. - Manual testing; please provide instructions so we can reproduce:
Then integrate the task withdef _impl(ctx): shell = ctx.std.env.var("SHELL") or "sh" print("Running " + shell) cmd = ctx.std.process.command(shell) result = cmd.status() print(shell + " finished with exit code " + str(result.code)) test_task = task( name = "test-task", implementation = _impl, )MODULE.aspectand runaspect test-task. When in the interactive shell useexit(or whatever applies to your shell) to resume the task.
Motivation for this contribution is to allow porting of an edit patches workflow over to Aspect CLI.
An interactive shell (running in a temporary directory) is used to allow users a chance to edit and create new commits, on exit (provided there are no uncommitted changes) patches are generated from commits on top of the baseline (a branch, tag, or an initial generated commit when working on source archives).
@thesayyn what's the next step here?
i don't know why the CI is failing but probably not related. I don't have the powers to merge this without having a green CI.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.