Hyper Open Edge Cloud

How To Contribute To ERP5

How To outlining how to fork and contribute to ERP5.
  • Last Update:2024-10-09
  • Version:002
  • Language:en

Introduction

This document was written to help developers interested in contributing to ERP5. It shows how to fork ERP5, test changes, and create merge requests.

Table of Contents

Getting A Webrunner With ERP5

To develop on ERP5 you will need your own instance. The easiest way to get an ERP5 instance is following the steps outlined in how to request an ERP5 instance on SlapOS. If you already have an instance, make sure it's up to date using how to update business templates on an existing instance.

Fork ERP5

ERP5 is hosted on Gitlab. Go to the ERP5 repository and login/create an account. Then fork ERP5 to your own account.

Create/Locate A Local Clone Of Your ERP5

Access your webrunner. Go to your Services tab and locate the Slappart[x] instance Zope is running on.

From SlapOS you should know that a Webrunner installs a single software (ERP5 in our case), and deploys a single instance of this software - the ERP5 you are working with. The services shows all services required to run ERP5 - from MariaDB to Apache. You can locate the zope slappart by searching "zope-0-on-watch"

To confirm you have the correct slappart, you can enter in your terminal:

ls instance/slappart[x]/etc

You should see the zope-0.conf file in its etc folder.

 

SlapOS Webrunner | Terminal - Software Releases

Open the Terminal and pwd to verify you are on your runner (path should be /srv/slapgrid/slappart[y]/srv/runner, if not run cd ~/srv/runner). From here, there are two important locations to know:

  • The ERP5 software and git repo are kept in software/[hash]/parts/erp5/
  • The ERP5 instance resides in instance/slappart[x]/srv/erp5shared/ (slappart[x] is where zope instance is running, see above)

There are two options to get a "working copy" of ERP5 to which you can commit to:

  • Work on your instance only (NOT RECOMMENDED).
    Go to your instance ~/srv/runner/instance/slappart[x]/srv/erp5shared and clone the ERP5 original repository here (not your fork!). This is bad, because while it allows you to work on and update business templates, you can only pull in updates to business templates. Updating ERP5 itself is more difficult because you are working with two sources and updating ERP5 in the software location will not be reflected in your cloned repo. So while you can make changes to things like ERP5 Product, pulling in updates and maintaining is not straightforward.
  • Simlink to the software git repo.
    This means you will only work with one source, saving a lot of time and hassle. If you are still in the runner/ directory, call:
    cd ~/srv/runner/instance/slappart[x]/srv/erp5shared
    ln -s ~/srv/runner/software/[hash]/parts/erp5
    This will create a symbolic link named erp5 in the erp5shared directory.

Add Remote

Go to your source folder and add your fork as a second remote using:

git remote add [NAME] https://lab.nexedi.com/[your_gitlab_name]/erp5.git

This will allow you to update your ERP5 fork from the original source while pushing changes to your fork, so you can create merge requests.

Commit To Your Fork

Follow the steps in how to commit from ERP5, starting from Tell ERP5 About The Path To Bt5s. This should set up your ERP5 instance to commit onto your ERP5 fork.

Running Tests

Work On Branches

Don't forget to create a branch for your modifications.

Don't Push

Make commits without pushing, so you can push to either remote as necessary. Be sure to add tests for any changes you make.

Test Changes (internal use only)

Once you have changes ready for testing on erp5-master, use one of the for_testrunner_[i] branches on the erp5 repository. Pick one currently not being used and verify with the last committer you can hijack the branch. Then:

git push origin --force [your_branch_name]:for_testrunner_[i]

Alternatively, you can define your own test suite (instructions provided here).

Check Test Results (internal use only)

Monitor the test results in the test_result_module. If tests are passing and there are no regressions, continue and create a merge request.

Note,

  • tests might need a long time to start if ERP5 is re-compiling after a change to ERP5 itself has been committed.
  • If the testrunner is not starting right away, there might be too many other tests running in parallel and your tests are queued until some of them finish. Please be patient.
  • If the tests are not showing up after an unreasonably large time, check with superuser account (at time of writing there was an occisional bug publishing running tests and results) or test maintainers.

Create Merge Request

Push Local Changes To Fork

Once your tests are passing, push your changes to your fork:

git push my_fork [your_branch_name]:[your_branch_name]

Create Merge Request

On Gitlab you can now create a merge request against erp5:master. Well done! Thanks for contributing.

Related Articles