Contributing¶
Table of Contents¶
- Introduction
- Configurations
- Types of Contributions
- Issues and Feature Requests
- How to Submit a Pull Request
- Review Process
- Branch Naming
- Commit Message
Introduction¶
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project. We use some tools to help us maintain our project standards, such as better-commits and Git-Flow. Please note that better-commits is already initialized. So you don't have to initialize it.
Development environment¶
Be sure to have git and NPM installed on your computer.
Then, you can clone the repo :
git clone https://github.com/MediaEase/HarmonyUI
cd HarmonyUI
on Linux distributions (bash > 4.x)
You can automatically setup the development environment by running bin/setup_repo.sh
.
This will setup donwload and setup Git-Flow.
on Windows :
Then, you can install better-commits.
You don't need to install Git-Flow as it's included with the git package.
Configurations¶
Better-Commits¶
See configuration
Git-Flow¶
Run
git-flow init -d -f
Types of Contributions¶
Bugfix¶
A bugfix is a change meant to fix a specific issue in the codebase. These are generally small changes that target very specific issues. Bugfix branches should be named bugfix/your-bugfix-name
.
Hotfix¶
A hotfix is a type of bugfix, but it's urgent and should be applied as soon as possible. These are critical fixes that often address issues affecting the system's stability or security. Hotfix branches should be named hotfix/your-hotfix-name
.
Feature¶
A feature is a new addition to the codebase that provides new functionality or improves existing features. These are generally larger changes and can include anything from new methods to full modules. Feature branches should be named feature/your-feature-name
.
Issues and Feature Requests¶
You've found a bug in the source code, a mistake in the documentation, or maybe you'd like a new feature? Take a look at GitHub Discussions to see if it's already being discussed. You can help us by submitting an issue on GitHub. Before you create an issue, make sure to search the issue archive -- your issue may have already been addressed!
How to Submit a Pull Request¶
For Features¶
- Create your feature branch:
git-flow feature start MYFEATURE
. - Push to the branch:
git push
. - Once your feature is done:
git-flow feature finish MYFEATURE
. - Open a Pull Request to the beta branch.
- If your changes are stable enough, they will be merged into the main branch after successful beta testing.
For Bugfixes/Hotfixes¶
- Create your fix branch:
git-flow hotfix start bug-i-want-to-fix
. - Commit your changes by running:
better-commit
. - Push to the branch:
git push
. - Once your fix is done:
git-flow hotfix finish bug-i-want-to-fix
. - Open a Pull Request to the main branch.
Review Process¶
- Automated Checks: Initially, automated checks for code style, security vulnerabilities, and other issues will be run. Your PR must pass these checks before it can be merged.
- Code Review: A core contributor will review your changes to ensure they meet the project's coding and documentation standards.
- Feedback Loop: If changes are requested, you are expected to address these comments, after which the pull request will be reviewed again.
- Merge: Once your pull request has been approved and passed all checks, it will be merged into the appropriate branch.
Branch Naming¶
We follow a specific naming convention for branches to keep things organized:
- Feature Branches:
feature/your-feature-name
- Bugfix Branches:
bugfix/your-bugfix-name
- Hotfix Branches:
hotfix/your-hotfix-name
Commit Message¶
We use better-commits
for commit message formatting. This tool will guide you through a series of prompts to generate a well-formatted commit message.
- Type: You'll be prompted to select the type of change you're committing (e.g., feat, fix, chore, docs, style, refactor, perf, test).
- Scope: You'll then be asked to specify the scope of the change. This is optional. You can select
none
if you don't know what to choose! - Description: Finally, you'll be asked to provide a short (under 100 characters) description of the change.
Example commit message generated by better-commits
:
fix: button behavior