Make Your First Contribution

Thank you for your interest in contributing to MatrixOne. Contributions are welcome from everyone.

This document will help you get started on your first contribution to MatrixOne.

How to Contribute?

Before setting about contribution, you need figure out that in what area you can help us. You can see Types of contributions for more details.

As your first-ever contribution, it can be selected from the following categories, which require little technical background of the contributor:

  • To report a bug in the code

  • To improve the MatrixOne documentation

File an issue to describe the problem before working on it. In addition, you will also find issues labelled with good-first-issue, which represents issues suitable for new contributors. Such Issues contain clear steps and expected output. You may start your first contribution based on these issues.

Assign Your Issue

It’s difficult to report an issue when you are just a newcomer on account of little knowledge of MatrixOne or relative contents, so we list good-first-issues suitable for new contributors to work with and be easy to fix. After deciding a suitable issue to work on, you can comment /assign on the issue you would like to work on, you will be automatically assigned to the issue. You can then find yourself listed under Assignees section.

Prerequisite

Before working on the issue you are assigned, please make sure you have set up development environment and installed MatrixOne.
You can see Preparation for more details.

Workflow

Step 1: Fork the Repository

Visit our Github Repository.
On the top right of the page, click the Fork button (top right) to create a cloud-based fork of the repository. Fork our repo

Step 2: Clone fork to local storage

Open the repository you forked from MatrixOne. Click on the Code button and then the Copy to Clipboard icon. Clone your fork
Next, move to the working directory you expect in local and launch your terminal. Run the following Git command:

  1. git clone <content you just copied>

For example:

  1. git clone [email protected]:<yourname>/matrixone.git

<yourname> is the ID you signed in at GitHub. This Git command downloads the content of MatrixOne repository you forked on GitHub to your local device.

Step 3: Add MatrixOne repo as a remote repository

You can add MatrixOrigin/MatrixOne repository as a remote repository in local with:

  1. git remote add upstream https://github.com/matrixorigin/matrixone.git

upstream is the designation of this remote repository. If you want to replace it with other words you want, don’t forget to replace it as well in the next steps, or some errors will happen.

Step 4: Develop

Make some changes

Now you can edit the code, modify the documents and make whatever changes you want about your issue, on the branch you just created.

Run MatrixOne in a standalone mode

If you want to demonstrate whether the changes you made are valid or reproduce an issue, you need to run MatrixOne in a standalone mode.
Before running, make sure you have installed MatrixOne according to our Install tutorial. And you can connect MatrixOne Serve according to the Connect tutorial.

Step 5: Commit to your local repo

Having completed your modification, you can add the files you just modified using the git add command:

  1. git add <filename>

<filename> is the name of the file you just modified. And you can use following command to add all the files in the current folder:

  1. git add .

Next, you can commit these changes using the git commit command:

  1. git commit -m "<commit message>" -s

Summarize and describe your modification briefly in the place of <commit message>. -s adds your sign-off message to your commit message.

Step 6: Push to your remote repo

After committing your modification, you should push your local branch to GitHub using the git push command, and we recommend you to push to a new branch:

  1. git push origin main:NEW_BRANCH

NEW_BRANCH is the name of new branch you created and push to. Also, you can replace it with another name you want.

Step 7 Create a pull request

Having pushed your changes, you can visit your folk at https://github.com/$user/matrixone, and click the Compare & Pull Request button to create a pull request in NEW_BRANCH for your modification to the MatrixOne repository.

Note

You should fill in the required information based on the PR template.

Pull Request Pull Request Template

Once your PR is opened, it will be assigned to reviewers. These reviewers will check your contribution and make a detail review, according to correctness, bugs, style and so on.

Step 8 After merging, Keep your repo in sync

Congratulations on that your contributions are accepted and merged to the project!
And there are some operations left to do, which helps keep project committing history clean and keep your local and remote repo synchronized with MatrixOne repo.
Overrides local commiting history with following command:

  1. git pull --force upstream main:main

Lastly, upgrade the main branch of your folk in Github:

  1. git push --force origin main:main