modular / modular/stack-pr

subprocess stderr should be captured and reported

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
569
Forks
43
PR merge metrics
No merged PRs in 30d

Description

My very first use of stack-pr. Previously I would manage stacks quite manually. I followed the README precisely and got the error

Updating remote branches
Exitcode: 1
Stdout: None
Stderr: None
Traceback ...
 ...
    return subprocess.run(list(map(str, cmd)), **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 573, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'push', '-f', 'origin', 'frank-reve/stack/1:frank-reve/stack/1', 'frank-reve/stack/2:frank-reve/stack/2', 'frank-reve/stack/3:frank-reve/stack/3', 'frank-reve/stack/4:frank-reve/stack/4']' returned non-zero exit status 1.

When I run the git push command by hand, I get an error response. So the report from stack-pr that Stdout and Stderr is empty, seems wrong. I'm not sure if the error I get manually is stdout or stderr. The error is

remote: - Pushes can not update more than 3 branches or tags.

It would have been pretty valuable to see that right in the stack-pr output.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the subprocess.run wrapper shown in the traceback and the README workflow that triggers the git push. Reproduce the four-branch push, then verify that the failure report includes the remote rejection from stderr.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.