Jens-G opened a new pull request, #3871: URL: https://github.com/apache/thrift/pull/3871
Fixes [THRIFT-6278](https://issues.apache.org/jira/browse/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.py` looks up the tickets it finds in commit messages with `key 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 da6ed655d is read as THRIFT-0. Because of it, the extra lookup of the `--jira-version` run (22 keys) fails every time. ### Changes - The key lookup sends `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. - The fixVersion query keeps the check on purpose. Without it, an unknown fix version returns no tickets, and an unknown name in `resolution not in (...)` excludes nothing, both without an error. - The ticket pattern skips a number followed by `.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) | query | result | |---|---| | `key in (...)` with 25 keys or fewer, one of them unknown | HTTP 400, every ticket lost | | the same with 26 keys or more | 200, unknown key skipped | | the same with `validateQuery=false` | 200, unknown key skipped | | `validateQuery=strict`, `warn` or `none` | same as `false`, no warnings returned | | a JQL syntax error, any `validateQuery` | HTTP 400 | ### Testing - `python3 -m unittest build.test_generate_changes`: 43 tests pass on Python 3.13, and on Python 3.10 in `thrift: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, and `thrift-0.24.0` was 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 #3869, because THRIFT-0 never produced an entry. The `--jira-version 0.25.0` run no longer gets the 400. Its extra lookup of 21 tickets now succeeds, and the filter from #3869 skips all of them. - flake8 and codespell report nothing new for the two files. - [x] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? THRIFT-6278 - [x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"? - [x] Did you squash your changes to a single commit? One commit on top of #3869. - [x] 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](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
