Repository navigation
fix: make jd license URL deterministic before grouping reports - #3534
IrynaKulakova wants to merge 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66177876-e733-4a86-b7bc-236e5d06cbf7
There was a problem hiding this comment.
🟢 Approval recommended
The narrow rewrite matches the pinned dependency, the reports are consistent, and validation remains enforced.
No open issues 🎉
What changed in this PR
Makes jd/v2 license URLs deterministic so identical architecture reports group consistently.
Changes:
- Normalize the verified
v2.5.0URL before sorting and hashing. - Refresh platform reports without changing license validation or workflow notifications.
| File | Description |
|---|---|
| third-party-licenses.windows.md | Uses the canonical license URL. |
| third-party-licenses.linux.md | Uses the canonical license URL. |
| third-party-licenses.darwin.md | Uses the canonical license URL. |
| script/licenses | Normalizes the version-specific URL before grouping. |
Review effort: Max
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66177876-e733-4a86-b7bc-236e5d06cbf7
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66177876-e733-4a86-b7bc-236e5d06cbf7
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66177876-e733-4a86-b7bc-236e5d06cbf7
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66177876-e733-4a86-b7bc-236e5d06cbf7
SoulmatelynchVFX
left a comment
There was a problem hiding this comment.
Review 草稿 · github/github-mcp-server #3534
- PR:
fix: make jd license URL deterministic before grouping reports(OPEN · MERGEABLE · +8/−4 · 4 文件) - 提交方式:
gh pr review 3534 --repo github/github-mcp-server --comment --body-file <本文件正文> - 状态:已备未发,等用户确认
复核依据(本机实测)
| 检查 | 结果 |
|---|---|
GET https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE |
404 |
GET https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE |
200 |
script/licenses 中 sed 作用对象 |
packages_file(哈希输入),且 output_file 由 packages_file 拼装 → 重新生成的三份 report 与本次手改一致 |
| sed 版本硬编码实测(两行输入 v2.5.0 / v2.6.0) | 现 PR 的 sed 只改写 v2.5.0 那行;sed -E 's#(josephburnett/jd/blob/v[^/]+)/v2/LICENSE\)#\1/LICENSE)#g' 两行都改写 |
正文
Checked the pinned tag before reviewing the script change: https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE returns 404 and https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE returns 200, so the URL written into the three reports is the one that resolves.
Also read the surrounding script: the sed is applied to packages_file before compute_hash, and output_file is assembled from packages_file, so the regenerated reports keep the canonical URL and match the committed report edits.
One regression path: the pattern pins both the tag and the whole URL (v2\.5\.0/v2/LICENSE). go-licenses output for a later tag would be .../blob/v2.6.0/v2/LICENSE, which the current pattern leaves untouched, so the per-arch hash difference this change removes can come back on the next bump. Reproduced locally by running the current sed over a two-line input containing the v2.5.0 and v2.6.0 forms — only the v2.5.0 line was rewritten.
A version-independent form behaved the same on v2.5.0 and also rewrote the v2.6.0 line in the same test:
sed -E 's#(josephburnett/jd/blob/v[^/]+)/v2/LICENSE\)#\1/LICENSE)#g'
Not blocking — pinning the tag is a legitimate choice. Mentioning it because the comment added in this PR describes the URL as coming from go-licenses resolution, not from a pinned version.
Summary
Normalize the inconsistent
jd/v2license URL before sorting and hashing architecture reports, preventing spurious license-check failures. Regenerate the Darwin, Linux, and Windows reports with the canonical URL.Why
Addresses the review feedback on #3490. The failed job split otherwise identical Windows architecture reports because
go-licensesemitted different license URLs for the same dependency; making notification failures nonfatal does not fix that mismatch.What changed
https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSEto the verified repository-root license URL before sorting and hashing. This is a version-specific workaround, not a general rewrite of/v2/paths.MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint-script/lintpassed with 0 issues../script/test-script/testpassed, including race tests.Additional validation:
PATH="$(go env GOPATH)/bin:$PATH" script/licenses- passed twice; SHA-256 comparisons confirmed identical reports and all saved license files across consecutive runs.bash -n script/licenses- passed.git diff --check- passed.Docs