Skip to content

prsync tabs --close-merged: one all-no-PR search chunk marks tickets unknown and vetoes every merged close - #398

Merged
jaeyeom merged 1 commit into
mainfrom
issue-397-close-merged-empty-chunk
Oct 14, 2026
Merged

jaeyeom merged 1 commit into
mainfrom
issue-397-close-merged-empty-chunk

Conversation

@jaeyeom

@jaeyeom jaeyeom commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Summary

Resolves #397

  • searchAuthoredTickets marked every ticket in a multi-ticket chunk unknown when that chunk mapped no PR, even if another chunk in the same run had already mapped one. UntrustedCloseReason then refused --close-merged for the whole set, including tabs already classified merged.
  • The sweep is unknown only when no chunk mapped a PR and more than one ticket was searched. An empty chunk is no_pr when another chunk mapped a result. A fully empty multi-ticket sweep still warns and stays unknown.
  • The unknown bucket in devtools/prsync/README.org matches that rule.

Demo

Before, six PR-less tickets in the first search chunk and a merged ticket in the next:

search "AP-1 OR AP-2 OR AP-3 OR AP-4 OR AP-5 OR AP-6" returned no matching PRs for any of 6 tickets; treating as unknown
close-merged refused: search classification is unknown

After, those six are no_pr, the merged ticket stays merged, and there is no unknown warning, so --close-merged can close it. Two chunks that both map nothing stay unknown, with one warning per chunk.

Test plan

  • TestOrphansEmptyChunkIsNoPRWhenAnotherChunkMapped failed first with warnings = [search "AP-1 OR AP-2 OR AP-3 OR AP-4 OR AP-5 OR AP-6" returned no matching PRs for any of 6 tickets; treating as unknown], then passed (bazel test //devtools/prsync/internal/scan:go_default_test --test_filter='TestOrphansEmptyChunkIsNoPRWhenAnotherChunkMapped|TestOrphansAllEmptyMultiChunksStayUnknown|TestOrphansChunksWhenOverFiveOROperators|TestOrphansEmptySweepIsUnknownNotNoPR' --test_output=all --test_arg=-test.v)
  • That same run passed TestOrphansAllEmptyMultiChunksStayUnknown, TestOrphansChunksWhenOverFiveOROperators, and TestOrphansEmptySweepIsUnknownNotNoPR
  • go test ./devtools/prsync/... passed
  • GOPACKAGESDRIVER= golangci-lint run ./devtools/prsync/internal/scan/... reported 0 issues, and golangci-lint run ./... during make check reported 0 issues
  • make check-semgrep, make check-bazel-go-files, and make check-org-lint-tests passed (semgrep: 647 rules, 0 findings)
  • make check is green

make check failed in oserrorsgodernize on four existing os.IsNotExist diagnostics in devtools/setup-dev/ansible/packages_data_test.go (lines 986, 1001, 1016, and 1154). Those are the diagnostics recorded on #396. check-semgrep, check-bazel-go-files, and check-org-lint-tests did not run inside that make check because lint-golangci stopped it. They were run separately and passed. bazel test //... reported 330 tests passed.

Reviewer notes

This is the first option in #397: trust the sweep per run. UntrustedCloseReason is unchanged. A merged tab is no longer paired with unknown from an empty sibling chunk, so the close proceeds. A sweep that maps nothing is still refused.

…d a PR

An all-no-PR chunk was marked unknown even when another chunk in the
same run mapped a ticket. That unknown vetoed --close-merged for every
merged tab.

Classify those tickets as no_pr when any chunk mapped a result. A sweep
that maps nothing, with more than one ticket, stays unknown.

Resolves #397
@jaeyeom jaeyeom self-assigned this Oct 14, 2026
@jaeyeom
jaeyeom marked this pull request as ready for review October 14, 2026 17:36
@jaeyeom
jaeyeom merged commit 140ce3b into main Oct 14, 2026
10 checks passed
@jaeyeom
jaeyeom deleted the issue-397-close-merged-empty-chunk branch October 14, 2026 17:37
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.

prsync tabs --close-merged: one all-no-PR search chunk marks tickets unknown and vetoes every merged close

1 participant