THRIFT-6278: Don't lose a CHANGES draft JIRA lookup to one unknown key - #3871
Merged
Merged
Conversation
Client: build The CHANGES draft listed every THRIFT ticket a commit message mentions, without looking at the ticket's Fix Version/s, resolution or status. The 0.25.0 draft therefore carried THRIFT-1337, fixed in 2011, because the THRIFT-6183 commit cites it as history. It also carried other old tickets cited the same way, a Won't Do ticket and tickets that are still open. With --jira-version, the extra lookup of tickets found in git had the same gap. Fetch Fix Version/s, status and resolution with each ticket. Keep a ticket found in git only if JIRA files it under the release version, using the same test as the fixVersion query: the version is among its Fix Version/s, it has a resolution, and it is not Open. The version is --jira-version if given, otherwise --version or configure.ac. A commit whose tickets all fail the test is listed as a commit link under its Client: section instead, and the skipped tickets are named on stderr. The fixVersion query and that test now also leave out tickets resolved without a change, such as Won't Do, Won't Fix, Not A Problem or Cannot Reproduce, even when they carry the fix version. Duplicate still counts. Commit links now also drop a "Patch: Name" or "Autor: Name" trailer from the subject. Such commits used to be hidden behind their ticket. Both JIRA queries now build their entries with one shared helper. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Client: build generate-changes.py looks up the tickets it finds in commit messages with JIRA "key in (...)" searches of up to 50 keys. For a list of 25 keys or fewer, JIRA checks that every key exists and rejects the whole search if one does not, so every ticket in that search was lost. Longer lists are not checked. Such keys do occur. The ticket pattern ignores case, so the path "thrift-0.24.0/lib/cpp/..." in the body of da6ed65 was read as THRIFT-0. On current master this made the extra lookup of the --jira-version run fail every time. Turn the check off for the key lookup and report the keys JIRA does not return instead. The fixVersion query keeps the check: without it, a mistyped version or resolution name would quietly change the result instead of failing. The ticket pattern now skips a number followed by ".digit", as in a version string. Across the whole history this drops only THRIFT-0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5 tasks
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.
Fixes THRIFT-6278.
Stacked on #3869 (THRIFT-6277). Both PRs change the JIRA lookup in
build/generate-changes.py, so this branch builds on that one. Until #3869 is merged, this PR also shows its commit. Only the top commit (THRIFT-6278) is new here, and I'll rebase once #3869 is in.Problem
generate-changes.pylooks up the tickets it finds in commit messages withkey in (...)searches of up to 50 keys. issues.apache.org checks that every key exists only in lists of 25 keys or fewer. If one of those keys does not exist, it rejects the whole search with HTTP 400, and every ticket in that search is lost.Master has such a key today. The ticket pattern ignores case, so the path
thrift-0.24.0/lib/cpp/...in the body of da6ed65 is read as THRIFT-0. Because of it, the extra lookup of the--jira-versionrun (22 keys) fails every time.Changes
validateQuery=false, and the script itself reports keys that JIRA does not return (Warning: referenced tickets not found in JIRA: ...). The ticket suggested retrying without the key named in the error message. Turning the check off needs no extra request and does not depend on the wording of JIRA's error.resolution not in (...)excludes nothing, both without an error..digit, as in a version string. Across all 7,977 commits on master this drops only THRIFT-0 (2 commits). The 794 other matches followed by a dot are kept.How issues.apache.org behaves (probed)
key in (...)with 25 keys or fewer, one of them unknownvalidateQuery=falsevalidateQuery=strict,warnornonefalse, no warnings returned: onlytrue, the default, validatesvalidateQueryTesting
python3 -m unittest build.test_generate_changes: 43 tests pass on Python 3.13, and on Python 3.10 inthrift:jammy. The fake JIRA in the tests now rejects short key lists with an unknown key, like the real server. The new tests failed before the fix: THRIFT-6183 went missing next to THRIFT-0 or next to a mistyped key, andthrift-0.24.0was read as THRIFT-0.Live lookup of
THRIFT-99999, THRIFT-1337: the old code returns nothing (HTTP 400). The new code returns THRIFT-1337 and names THRIFT-99999 as not found.Live runs over
v0.24.0..master: the git-only draft is byte-identical to the one from THRIFT-6277: List only tickets fixed in the release in the CHANGES draft #3869, because THRIFT-0 never produced an entry. The--jira-version 0.25.0run no longer gets the 400. Its extra lookup of 21 tickets now succeeds, and the filter from THRIFT-6277: List only tickets fixed in the release in the CHANGES draft #3869 skips all of them.flake8 and codespell report nothing new for the two files.
Did you create an Apache Jira ticket? THRIFT-6278
If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
Did you squash your changes to a single commit? One commit on top of THRIFT-6277: List only tickets fixed in the release in the CHANGES draft #3869.
Did you do your best to avoid breaking changes? Only the generated draft and the script's log output change.
If your change does not involve any code, include
[skip ci]anywhere in the commit message. (n/a, this changes a script)🤖 Generated with Claude Code