You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zjncs (via GitHub)" <gi...@apache.org> on 2026/10/06 04:55:52 UTC

[PR] fix(rmqctl): split license attribution on normalized line endings [rocketmq-dashboard]

zjncs opened a new pull request, #5602:
URL: https://github.com/apache/rocketmq-dashboard/pull/5602

   Closes #5601
   
   ## Problem
   
   `license-binary.go` splits the repository LICENSE/NOTICE at an LF-only marker (`"\nThird-party source materials\n"`) to keep the web source-package attribution out of the binary package. On a CRLF checkout — **the Git for Windows default** (`core.autocrlf=true`) — the marker never matches and the entire file (web attribution included) becomes the binary package's LICENSE/NOTICE. The repo's own packaging test pins this contract and fails:
   
   ```
   --- FAIL: TestBinaryLicensePackagingTest/linux
       license-binary_test.go:116: the binary must carry the ASF NOTICE and must not mix in the web
            source-package attribution
   ```
   
   CI (ubuntu, LF checkout) never sees it; Windows contributors with default Git config get a red `go test ./...`, and release materials generated on such a checkout would be non-compliant.
   
   ## Fix
   
   Normalize CRLF before splitting (restores the canonical LF content of the repo files):
   
   ```go
   normalized := strings.ReplaceAll(text, "\r\n", "\n")
   return strings.Split(normalized, "\nThird-party source materials\n")[0]
   ```
   
   ## Verification
   
   - `go test ./scripts/ -run 'TestBinaryLicensePackagingTest/linux' -count=1`: **FAIL on master, PASS with this change** (run on a CRLF checkout; note `-count=1` — the scripts are executed via `go run`, so Go's test cache can mask the red/green)
   - Mutation check: reverting the normalization makes the linux subtest fail again; restoring it passes
   - `go vet ./scripts/` clean
   - The windows subtest of the same test remains red on Windows for an unrelated reason — the packaging script's `python3` fallback hits the Windows Store stub (silent exit 49) and its zip fallback writes backslash entry names; that is a separate defect I'll file next so this change stays minimal
   
   ## Collision note
   
   No open PR touches `rmqctl/scripts/license-binary.go` or `license-binary_test.go` (the nearest, #5432, only touches `build-windows.ps1`).


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(rmqctl): split license attribution on normalized line endings [rocketmq-dashboard]

Posted by "zjncs (via GitHub)" <gi...@apache.org>.
zjncs commented on PR #5602:
URL: https://github.com/apache/rocketmq-dashboard/pull/5602#issuecomment-6076509427

   @lizhimins Trailing newline restored on \`license-binary.go\` (\`gofmt -l .\` clean, \`go build\`/\`go vet\` pass). The branch is also rebased onto \`rocketmq-studio\` (c99b9ad5, where the LF-only split still bites) and the PR retargeted to it. Ready for another look." 2>&1 | python3 -c "import json,sys; print("posted:", json.load(sys.stdin)["html_url"])"


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org