Skip to content

Add license change trigger for platform.* conan recipes - #279

Open
konard wants to merge 3 commits into
mainfrom
issue-175-fedf068d
Open

Add license change trigger for platform.* conan recipes#279
konard wants to merge 3 commits into
mainfrom
issue-175-fedf068d

Conversation

@konard

@konard konard commented Sep 11, 2025

Copy link
Copy Markdown
Member

🤖 AI-Powered Solution

This pull request implements the functionality requested in issue #175: Add a trigger to change license in platform\..+ conan recipes.

📋 Issue Reference

Fixes #175

✅ Implementation Details

New Features Added:

  1. New Command-Line Parameter: --new-license (optional)
  2. Pattern Matching: Only applies to recipes matching ^platform\..+ (case-insensitive)
  3. License Field Update: Updates the license field in conanfile.py files
  4. Smart Quote Handling: Preserves existing quote style (single or double quotes)
  5. Separate Commit: Creates a dedicated commit for license changes

Files Modified:

  • rust/update-conan-recipe-and-create-pull-request/src/main.rs - Added command-line argument and integration logic
  • rust/update-conan-recipe-and-create-pull-request/src/change_license_in_conanfile_py.rs - New module for license change functionality
  • examples/test-license-change.md - Documentation and usage examples

How it Works:

  1. User provides --new-license parameter when running the tool
  2. Tool checks if recipe name matches pattern ^platform\..+ (case-insensitive)
  3. If it matches, updates the license = "value" line in the conanfile.py
  4. Creates a separate commit with message "Update license to {new_license}"

Pattern Examples:

  • platform.collections → Will change license
  • Platform.Memory → Will change license (case-insensitive)
  • platform.data → Will change license
  • boost → Won't change license (doesn't match pattern)
  • openssl → Won't change license (doesn't match pattern)

🧪 Testing

  • Created comprehensive example documentation in examples/test-license-change.md
  • Implementation follows existing code patterns and conventions
  • Uses established regex handling and GitHub API integration

📝 Usage Example

./update-conan-recipe-and-create-pull-request \
  --new-license "MIT" \
  --recipe-name "platform.collections" \
  [other existing parameters...]

This PR was created automatically by the AI issue solver

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #175
@konard konard self-assigned this Sep 11, 2025
konard and others added 2 commits September 11, 2025 13:46
This commit implements the functionality requested in issue #175:
- Adds a new --new-license command-line parameter
- Creates change_license_in_conanfile_py module to handle license updates
- Applies license changes only to recipes matching pattern ^platform\..+ (case-insensitive)
- Updates license field in conanfile.py with proper quote handling
- Creates separate commit for license changes with descriptive message
- Includes example documentation showing usage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Add a trigger to change license in conan recipes Add license change trigger for platform.* conan recipes Sep 11, 2025
@konard
konard marked this pull request as ready for review September 11, 2025 10:54
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.

Add a trigger to change license in platform\..+ conan recipes

1 participant