Skip to content

fix: make jd license URL deterministic before grouping reports - #3534

Open
IrynaKulakova wants to merge 6 commits into
mainfrom
irynakulakova-pr-3490-feedback
Open

IrynaKulakova wants to merge 6 commits into
mainfrom
irynakulakova-pr-3490-feedback

Conversation

@IrynaKulakova

Copy link
Copy Markdown
Contributor

Summary

Normalize the inconsistent jd/v2 license 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-licenses emitted different license URLs for the same dependency; making notification failures nonfatal does not fix that mismatch.

What changed

  • Normalize only https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE to the verified repository-root license URL before sorting and hashing. This is a version-specific workaround, not a general rewrite of /v2/ paths.
  • Regenerate all three platform reports. Preserve the final validation failure gate and leave workflow notification behavior unchanged.

MCP impact

  • No tool or API changes - only license-report generation and generated reports change.
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

  • N/A - no tool changes.

Security / limits

  • No security or limits impact - license validation remains enforced; no permissions change.
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR - no tool definitions change.

Note: 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

  • Linted locally with ./script/lint - script/lint passed with 0 issues.
  • Tested locally with ./script/test - script/test passed, 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.
  • Focused normalization assertions passed: the incorrect URL is corrected; the canonical URL, other versions, other modules, and other filenames remain unchanged. The final failure gate remains intact.
  • git diff --check - passed.

Docs

  • Not needed
  • Updated (README / docs / examples) - regenerated the three platform license reports; no MCP documentation changes needed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 66177876-e733-4a86-b7bc-236e5d06cbf7
@IrynaKulakova
IrynaKulakova requested a review from a team as a code owner October 19, 2026 15:23
Copilot AI max review requested due to automatic review settings October 19, 2026 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.0 URL 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Focused checks confirm URL convergence, unrelated URLs remain unchanged, and the generated reports match the correction.

No open issues 🎉

Review effort: Max

Comment thread script/licenses Resolved
IrynaKulakova and others added 5 commits October 21, 2026 14:50
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 SoulmatelynchVFX left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants