Skip to content

chore: fix flaky license check for dario.cat/mergo#397

Closed
tsivaprasad wants to merge 1 commit into
mainfrom
PLAT-637-fix-flaky-license-ci-check-caused-by-dario-cat-dns-failures
Closed

chore: fix flaky license check for dario.cat/mergo#397
tsivaprasad wants to merge 1 commit into
mainfrom
PLAT-637-fix-flaky-license-ci-check-caused-by-dario-cat-dns-failures

Conversation

@tsivaprasad
Copy link
Copy Markdown
Contributor

@tsivaprasad tsivaprasad commented Jun 3, 2026

Summary

This PR addresses license compliance failures caused by the expired dario.cat/mergo license lookup by excluding it from automated license scanning and providing a static license entry in NOTICE.txt.

Changes

  • Added --ignore dario.cat/mergo to the go-licenses report command in the Makefile to avoid unreliable DNS lookups for dario.cat.
  • Added a static dario.cat/mergo BSD-3-Clause license entry to NOTICE.txt.tmpl (following the same approach used for paho.golang) to maintain license compliance.

PLAT-626

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request adds the dario.cat/mergo dependency to the project's generated license notices. The template is updated with the new third-party notice including version metadata and BSD-3-Clause license text; the build system is configured to handle this dependency; and the generated notice file is updated accordingly.

Changes

License Notice Addition

Layer / File(s) Summary
License notice template definition
NOTICE.txt.tmpl
Template adds a new third-party notice section for dario.cat/mergo (v1.0.0, BSD-3-Clause) with full license text before the main rendering loop.
Build configuration update
Makefile
Makefile adds dario.cat/mergo to the go-licenses report ignore list within the licenses target.
Generated notice output
NOTICE.txt
NOTICE.txt reflects the template changes with dario.cat/mergo section header, attribution lines, and boundary formatting.

Poem

🐰 A license to merge, in templates we trace,
with BSD-3 in its rightful place,
The notices build, from template to file,
Dependencies listed with mergo in style!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes Summary and Changes sections, references the related JIRA issue PLAT-626, but lacks Testing and Checklist sections required by the repository template. Add Testing section documenting how to verify the license check fix, and complete the Checklist section (particularly confirming whether tests were added/updated and if changelog entry is needed).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely describes the main change: fixing a flaky license check for dario.cat/mergo, which aligns with the changeset's objective of addressing license compliance failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PLAT-637-fix-flaky-license-ci-check-caused-by-dario-cat-dns-failures

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
Makefile (1)

149-159: ⚡ Quick win

Update the comment to document the new ignore entry and fix typo.

The comment should explain why dario.cat/mergo is ignored, and there's a typo in the filename reference.

📝 Proposed comment update
 # Exclude some dependencies from NOTICE.txt generation
 # - github.com/pgEdge/control-plane is our own code
-# - github.com/eclipse/paho.golang is licensed under EDL-1.0 explicitly in # NOTICES.txt.tmpl
+# - github.com/eclipse/paho.golang is licensed under EDL-1.0 explicitly in NOTICE.txt.tmpl
+# - dario.cat/mergo is licensed under BSD-3-Clause explicitly in NOTICE.txt.tmpl (DNS lookups for dario.cat are unreliable)
 .PHONY: licenses
 licenses:
 	GOOS=linux $(go-licenses) check ./...
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 149 - 159, Update the comment above the Makefile
target licenses to both document why dario.cat/mergo is excluded and fix the
filename typo: replace the existing comment that mentions "# NOTICES.txt.tmpl"
with a clear note that github.com/pgEdge/control-plane is our own code,
github.com/eclipse/paho.golang is explicitly licensed under EDL-1.0 in
NOTICE.txt.tmpl, and that dario.cat/mergo is ignored because it is (e.g.) a
bundled/merged dependency or otherwise exempt from NOTICE generation in our
build; ensure the reference matches the template used by the target
(--template=NOTICE.txt.tmpl) and correct the typo to NOTICE.txt.tmpl.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@NOTICE.txt.tmpl`:
- Around line 31-67: Update the dario.cat/mergo NOTICE entry so the license URL
does not redirect: replace the current GitHub blob URL
(https://github.com/imdario/mergo/blob/v1.0.0/LICENSE) with a non-redirecting
URL that returns 200 (for example the raw file URL like
https://raw.githubusercontent.com/imdario/mergo/v1.0.0/LICENSE) in the
NOTICE.txt.tmpl dario.cat/mergo section (version v1.0.0) so automated checks
resolve the license link directly.

---

Nitpick comments:
In `@Makefile`:
- Around line 149-159: Update the comment above the Makefile target licenses to
both document why dario.cat/mergo is excluded and fix the filename typo: replace
the existing comment that mentions "# NOTICES.txt.tmpl" with a clear note that
github.com/pgEdge/control-plane is our own code, github.com/eclipse/paho.golang
is explicitly licensed under EDL-1.0 in NOTICE.txt.tmpl, and that
dario.cat/mergo is ignored because it is (e.g.) a bundled/merged dependency or
otherwise exempt from NOTICE generation in our build; ensure the reference
matches the template used by the target (--template=NOTICE.txt.tmpl) and correct
the typo to NOTICE.txt.tmpl.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57b9ead8-2725-448d-90f3-36cdbb2c9d14

📥 Commits

Reviewing files that changed from the base of the PR and between dd1ca23 and 7eccd34.

📒 Files selected for processing (3)
  • Makefile
  • NOTICE.txt
  • NOTICE.txt.tmpl

Comment thread NOTICE.txt.tmpl
Comment on lines +31 to +67
## dario.cat/mergo

* Name: dario.cat/mergo
* Version: v1.0.0
* License: [BSD-3-Clause](https://github.com/imdario/mergo/blob/v1.0.0/LICENSE)

```
Copyright (c) 2013 Dario Castañé. All rights reserved.
Copyright (c) 2012 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify dario.cat/mergo version, license URL, and license text

echo "=== Checking go.mod for dario.cat/mergo version ==="
rg -n "dario.cat/mergo" go.mod

echo -e "\n=== Verifying license URL accessibility ==="
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" "https://github.com/imdario/mergo/blob/v1.0.0/LICENSE"

echo -e "\n=== Fetching actual license text from repository ==="
curl -s "https://raw.githubusercontent.com/imdario/mergo/v1.0.0/LICENSE"

Repository: pgEdge/control-plane

Length of output: 1805


Adjust dario.cat/mergo NOTICE entry to ensure the license URL resolves cleanly

  • go.mod specifies dario.cat/mergo v1.0.0 (indirect), matching the NOTICE version.
  • The BSD-3-Clause license text for v1.0.0 matches the text included in NOTICE.txt.tmpl (lines 31-67).
  • The provided GitHub license link returns an HTTP 301 (redirect) when fetched; update it to a URL that returns 200 directly (or a non-redirecting equivalent) to avoid compliance/automation issues.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@NOTICE.txt.tmpl` around lines 31 - 67, Update the dario.cat/mergo NOTICE
entry so the license URL does not redirect: replace the current GitHub blob URL
(https://github.com/imdario/mergo/blob/v1.0.0/LICENSE) with a non-redirecting
URL that returns 200 (for example the raw file URL like
https://raw.githubusercontent.com/imdario/mergo/v1.0.0/LICENSE) in the
NOTICE.txt.tmpl dario.cat/mergo section (version v1.0.0) so automated checks
resolve the license link directly.

@tsivaprasad
Copy link
Copy Markdown
Contributor Author

Addressed same issue as part of #396

@tsivaprasad tsivaprasad closed this Jun 3, 2026
@tsivaprasad tsivaprasad deleted the PLAT-637-fix-flaky-license-ci-check-caused-by-dario-cat-dns-failures branch June 3, 2026 17:18
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.

1 participant