Contributing to EKS Helm Client GitHub Action
First off, thank you for considering contributing to the EKS Helm Client GitHub Action! It’s people like you that make this tool better for everyone in the community.
Table of Contents
- Code of Conduct
- Getting Started
- How Can I Contribute?
- Development Setup
- Style Guides
- Testing
- Security
- Community
Code of Conduct
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to dinushchathurya21@gmail.com.
Getting Started
Before you begin:
- Have you read the Code of Conduct?
- Check out the existing issues
- Read the README and documentation
How Can I Contribute?
Reporting Bugs
Before creating bug reports, please check the existing issues as you might find out that you don’t need to create one. When you are creating a bug report, please include as many details as possible using the bug report template.
Great Bug Reports tend to have:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn’t work)
Suggesting Enhancements
This section guides you through submitting an enhancement suggestion, including completely new features and minor improvements to existing functionality.
Before creating enhancement suggestions, please check the existing issues and discussions. When you are creating an enhancement suggestion, please include as many details as possible using the feature request template.
Great Enhancement Suggestions tend to have:
- A clear use case
- An explanation of how it would benefit other users
- If possible, example usage or mockups
Your First Code Contribution
Unsure where to begin contributing? You can start by looking through these beginner and help-wanted issues:
- Beginner issues - issues which should only require a few lines of code, and a test or two
- Help wanted issues - issues which should be a bit more involved than beginner issues
Pull Requests
The process described here has several goals:
- Maintain the project’s quality
- Fix problems that are important to users
- Engage the community in working toward the best possible EKS Helm Client
- Enable a sustainable system for maintainers to review contributions
Please follow these steps to have your contribution considered by the maintainers:
- Follow all instructions in the template
- Follow the style guides
- After you submit your pull request, verify that all status checks are passing
Development Setup
- Fork and Clone the Repository
git clone https://github.com/your-username/eks-helm-client-github-action.git cd eks-helm-client-github-action - Create a Feature Branch
git checkout -b feature/your-feature-name - Set Up Development Environment
# Make scripts executable chmod +x scripts/*.sh chmod +x .github/scripts/**/*.sh # Install development dependencies (if any) # Currently, this action uses Docker, so ensure Docker is installed - Build the Docker Image
docker build -t eks-helm-client:dev . - Run Tests
# Unit tests ./tests/unit/test-entrypoint.sh ./tests/unit/test-health-check.sh ./tests/unit/test-templates.sh # Integration tests ./.github/scripts/testing/run-integration-tests.sh
Style Guides
Git Commit Messages
- Use the present tense (“Add feature” not “Added feature”)
- Use the imperative mood (“Move cursor to…” not “Moves cursor to…”)
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- Use conventional commits format when possible:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for formatting, missing semicolons, etcrefactor:for code refactoringtest:for adding missing testschore:for maintenance tasks
Example:
feat: add support for private Helm registries
- Add authentication for Harbor, Nexus, and Artifactory
- Support both basic auth and token-based auth
- Add comprehensive error handling for registry failures
Fixes #123
Bash Style Guide
We follow the Google Shell Style Guide with some modifications:
Key Points:
- Shebang
#!/bin/bash - Error Handling
set -e # Exit on error set -u # Exit on undefined variable (when appropriate) set -o pipefail # Fail on pipe errors - Functions
# Good function_name() { local var_name="$1" local another_var="${2:-default}" # Function body echo "Processing: $var_name" } # Usage function_name "argument" "optional" - Variables
# Constants (readonly) readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" readonly DEFAULT_TIMEOUT=300 # Local variables local file_path="/tmp/test" # Global variables (avoid when possible) GLOBAL_STATE="active" - Conditionals
# Good if [[ -n "${variable:-}" ]]; then echo "Variable is set" fi # Check file existence if [[ -f "$file_path" ]]; then echo "File exists" fi - Logging
log_info() { echo -e "${BLUE}[INFO]${NC} $1" >&2 } log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2 } - Error Messages
if [[ -z "${CLUSTER_NAME:-}" ]]; then log_error "CLUSTER_NAME is required" log_error "Please provide either:" log_error " - Input parameter: cluster-name" log_error " - Environment variable: CLUSTER_NAME" exit 1 fi
Documentation Style Guide
- Markdown Files
- Use ATX-style headers (
#not underlines) - Include a table of contents for long documents
- Use code blocks with language specification
- Include examples whenever possible
- Use ATX-style headers (
- Code Comments
# Function to configure EKS cluster access # This function retrieves cluster information from AWS EKS API # and generates a kubeconfig file for authentication configure_eks_access() { # Implementation } - README Sections
- Keep examples concise and realistic
- Include both basic and advanced usage
- Provide troubleshooting guidance
Testing
Running Tests Locally
- Unit Tests
# Run all unit tests for test in tests/unit/test-*.sh; do bash "$test" done - Integration Tests
# Build the Docker image docker build -t eks-helm-client:test . # Run integration tests ./.github/scripts/testing/run-integration-tests.sh - Manual Testing
# Test with dry run docker run --rm \ -e INPUT_CLUSTER_NAME="test-cluster" \ -e INPUT_REGION="us-west-2" \ -e INPUT_DRY_RUN="true" \ -e INPUT_ARGS="helm list" \ eks-helm-client:test
Writing Tests
When adding new features, please include:
- Unit tests for individual functions
- Integration tests for end-to-end scenarios
- Documentation with examples
- Error cases to ensure proper error handling
Example test structure:
#!/bin/bash
# tests/unit/test-new-feature.sh
source "$(dirname "$0")/../../.github/scripts/testing/utils.sh"
test_new_feature() {
# Test implementation
local result
result=$(new_feature "input")
if [[ "$result" == "expected" ]]; then
log_test_result "PASS" "New feature test"
return 0
else
log_test_result "FAIL" "New feature test" "Expected 'expected', got '$result'"
return 1
fi
}
# Run test
test_new_feature
Security
Security Considerations
- Never commit secrets or sensitive data
- Validate all inputs to prevent injection attacks
- Use secure defaults for all configurations
- Follow the principle of least privilege for IAM permissions
- Clean up sensitive data after use
Reporting Security Issues
Please DO NOT create public GitHub issues for security vulnerabilities. Instead, please report them directly to dinushchathurya21@gmail.com.
Community
Getting Help
- 📧 Email: dinushchathurya21@gmail.com
- 💬 Discussions: GitHub Discussions
- 🐛 Issues: GitHub Issues
Project Structure
eks-helm-client-github-action/
├── .github/ # GitHub-specific files
│ ├── workflows/ # CI/CD workflows
│ └── scripts/ # CI/CD scripts
├── docs/ # Documentation
│ └── examples/ # Usage examples
├── scripts/ # Main action scripts
├── templates/ # Configuration templates
├── tests/ # Test files
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── action.yml # Action definition
├── Dockerfile # Container definition
└── README.md # Main documentation
Release Process
- Version Numbering: We use Semantic Versioning
- Release Branches: Create from
mainbranch - Testing: All tests must pass
- Documentation: Update CHANGELOG.md
- Tag: Create version tag (e.g.,
v2.1.0)
Recognition
Contributors will be recognized in:
- The project README
- Release notes
- Special thanks in major releases
Thank You!
Your contributions to open source make great things possible. Thank you for taking the time to contribute to the EKS Helm Client GitHub Action!
Made with ❤️ by the Open Source Sri Lanka community