feat: add infrahubctl availability detection and warnings#72
Merged
Conversation
Implements comprehensive infrahubctl detection to warn users when the tool is missing from their Python environment. Key features: - InfrahubctlChecker utility class for environment detection - Status bar warning indicator for missing infrahubctl - Pre-command validation with user-friendly dialogs - Enhanced error messages with installation guidance - Configurable warning behavior via settings - Graceful degradation allowing other extension features to work Resolves: #71 Changes: - Added src/common/infrahubctlChecker.ts for detection logic - Extended extension.ts with state management and status bar - Enhanced utilities.ts with pre-command validation - Updated commands.ts to check infrahubctl before execution - Added configuration options for warnings and custom paths - Improved error handling with actionable guidance Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Adds the standard claude-code-action workflow that responds to @claude mentions on PRs and issues. This enables requesting changes on PRs created by the implement workflow. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Collaborator
|
@claude can you update the PR to link to docs https://docs.infrahub.app/python-sdk/guides/installation and also use the command to install only via uv like so uv add "infrahub-sdk[all]" |
Author
|
Claude finished @minitriga's task in 1m 38s —— View job Updates completed
Changes MadeUpdated installation guidance across three files:
NoteI've committed the changes locally (commit Local commit created: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #71
Changes
This PR implements comprehensive infrahubctl detection to warn users when the tool is missing from their Python environment, addressing the issue where users experience cryptic failures when
infrahubctlis not installed.Key Features
🔍 InfrahubctlChecker Utility Class
infrahub-vscode.showInfrahubctlWarningssetting🛡️ Pre-Command Validation
📋 Enhanced Commands with Validation
checkAllSchemaFiles()- Pre-flight infrahubctl checkloadAllSchemaFiles()- Pre-flight infrahubctl checkcheckSchemaFile()- Pre-flight infrahubctl checkloadSchemaFile()- Pre-flight infrahubctl checkrunTransformCommand()- Pre-flight infrahubctl check🚨 Improved Error Handling
⚙️ New Configuration Options
infrahub-vscode.showInfrahubctlWarnings(boolean, default: true) - Control warning visibilityinfrahub-vscode.infrahubctlPath(string, optional) - Custom infrahubctl path overrideUser Experience Improvements
Files Modified
src/common/infrahubctlChecker.ts- New utility class for detection logicsrc/extension.ts- Extension state management and status bar integrationsrc/common/utilities.ts- Pre-command validation and enhanced error handlingsrc/common/commands.ts- Integration of infrahubctl checks in affected commandspackage.json- New configuration options and command registrationTesting
✅ Compilation successful (
npm run compile)✅ Linting passes (
npm run lint)✅ Follows existing code patterns and architecture
✅ Proper disposal handling for status bar items
✅ Timeout handling for API calls included
Generated by Claude
Implemented from the detailed plan in issue #71 comments.