Skip to content

fix(pr): use stdin body when --body=- is passed#729

Merged
aviator-app[bot] merged 1 commit intoaviator-co:masterfrom
draftcode:draftcode/fix-pr-body-stdin
Apr 23, 2026
Merged

fix(pr): use stdin body when --body=- is passed#729
aviator-app[bot] merged 1 commit intoaviator-co:masterfrom
draftcode:draftcode/fix-pr-body-stdin

Conversation

@draftcode
Copy link
Copy Markdown
Collaborator

The body local was captured from prFlags.Body before the stdin read, so when --body=- was passed, the stdin contents were written into prFlags.Body but the subsequent call to actions.CreatePullRequest still used the stale body local (= the literal "-"). As a result the PR body ended up as -.

Fix: move the body := prFlags.Body capture to after the stdin read.

Reproduce (before fix)

echo 'hello world' | av pr --title test --body -
# -> PR body becomes "-" instead of "hello world"

After fix

echo 'hello world' | av pr --title test --body -
# -> PR body becomes "hello world"

The body variable was captured before the stdin read, so when --body=-
was passed, the literal '-' was sent to the PR instead of the stdin
contents.
@draftcode draftcode requested a review from a team as a code owner April 23, 2026 12:26
@aviator-app
Copy link
Copy Markdown
Contributor

aviator-app Bot commented Apr 23, 2026

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@aviator-app
Copy link
Copy Markdown
Contributor

aviator-app Bot commented Apr 23, 2026

✅ FlexReview Status

Common Owner: aviator-co/engineering (expert-load-balance assignment)
Owner and Assignment:

  • aviator-co/engineering (expert-load-balance assignment)
    Owned Files
    • 🔒 cmd/av/pr.go

Review SLO: 7 business hours if PR size is <= 200 LOC for the first response.

@aviator-app aviator-app Bot requested a review from simsinght April 23, 2026 12:26
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a logic error in cmd/av/pr.go where the pull request body variable was assigned before handling the case where the body is read from standard input. Additionally, it corrects a typo in a code comment. I have no feedback to provide.

@aviator-app aviator-app Bot merged commit 012d547 into aviator-co:master Apr 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants