RESOLVED FIXED312300
prepare-commit-msg: add unit test for git hook's get_bugs_string() to prevent future regressions
https://bugs.webkit.org/show_bug.cgi?id=312300
Summary prepare-commit-msg: add unit test for git hook's get_bugs_string() to prevent...
David Kilzer (:ddkilzer)
Reported 2026-04-14 12:29:08 PDT
The `get_bugs_string()` function in the `prepare-commit-msg` git hook directly references `radar.Tracker.RES` to detect radar URLs in commit messages. When 311151@main refactored `from_string()` to use `parse_id()`, it removed the `RES` attribute from `radar.Tracker`, breaking the hook with an `AttributeError`. This was fixed by 311158@main, but there is no unit test to prevent the regression from recurring. Add a unit test that renders the real `prepare-commit-msg` hook template via `jinja2.Template` (same as `InstallHooks.main()`), loads the rendered script via `importlib.util`, and tests `get_bugs_string()` to verify `radar.Tracker.RES` is present and correctly matches radar URL formats.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-14 12:29:15 PDT
David Kilzer (:ddkilzer)
Comment 2 2026-04-14 12:53:11 PDT
EWS
Comment 3 2026-04-14 13:19:11 PDT
Committed 311223@main (97f987bedded): <https://commits.webkit.org/311223@main> Reviewed commits have been landed. Closing PR #62760 and removing active labels.
Jonathan Bedard
Comment 4 2026-04-15 11:56:58 PDT
EWS
Comment 5 2026-04-15 13:33:48 PDT
Committed 311315@main (2625dd9448f9): <https://commits.webkit.org/311315@main> Reviewed commits have been landed. Closing PR #62837 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.