Skip to content

Conversation

@ritwik-g
Copy link
Contributor

Related Issues

Fixes #4

Changes Made

  • Added BaseCommand class with core functionality:
    • Configuration loading and saving with JSON schema validation
    • Lock management for thread safety using fcntl
    • Command execution flow with proper cleanup
  • Added comprehensive test suite with 100% coverage
  • Updated .gitignore to exclude lock file
  • Updated tasks.md with completion status

Testing Done

  • Added unit tests
    • Test configuration loading/saving
    • Test lock acquisition and release
    • Test error handling and cleanup
  • Manually tested
  • Updated test documentation

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • I have updated the documentation accordingly
  • All new and existing tests passed
  • My commits follow the project's commit message convention

Type of Change

  • Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Code Style Update
  • Refactoring
  • CI/CD
  • Other

Breaking Change

  • No
  • Yes

Additional Information

This PR adds the base command handling infrastructure that will be used by all other commands in the plugin. The BaseCommand class provides:

  1. Thread-safe configuration management using file locking
  2. JSON schema validation for configuration
  3. Proper cleanup of resources in error cases
  4. Clear extension points for subclasses

All code follows the project's style guidelines and has full test coverage.

1. Add BaseCommand class with core functionality:
   - Configuration loading and saving
   - Lock management for thread safety
   - Command execution flow

2. Add comprehensive test suite with 100% coverage:
   - Test configuration loading/saving
   - Test lock acquisition and release
   - Test error handling and cleanup

3. Update .gitignore to exclude lock file
4. Update tasks.md with completion status
@sonarqubecloud
Copy link

@ritwik-g ritwik-g merged commit da591fc into main Feb 21, 2025
9 checks passed
@ritwik-g ritwik-g deleted the feature/add-base-command branch February 21, 2025 08:28
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 base classes to represent the yaml structure (without the secrets)

2 participants