Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Export pr info from state loader in non-review mode #479

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions recce/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def export_state(self) -> RecceState:
git = GitRepoInfo.from_current_repositroy()
if git:
state.git = git
if self.state_loader.pr_info:
state.pull_request = self.state_loader.pr_info

return state

Expand Down
6 changes: 1 addition & 5 deletions recce/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
from recce.apis.run_func import submit_run
from recce.config import RecceConfig
from recce.models.types import RunType
from recce.pull_request import fetch_pr_metadata
from recce.state import RecceState
from recce.summary import generate_markdown_summary


Expand Down Expand Up @@ -256,10 +254,8 @@ async def cli_run(output_state_file: str, **kwargs):

# Export the state
console.rule("Export state")
state: RecceState = ctx.export_state()
state.pull_request = fetch_pr_metadata(**kwargs)
ctx.state_loader.state_file = output_state_file
msg = ctx.state_loader.export(state)
msg = ctx.state_loader.export(ctx.export_state())
console.print(msg)

summary_path = kwargs.get('summary')
Expand Down
Loading