Repository navigation
prsync tabs --close-merged: one all-no-PR search chunk marks tickets unknown and vetoes every merged close - #398
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #397
searchAuthoredTicketsmarked every ticket in a multi-ticket chunkunknownwhen that chunk mapped no PR, even if another chunk in the same run had already mapped one.UntrustedCloseReasonthen refused--close-mergedfor the whole set, including tabs already classifiedmerged.unknownonly when no chunk mapped a PR and more than one ticket was searched. An empty chunk isno_prwhen another chunk mapped a result. A fully empty multi-ticket sweep still warns and staysunknown.unknownbucket indevtools/prsync/README.orgmatches that rule.Demo
Before, six PR-less tickets in the first search chunk and a merged ticket in the next:
After, those six are
no_pr, the merged ticket staysmerged, and there is no unknown warning, so--close-mergedcan close it. Two chunks that both map nothing stayunknown, with one warning per chunk.Test plan
TestOrphansEmptyChunkIsNoPRWhenAnotherChunkMappedfailed first withwarnings = [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)TestOrphansAllEmptyMultiChunksStayUnknown,TestOrphansChunksWhenOverFiveOROperators, andTestOrphansEmptySweepIsUnknownNotNoPRgo test ./devtools/prsync/...passedGOPACKAGESDRIVER= golangci-lint run ./devtools/prsync/internal/scan/...reported 0 issues, andgolangci-lint run ./...duringmake checkreported 0 issuesmake check-semgrep,make check-bazel-go-files, andmake check-org-lint-testspassed (semgrep: 647 rules, 0 findings)make checkis greenmake checkfailed inoserrorsgodernizeon four existingos.IsNotExistdiagnostics indevtools/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, andcheck-org-lint-testsdid not run inside thatmake checkbecauselint-golangcistopped 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.
UntrustedCloseReasonis unchanged. A merged tab is no longer paired withunknownfrom an empty sibling chunk, so the close proceeds. A sweep that maps nothing is still refused.