Documentation for contributing code back to community

Hi,

I am working on fixing https://github.com/frappe/erpnext/issues/8816 and looking for some help with the process. The pain points for me are

  1. Maintaining my forked repository up-to-date with the erpnext repository
  2. Making sure my changes are fine by running tests

Looking for this information, I found Git Help - Sync my repo (frappe fork) to latest frappe repo which seems to answer (1). However I am still struggling to get the tests running using online help. My changes are in accounts/sales_invoice, so I am looking at running all the tests in accounts module, but can’t get it working. Could some one please point me to any existing documentation that clearly shows how to contribute code back to the community?

Regards
Sathish

Mostly its git flow.

Have you looked at https://github.com/frappe/erpnext/wiki/Contribution-Guidelines ?

Thanks. I have gone through that link about the guidelines. However what I am missing is the actual steps. I think I have understood the git part now, but not

Perhaps it even makes more sense to have a ‘buddy’ from core/foundation team to get first 1-2 commits of a potential contributor accepted.

Just start a pull requests. The tests will automatically run!

Thanks, that is one way, though I prefer running the tests before sending the pull request. I am still struggling with the git after 4-5 hours of experimentation and reading, so really need some help.

spoojary@osboxes:~/factory-skpi/apps/erpnext$ git remote -v
develop https://github.com/sathishpy/erpnext.git (fetch)
develop https://github.com/sathishpy/erpnext.git (push)
upstream https://github.com/frappe/erpnext (fetch)
upstream https://github.com/frappe/erpnext (push)

spoojary@osboxes:~/factory-skpi/apps/erpnext$ git pull --rebase upstream develop
From https://github.com/frappe/erpnext

  • branch develop -> FETCH_HEAD
    Current branch develop is up to date.

I understand it is saying my forked repo is up-to-date with ERPNext master repo

spoojary@osboxes:~/factory-skpi/apps/erpnext$ git status
On branch develop
Your branch is ahead of ‘upstream/develop’ by 2 commits.
(use “git push” to publish your local commits)
Untracked files:
(use “git add …” to include in what will be committed)

erpnext/accounts/doctype/account_transaction_item/
erpnext/accounts/doctype/bank_account_map_item/
erpnext/accounts/doctype/bank_account_mappings/
erpnext/accounts/doctype/bank_statement_management/

nothing added to commit but untracked files present (use “git add” to track)

I don’t want to commit the untracked ones, which is still a work-in-progress

spoojary@osboxes:~/factory-skpi/apps/erpnext$ git push develop
Username for ‘https://github.com’: sathishpy
Password for ‘https://sathishpy@github.com’:
To https://github.com/sathishpy/erpnext.git
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to ‘https://github.com/sathishpy/erpnext.git
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

Checking https://github.com/sathishpy/erpnext, it says I am 1455 commits behind frappe:develop. What am I doing wrong here?

Looks like I can use ‘git push -f’ to force the updates. I will give it a try…

Ok, I have managed to send the pull request now. I will close this thread when I understand how to run the tests properly.