From ec5bb0d974c9ba20ae6e7f3fdf54bf0b938f4741 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Grzegorz=20Gw=C3=B3=C5=BAd=C5=BA?=
 <grzegorz.gwozdz@huawei.com>
Date: Tue, 2 Aug 2022 16:17:39 +0200
Subject: [PATCH] Add contributing/how-to-contribute.rst
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add documentation file which describes how to contribute to Oniro Project

Signed-off-by: Grzegorz Gwóźdź <grzegorz.gwozdz@huawei.com>
---
 contributing/how-to-contribute.rst | 108 +++++++++++++++++++++++++++++
 contributing/index.rst             |   1 +
 2 files changed, 109 insertions(+)
 create mode 100644 contributing/how-to-contribute.rst

diff --git a/contributing/how-to-contribute.rst b/contributing/how-to-contribute.rst
new file mode 100644
index 0000000..5443bf2
--- /dev/null
+++ b/contributing/how-to-contribute.rst
@@ -0,0 +1,108 @@
+.. SPDX-FileCopyrightText: Huawei Inc.
+..
+.. SPDX-License-Identifier: CC-BY-4.0
+
+.. include:: ../definitions.rst
+
+How to contribute to the |main_project_name|
+############################################
+This page explains how to contribute to the |main_project_name| for
+new people who would like to join.
+
+
+.. contents::
+   :depth: 2
+
+Setting up
+**********
+
+Creating an account on Eclipse 
+------------------------------
+
+Head to the `Eclipse foundation website <https://accounts.eclipse.org/user/register?destination=user/login>`_ and set up an account by entering your:
+
+- Email
+- Username
+- Full name
+- Organization
+- Password
+- Country
+
+Then read and check the box to agree to Terms of Use, Privacy Policy and Code of Conduct. 
+When you complete that, follow the instructions sent to your email to activate the account.
+
+Signing the ECA
+---------------
+
+In order to contribute to the |main_project_name| you need to sign the 
+`Eclipse Contributor Agreement  <https://accounts.eclipse.org/user/eca>`_, 
+which describes the terms under which you can contribute to the project.
+
+If you sign this ECA, you confirm your legal rights to submit the code to the project.
+You also provide license to your contributions to Eclipse and specified users, however
+you still own your contributions.
+
+Setting up Gitlab
+-----------------
+
+Now you can go to `the Oniro Gitlab <https://gitlab.eclipse.org/eclipse/oniro-core/oniro>`_ 
+. You should use the account that was created in the previous step to log in.
+
+To push and pull over HTTPS with Git using your account, you must set a password
+or `a Personal Access Token <https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html>`_
+to use instead.
+
+If you want to push or pull repositories using SSH, you have to
+`add a SSH key <https://docs.gitlab.com/ee/user/ssh.html>`_ to your profile.
+
+Contributing to the |main_project_name|
+***************************************
+
+If you complete previous steps, your account is ready and you can contribute to the |main_project_name|.
+
+Setting up git
+--------------
+
+Make sure you have git installed on your device.
+
+Forking the repository
+----------------------
+
+First fork your project by going to `the Oniro Gitlab <https://gitlab.eclipse.org/eclipse/oniro-core/oniro>`_
+and clicking on the fork button that is in the top right of the screen.
+
+Working on your repository
+--------------------------
+
+1. Clone your fork by typing ``git clone`` and adding address of your fork which can be found by 
+   clicking ``Clone`` button in your fork's website. You can clone it by SSH or HTTPS. 
+#. Enter the directory with your local repository and configure it by typing:
+
+.. code-block:: bash
+
+    $ git config --local user.email <your_eclipse_account_email>
+    $ git config --local user.name <your_eclipse_full_name>   
+
+3. Start working on the project by creating a new branch.
+#. Make your changes, then add and commit 
+   them. Each commit has to be signed off by the e-mail used in your Eclipse account 
+   (add ``-s`` to every ``git commit``). Give relevant names to your commits, to point
+   which file you add/modify. 
+#. After that you can push the changes to your branch.
+
+
+Creating the Merge Request
+--------------------------
+
+1. Go to your repository in an internet browser. 
+
+#. Create a Merge Request by clicking ``Merge Requests`` on left toolbar
+   and press ``New merge request``. Add an explainable description and create a merge request.
+   Alternatively, you can enter the website of your fork. You should see a message that you 
+   pushed your branch to the repository. In the same section you can press ``Create merge request``.
+#. Before merging, it has to be reviewed and approved by 2 of |main_project_name| repository
+   maintainers. Read their review and add any required changes to your merge request. 
+#. After you polish your merge request, the maintainers will run the pipelines which check
+   if your changes do not break the project and approve them. If everything is correct, your work
+   is merged to the main project. Remember that changes which were added on top of
+   changes introduced in the MR, should be squashed into the initial commit.
\ No newline at end of file
diff --git a/contributing/index.rst b/contributing/index.rst
index ab10ef8..a40cfc6 100644
--- a/contributing/index.rst
+++ b/contributing/index.rst
@@ -16,6 +16,7 @@ requirements.
 .. toctree::
    :maxdepth: 1
    
+   how-to-contribute
    gitlab
    reuse
    dco
-- 
GitLab