Replace click.MultiCommand with click.Group#2096
Conversation
click.MultiCommand is deprecated and will be removed in click 9. This change migrates to click.Group which is the recommended replacement. - Changed ElementaryCLI base class from click.MultiCommand to click.Group - Replaced @click.command with @click.group decorator - Removed _CMD_MAP dictionary and list_commands() method - Added commands using cli.add_command() instead - Updated get_command() to call super().get_command() Fixes ELE-5220 Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
👋 @devin-ai-integration[bot] |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe CLI base class was migrated from the deprecated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing touches
Comment |
Summary
Migrates the CLI from the deprecated
click.MultiCommandtoclick.Group.click.MultiCommandwill be removed in click 9, so this change prepares the codebase for future click upgrades.Changes:
ElementaryCLIbase class fromclick.MultiCommandtoclick.Group@click.commandwith@click.groupdecorator_CMD_MAPdictionary andlist_commands()method (now handled byclick.Groupinternally)cli.add_command()instead of dictionary lookupget_command()to delegate tosuper().get_command()while preserving theauto_envvar_prefixsettingReview & Testing Checklist for Human
edr monitor --help,edr report --help,edr send-report --help,edr run-operation --helpedr --helpshows all 4 commands correctlyEDR_*environment variables are recognized)Recommended test plan: Install the package locally (
pip install -e .) and runedr --helpto verify the command list appears correctly, then test at least one subcommand end-to-end.Notes
Fixes ELE-5220
Link to Devin run: https://app.devin.ai/sessions/68de447c968446cc850dc87532c97ffe
Requested by: Itamar Hartstein (@haritamar)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.