Thank you for your interest in contributing to azd-copilot! This document provides guidelines for contributing to the project.
Before contributing, ensure you have the following installed:
- Go: 1.25 or later
- Node.js: 20.0.0 or later
- pnpm: 9.0.0 or later
- Azure Developer CLI (azd): Latest version
You can verify your versions:
go version # Should be 1.25+
node --version # Should be v20.0.0+
pnpm --version # Should be 9.0.0+
azd version # Should be latest-
Fork the repository and clone your fork
-
Install Go dependencies:
cd cli && go mod download
-
Build the extension:
go build -o bin/copilot.exe ./cli/src/cmd/copilot
-
Install locally for testing:
# Add the local registry source (one-time) azd extension source add -n copilot -t file -l "<path-to-repo>/registry.json" # Install the extension azd extension install jongio.azd.copilot --source copilot --force # Verify installation azd copilot version
git checkout -b feature/your-feature-name- Follow Go code conventions
- Run
go fmt ./...to format your code - Add tests for new functionality
- Update documentation as needed
# Build
go build -o bin/copilot.exe ./cli/src/cmd/copilot
# Run tests
go test ./...
# Run with coverage
go test -cover ./...git add .
git commit -m "feat: add support for X"Follow Conventional Commits:
feat:New featuresfix:Bug fixesdocs:Documentation changestest:Adding or updating testsrefactor:Code refactoringchore:Maintenance tasks
git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
- Follow Effective Go
- Use
gofmtfor formatting - Run
golangci-lint runbefore committing - Keep functions small and focused
- Add comments for exported functions
- Write tests for new functionality
- Aim for 80% code coverage minimum
- Use table-driven tests where appropriate
- Mock external dependencies
- Update README.md for user-facing changes
- Document non-obvious code with comments
- Update CHANGELOG.md for notable changes
cli/
├── src/
│ ├── cmd/copilot/ # Command implementations
│ │ └── commands/ # Individual commands
│ └── internal/ # Internal packages
│ └── logging/ # Logging utilities
├── go.mod # Go module definition
├── magefile.go # Build system (mage)
├── build.ps1 # Windows build script
├── build.sh # Unix build script
├── extension.yaml # azd extension manifest
└── package.json # Node.js dev dependencies
web/ # Documentation website
scripts/ # PR install/uninstall scripts
Before submitting a PR, ensure:
- All tests pass:
go test ./... - Linter passes:
golangci-lint run - Code is formatted:
go fmt ./... - Documentation is updated
- Commit messages follow Conventional Commits
- Update documentation with details of changes
- Update CHANGELOG.md with notable changes
- Ensure all tests pass and coverage meets requirements
- Request review from maintainers
- Address review feedback
- Once approved, maintainer will merge
- Open an issue for bugs or feature requests
- Start a discussion for questions
- Check existing issues and documentation first
By contributing, you agree that your contributions will be licensed under the MIT License.