This document outlines the contribution guidelines for the Cubbit CLI project. By contributing, you agree to abide by these guidelines and help maintain the quality and consistency of our codebase.
- Development Setup
- Git Workflow
- Code Style Guidelines
- Pull Request Process
- Issue Reporting
- Testing
- Code of Conduct
- Go: Version 1.24.1 or later (latest stable version recommended)
- Git: Version 2.0 or later
- Access: Cubbit account for testing (see setup instructions below)
-
Set up the repository (follow internal setup procedures)
-
Configure development environment (use internal documentation)
-
Set up CLI configuration
# Create .env.local with your endpoints cat > .env.local << EOF iam: https://your-iam-endpoint ch: https://your-ch-endpoint dash: https://your-dash-endpoint EOF
-
Fork and clone
git clone https://github.com/cubbit/composer-cli.git cd composer-cli -
Use your Cubbit account for testing and development
- Configure the CLI with your existing Cubbit credentials
- Test against the production environment
# Build locally
go build -o build/cubbit .
# Verify installation
./build/cubbit --version
./build/cubbit --help- Use clear, descriptive commit messages
- Follow conventional commit format
- Keep commits focused on single changes
- Squash related commits before submitting PR
This project follows Go best practices and official Go Code Review Comments:
- Package naming: Lowercase, descriptive
- Function naming: PascalCase for exported, camelCase for unexported
- Variable naming: Descriptive names, avoid abbreviations
- Error handling: Always check errors, wrap with context
// Error handling
if err != nil {
return fmt.Errorf("%s: %w", constants.ErrorContext, err)
}
// Configuration loading
conf, err := configuration.LoadConfig()
if err != nil {
return fmt.Errorf("%s: %w", constants.ErrorLoadingConfig, err)
}
// Flag retrieval
if value, err = cmd.Flags().GetString("flag-name"); err != nil {
return fmt.Errorf("%s: %w", constants.ErrorRetrievingField, err)
}- Commands: Use Cobra framework following established patterns
- Flags: Use persistent flags for common options
- Output: Support multiple formats (human, json, yaml, xml)
- Errors: Use constants from
constants/errors.go
- Packages: Logical separation of concerns
- Files: Descriptive names indicating functionality
- Constants: Centralized in
constants/package - Utilities: Organized in
utils/package with single responsibility
- Code follows style guidelines
- Comprehensive error handling implemented
- Documentation updated (README, help text, comments)
- Testing with valid access
- Multiple output formats verified
- Branch rebased from latest develop
- Use appropriate template based on change type (bugfix, feature, chore)
- Provide clear description of changes and motivation
- Include testing details and verification steps
- Update documentation as needed
- Reviews are handled by maintainers as time permits
- Complex changes may require additional discussion
- Approval requires at least one maintainer approval
Include the following information:
-
Environment
- OS and version
- Go version
- CLI version (
cubbit --version)
-
Reproduction Steps
- Exact command sequence
- Expected vs actual behavior
- Complete error messages
-
Context
- What you were trying to achieve
- Recent changes to environment/config
Provide these details:
-
Use Case
- Problem description
- Expected benefits
-
Proposed Solution
- Implementation approach
-
Priority
- Impact on workflow
- Estimated user adoption
Due to infrastructure requirements, testing relies on:
-
Real Environment Testing
- Internal contributors: Use development endpoints
- External contributors: Use production with your account
-
Validation Requirements
- Multi-format output compatibility
- Error handling verification
- Edge case testing
# Basic functionality
./build/cubbit --help
./build/cubbit --version
# Output formats
./build/cubbit tenant list --output json
./build/cubbit tenant list --output yaml
./build/cubbit tenant list --output xml
# Error conditions
./build/cubbit tenant describe --id nonexistentFor assistance:
- Check existing issues for similar questions
- Review codebase for established patterns
- Create issue with
questionlabel - Contact maintainers for complex technical questions
This project adheres to our Code of Conduct. All participants are expected to uphold these standards.
Thank you for contributing to Cubbit CLI! Your contributions help improve the tool for the entire Cubbit community.