Skip to content

v2.1.x Chore - Check License in CI Testing #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
7 tasks
reactive-firewall opened this issue Apr 17, 2025 · 0 comments
Open
7 tasks

v2.1.x Chore - Check License in CI Testing #368

reactive-firewall opened this issue Apr 17, 2025 · 0 comments
Labels
Chore Miscellaneous chores to maintain the project CI Continuous Integration Tooling enhancement New feature or request Multicast Any main project file changes Testing Something can be verified

Comments

@reactive-firewall
Copy link
Owner

🤔 Good idea; We should include the License in testing:

Test Criteria:

  • CLI license availability (loose acceptance test)
  • availability of online license at official URL
    • response contains key aspects:
      • contains phrase "MIT License" or equivalent forms (MUST check for word "license" at least) (case insensitive)
      • contains phrase 'THE SOFTWARE IS PROVIDED "AS IS"',
      • contains phrase "WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED"
      • contains other relevant text after the phrase "Included" (case insensitive)
      • contains other relevant text after the phrase "Acknowledgments" (case insensitive)
    • (EXTRA) should have high similarity to the actual file LICENSE.md (select lines MUST match by HASH)

Additional Context

This GHI is in response to the following comment

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@reactive-firewall I've verified the URL https://raw.githubusercontent.com/reactive-firewall/multicast/HEAD/LICENSE.md and confirmed it works correctly. This format with the HEAD reference will indeed always point to the latest version of the license file in the repository, making it highly available as you noted.

I found that:

  1. setup.py currently contains this reference which would need updating:

    "LICENSE": ["LICENSE.md", "http://www.github.com/reactive-firewall/multicast/LICENSE"],
  2. The GitHub Action in .github/workflows/pythonpackage.yml only checks for the presence of the local LICENSE.md file and doesn't validate any URLs.

This raw URL format is an excellent choice for package metadata purposes, including the TOML configuration you mentioned earlier.


🏁 Script executed:

#!/bin/bash
# Check the HTTP status code and response for the newly suggested URL
echo "Testing URL: https://raw.githubusercontent.com/reactive-firewall/multicast/HEAD/LICENSE.md"
curl -sI "https://raw.githubusercontent.com/reactive-firewall/multicast/HEAD/LICENSE.md" | head -n 10

# Check setup.py for where license URL might be referenced
echo -e "\nChecking for license URL in setup.py:"
if [ -f "setup.py" ]; then
    grep -i "license" setup.py
fi

# Check for GitHub Actions that might reference license
echo -e "\nChecking GitHub Actions for license checks:"
fd -e yml -e yaml . .github/workflows/ -x grep -i -l "licen[sc]e" {} \; | xargs -I {} sh -c 'echo "File: {}"; cat {} | grep -i -A 3 -B 3 "licen[sc]e"'

Length of output: 2739


@reactive-firewall I've verified that the URL https://raw.githubusercontent.com/reactive-firewall/multicast/HEAD/LICENSE.md returns a valid 200 response and is accessible. This is a good choice as it will always reference the latest version of your license file regardless of branch changes.

I found these references to the license URL in your codebase that would need updating:

  1. In setup.py, there's a header comment referencing:

    # You may obtain a copy of the License at
    # http://www.github.com/reactive-firewall/multicast/LICENSE
    
  2. Your CI-BUILD workflow has a step that displays license information with:

    - name: Test Info
      id: test-info
      run: python -m setup --name --version --license || true ;

This raw URL format with HEAD reference is an excellent choice for ensuring high availability and consistent access to the current license document.


✏️ Learnings added
Learnt from: reactive-firewall
URL: https://github.com/reactive-firewall/multicast/issues/335

Timestamp: 2025-04-16T23:24:38.078Z
Learning: For the multicast project, the raw GitHub URL with HEAD reference (e.g., `https://raw.githubusercontent.com/reactive-firewall/multicast/HEAD/LICENSE.md`) is preferred for package metadata and automated processes, providing a stable reference to the most current version of the license file.

Learnt from: reactive-firewall
URL: https://github.com/reactive-firewall/multicast/issues/335

Timestamp: 2025-04-16T23:24:38.078Z
Learning: For the multicast project, the raw GitHub URL with HEAD reference (e.g., `https://raw.githubusercontent.com/reactive-firewall/multicast/HEAD/LICENSE.md`) is preferred for package metadata and automated processes, providing a stable reference to the most current version of the license file.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


Originally posted by @coderabbitai in #335

@reactive-firewall reactive-firewall added CI Continuous Integration Tooling enhancement New feature or request Multicast Any main project file changes Testing Something can be verified labels Apr 17, 2025
@reactive-firewall reactive-firewall added the Chore Miscellaneous chores to maintain the project label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore Miscellaneous chores to maintain the project CI Continuous Integration Tooling enhancement New feature or request Multicast Any main project file changes Testing Something can be verified
Projects
Status: To do
Development

No branches or pull requests

1 participant