Contributing Guide
Thank you for your interest in contributing to my JSON to Variables Setter action! This document provides guidelines and instructions for contributing to this project.
Table of Contents
- Contributing Guide
- Table of Contents
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Guidelines
- Documentation
- Core Components Development
- Release Process
- Feedback
Code of Conduct
Please be respectful to all contributors and users. I aim to foster an inclusive and welcoming community.
Getting Started
Development Environment Setup
-
Clone the repository:
-
Set up a virtual environment:
When using the
poetry install
command, venv is created under the project, so there is no need to manually create a virtual environment (venv). -
Install dependencies:
Option 1: Using Poetry (recommended)
Option 2: Using pip with requirements files
-
Set up pre-commit hooks:
Project Structure
My project is organized as follows:
Development Workflow
Creating Issues
Before starting any work, please check existing issues or create a new one to discuss the changes you'd like to make.
- For bugs, include steps to reproduce, expected behavior, and actual behavior
- For features, explain the use case and proposed implementation
Making Changes
-
Create a branch:
Branch naming conventions:
Branches must follow the format:<type>-<short-description>
.
Use the following prefixes based on the purpose of the branch:feature-<description>
: For implementing new features (e.g., feature-newlang-supprt).bugfix-<description>
: For fixing bugs (e.g., bugfix-fetch-python-version-error).docs-<description>
: For documentation updates (e.g., docs-update-readme).refactor-<description>
: For code refactoring without functional changes (e.g., refactor-cleanup-utils).
-
Make your changes:
- Follow my coding guidelines
- Keep changes focused on a single issue/feature
-
Commit your changes using gitmoji:
Recommended gitmoji conventions:
- ✨ (
:sparkles:
) - New feature - 🐛 (
:bug:
) - Bug fix - 📝 (
:memo:
) - Documentation updates - ♻️ (
:recycle:
) - Code refactoring - 🚀 (
:rocket:
) - Performance improvements - 🎨 (
:art:
) - Code style/structure improvements - 🧪 (
:test_tube:
) - Add or update tests
Write clear commit messages that explain what changes were made and why.
- ✨ (
Testing Changes
About the Testing Policy
- Test code should be created using pytest
- Coverage must be at least 95% (ideally 100%)
-
Run unit tests (required):
-
Run linters (required):
-
Manual testing:
Test the action by using it in a test workflow with various configurations.
Pull Requests
-
Push your branch:
-
Create a pull request:
- Go to the GitHub repository
- Click "Pull requests" > "New pull request"
- Select your branch
- Fill in the PR template
-
Code review:
- Respond to feedback and make necessary changes
- Keep the PR focused on a single issue/feature
Coding Guidelines
Python code:
- Follow PEP 8 style guide
- Use type hints as defined in my mypy configuration
- Document functions and classes with docstrings
- Keep functions focused on a single responsibility
Linting and Formatting (required)
- My project uses pre-commit hooks for consistent code quality
- All code must pass pre-commit checks before submitting PRs
- Configuration is defined in
.pre-commit-config.yaml
andpyproject.toml
- Key linting tools:
- Ruff for linting and formatting
- mypy for static type checking
- markdownlint for Markdown files
- actionlint for GitHub Actions workflows
- shellcheck for shell script checking
- You can run all linters at once using:
poetry run pre-commit run --all-files
Testing (required)
- Write unit tests for all new functionality
- Test edge cases and error conditions
- Maintain or improve test coverage
Documentation
- Update documentation when making changes that affect user-facing functionality
- Follow my existing documentation style
- Include examples for new features
- Update the README.md if necessary
For MkDocs documentation:
-
Test documentation locally:
-
Build documentation:
Core Components Development
When working on my core components, consider the following guidelines:
JSON to GitHub Output Parser (json_to_github_output.py
)
- Maintain backward compatibility with existing JSON structures
- Ensure proper error handling for malformed JSON
- Optimize for performance with large JSON files
Dynamic Matrix Updater (update_matrix_dynamic.py
)
- Keep the code DRY (Don't Repeat Yourself) when implementing different language fetchers
- Handle API rate limits gracefully
- Implement proper error handling and logging
Version Cache Manager (cache_version_info.py
)
- Ensure thread-safety for file operations
- Optimize disk I/O and API calls
- Maintain backward compatibility with existing cache formats
Release Process
Version updates and releases are managed through an automated workflow that is only available to repository administrators (currently only me). The process involves:
-
Version bumping
- Handled by the automated workflow that updates the version in relevant files
-
Creating a release
- The workflow automatically creates a tag and a GitHub release
- Tags follow the format
json2vars-setter-vX.Y.Z
(e.g.,json2vars-setter-v0.2.5
)
-
Documentation deployment
- Occurs automatically when changes are merged/pushed to the main branch
- Handled by a dedicated deployment workflow
Feedback
If you have any questions or need help, feel free to:
- Open an issue for discussion
- Contact me directly via X (formerly Twitter) - DMs preferred
Thank you for contributing to my json2vars-setter!