Repository navigation
Complete finding resolution with legacy stdout encodings #1565
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
Changes from all commits
e2df91b
a3deb60
33d2d58
cc60ef9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1827,18 +1827,18 @@ def _delete_tracking_ref(wt: Path, branch: str, expected_head: str) -> None: | |
|
|
||
|
|
||
| def cmd_resolve(args: argparse.Namespace) -> int: | ||
| """List open blocking findings, or reply to one with what changed and resolve its thread.""" | ||
| encoding = getattr(sys.stdout, "encoding", None) or "utf-8" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Unrelated removal of the cmd_resolve docstring This diff replaces the docstring "List open blocking findings, or reply to one with what changed and resolve its thread." with the |
||
| wt, config = _context(args, pin_checks=True) # publishers come from the base, not the PR | ||
| pr = _require_pr(config, worktree.branch(wt)) | ||
| if pr.base_ref != config.base_branch: # trusted publishers belong to the configured base | ||
| raise CliError(f"PR #{pr.number} targets {pr.base_ref}, configured base is {config.base_branch}") | ||
| publishers = config.review_publishers or (github.login(),) | ||
| if not args.finding: | ||
| for marker_id, _thread, f in github.open_findings(config.repo, pr.number, publishers): | ||
| print(f"{marker_id} {f.severity} {f.path or '-'}:{f.line or '-'} {f.title}") | ||
| print(f"{marker_id} {f.severity} {f.path or '-'}:{f.line or '-'} {f.title}".encode(encoding, "backslashreplace").decode(encoding)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: The same encode/decode escaping is written out twice Both resolve prints (lines 1675 and 1678) repeat |
||
| return 0 | ||
| finding = github.resolve_finding(config.repo, pr.number, args.finding, args.reply, publishers) | ||
| print(f"resolved {args.finding}: {finding.title}") | ||
| print(f"resolved {args.finding}: {finding.title}".encode(encoding, "backslashreplace").decode(encoding)) | ||
| try: | ||
| with github.api_error_diagnostics(): | ||
| remaining = github.open_blocking_findings(config.repo, pr.number, None, publishers) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Merge resolution dropped the cmd_resolve docstring that main added
When the conflict was resolved, the branch's
encoding = ...line replaced main's docstring"""List open blocking findings, or reply to one with what changed and resolve its thread."""instead of being added after it. Nothing else in the repo contains that docstring, and nothing readscmd_resolve.__doc__, because argparse help only uses__doc__in eligibility.py. So nothing breaks, but the merge quietly undoes documentation from #1863 that this task never meant to touch. Smallest fix: put the docstring back as the first statement ofcmd_resolveand keep theencodingline below it.