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

BSRD-806: bring back things from the submodule task #57

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
[FIX] otools-pending show: properly filter merged states
  • Loading branch information
ivantodorovich authored and gurneyalex committed Jan 10, 2025
commit 94c61982cc6fe4ce0a3522029ccf8f2230dd3191
5 changes: 3 additions & 2 deletions odoo_tools/cli/pending.py
Original file line number Diff line number Diff line change
@@ -21,8 +21,9 @@ def cli():
"-s",
"--state",
"state",
help="only list pull requests in the specified state (open, merged, closed)",
) # TODO list valid values
help="only list pull requests in the specified state",
type=click.Choice(["open", "merged", "closed"], case_sensitive=False),
)
@click.option(
"-p",
"--purge",
9 changes: 7 additions & 2 deletions odoo_tools/utils/pending_merge.py
Original file line number Diff line number Diff line change
@@ -407,8 +407,13 @@ def show_prs(self, state=None, purge=None):
ui.echo(f"Merge file: {self.merges_path}")
all_prs = aggregator.collect_prs_info()
if state is not None:
# filter only our state
all_prs = {k: v for k, v in all_prs.items() if k == state}
if state == "merged":
all_prs = {"closed": all_prs.get("closed", [])}
all_prs["closed"] = [
pr for pr in all_prs["closed"] if pr.get("merged") == "merged"
]
else:
all_prs = {k: v for k, v in all_prs.items() if k == state}
for pr_state, prs in all_prs.items():
ui.echo(f"State: {pr_state}")
for i, pr_info in enumerate(prs, 1):
Loading