Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Contribution-Process.rst 4.91 KiB

Contribution Process

Contribution guidelines

|main_project_name| is an open-source project where the community can submit merge requests directly to the project. This section explains how to report a new issue, requests for enhancements and submit merge request to the project in GitLab so that your patch is merged into the source code.

Changes must be committed with detailed Git commit messages. Each commit message must contain:

  • Short and descriptive subject line that is less than 72 characters, the subject line must include a prefix that identifies the subsystem being changed, followed by a colon, and a short title.
  • A change description with your logic or reasoning for the changes.
  • A Signed-off-by line, Signed-off-by: <name> <email> typically added automatically by using git commit -s
  • When editing the commit message, explain the changes and why the changes are required along with issue number.
  • If the merge request addresses an issue, include a line of the form as below:
$ Fixes #<issue number>

Sign-off commit message

Each commit message in Pull request must be signed-off with a proper format as follows:

$ Signed-off-by: OpenHarmony <sample@openharmonyproject.org>
  • Commit message text can be added either manually or include -s or --signoff to your GitLab commit message. For example:
$ Supported Boards Updation: Placeholder Updation
$ * Signed-off-by: OpenHarmony <sample@openharmonyproject.org>
  • To amend and add sign-off message to the previous commit, run the following command:
$ git commit --amend -s
  • To force push your changes to GitLab commit message, run the following command:
$ git push -f

Prerequisites

  • To configure, install and setup your development environment of |main_project_name|, see :ref:`Getting Started <BuildOpenharmony>`.
  • Create a GitLab account on https://gitlab.com/users/sign_up and have Git tools available on your development system.
  • Find the repository that you are interested in on the code hosting platform of |main_project_name|.

For downloading tools, downloading source code, and building and running |main_project_name| image, see :ref:`Getting Started <BuildOpenharmony>`.

Contribution Workflow

When contributing to the |main_project_name| Project, provide information about your change, update project documentation, and test your changes before you submit them.

To simplify the review, merge and rebase, and to modify the commit history, perform the following contribution workflow process:

  1. Click the Fork button in project repo page to create a Fork of |main_project_name| to your personal account on GitLab.
  2. To work locally on an existing remote repository, clone the source files to your local computer through HTTPS or SSH, run:
$ git clone https://gitlab.com/<your-namespace>/sample-project.git
  1. Navigate to the folder where source files were downloaded and add a remote repository:
$ git remote add upstream git@gitlab.com:username/projectpath.git
  1. Download the latest changes in the project, run:
git pull <REMOTE> <name-of-branch>
  1. Run the following command to verify the remote repositories:
$ git remote -v

The remote repositories are displayed as following:

$ origin  https://gitlab.com/<your-namespace>/sample-project.git (fetch)
$ origin  https://gitlab.com/<your-namespace>/sample-project.git (push)
$ upstream https://gitlab.com/gitlab-tests/sample-project.git. (fetch)
$ upstream https://gitlab.com/gitlab-tests/sample-project.git. (push)
  1. Create a new branch based out of Master for making changes out of your local repository:
$ git checkout master
$ git checkout -b <branch_name>
  1. Make the changes locally and once committed, add the files to the remote repository:
$ git add [modified file]
  1. Commit your changes to your local repo. Include -s to include Signed-off-by: to the commit message.
$ git commit -s
  1. Push your new branch along with the changes to your fork in personal GitLab account:
$ git push origin <branch_name>
  1. Merge a branch with master branch, run:
$ git checkout <branch_name>
$ git merge master

All the local changes are merged into the master branch.

Note

For more details on using Git on the command line, see https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html.