How to submit a patch through issue tracker

How to submit a patch through issue tracker

by Lawrence Elango -
Number of replies: 15

Hi,

   i have been trying to submit a patch through the tracker to no avail.i pushed a change to github and did a pull request which was declined.was refered to the contibutions.txt file which refered me to the tracker but when i get to the tracker i dont know if after pushing the commit, i was just to wait for peer review.any ideas to help on this?

Average of ratings: -
In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers


Welcome to the community Lawrence smile

If you have submitted a patch to the tracker issue (what is the tracker issue id?) then if you are new to the process you will need to wait for someone to submit it for peer review for you, I believe. You can speed that process up by posting here - as you have done, but with the tracker reference - so that someone can go and look at the issue and mark it for peer review for you (raising awareness of the issue you have worked on and telling people that there is something there to be reviewed).

Once you have had some code accepted, you 'earn' the right to submit for peer review yourself. At least that is my (simplified) understanding of the process smile

With regard to the github pull request, as I believe Andrew's email said, no issues are dealt with through there, so ANY pull requests would be closed and not acted on through the github repository - it is a mirror of the main code base and not used to actually manage pull requests from anyone regardless of their experience or the quality or the urgency of the request. That's just down to the way the core moodle code is managed and released - its managed through the tracker issues, and its released through the github mirror (as well as through the main site downloads).

I'm sure if you can provide the tracker reference, someone will take a look at your patch and progress it from there as appropriate.

In reply to Richard Oelmann

Re: How to submit a patch through issue tracker

by Lawrence Elango -

Hi Richard

Thanks for the help.By submitting a patch through the tracker issue do you mean giving a link to the push ill make on github(before making the wrong move of doing a pull request)?The link i believe will contain the patch label which will probably be the name of the branch i am pushing. And after giving the link i understand from what your are saying that i am to wait.Am i right? 

I watched an issue and pushed it.then did the pull request.ill need help as what do do after the push.I have read the documentation on git for developers and followed every step.Maybe i missed something very important or the information was just overwhelming

Thanks again

Regards

-Lawrence

In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

You need to set up your own github clone of moodle

Then make the changes on your own moodle github, not the main github/moodle/moodle

Then on the tracker issue post a link to the patch/diff file in YOUR moodle github repository

But I can't see what you have done on the tracker (and neither can anyone else who may be more help) because you still dont say what the tracker issue is, so we can't go and look at it to see what you have done to get it peer reviewed.

In reply to Richard Oelmann

Re: How to submit a patch through issue tracker

by Lawrence Elango -
In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Just H -

But what is the bug tracker number you are wanting to submit a patch for?


Edit: OK, it's MDL-53201

In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Rex Lorenzo -

A patch file is not going to be that helpful. If you can submit to the ticket the git branch it would help the integration/Moodle team to get your changes into their system.

For example, look at this ticket: https://tracker.moodle.org/browse/MDL-51702

The fields for "Pull from Repository", and the pull and diff fields are filled out. That allows their Continuous Integration bot know where to get the code and run their automated code checkers and such.

Lawrence, I updated the ticket with your repo and branch information. Just remove the commit with the patch file.

In reply to Rex Lorenzo

Re: How to submit a patch through issue tracker

by Lawrence Elango -

Hi @Just H and @Rex

thanks alot.i was going through some trouble with that.Didnt know the patch wasnt needed.Wanted to ask if apart of that everything was okay.Or if i did anything else wrong ill love to be corrected.I would also like to know if i am to create a branch from my public repo or moodles


regards

Lawrence 

In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Lawrence,

In response to your question about where to create a branch from, my git workflow is this:

  • Update your local moodle clone to the latest upstream code. This is easiest if you have done `git remote add https://github.com/moodle/moodle.git upstream`, then you can do `git pull upstream` on the branches you're fixing.
  • Create a branch based on master (`git checkout master`, `git checkout -b MDL-12345_master`)
  • Apply your fix to your branch and commit it with an appropriate message (Start with the issue number and area affected)
  • Push your branch to github
  • If you want to apply the fix to stable releases too, create a new branch for each (e.g. `git checkout MOODLE_30_STABLE`, `git checkout -b MDL-12345_30_STABLE`), cherry pick your change (git cherry-pick --no-commit MDL-12345_master), make any changes necessary and commit.
  • Push your additional branch to github
  • On the tracker issue, set the "Pull from Repository" to your GitHub repository (e.g https://github.com/ChocLawrence/moodle.git)
  • Set "Pull master branch" to "MDL-12345_master"
  • Set "Pull Master Diff URL" to the GitHub URL that shows your branch diffed against moodle's master branch.  If you've done this right, viewing your branch on GitHub should give you this link.  Otherwise, it's something like https://github.com/moodle/moodle/compare/master...ChocLawrence:MDL-12345_master or https://github.com/moodle/moodle/compare/MOODLE_30_STABLE...ChocLawrence:MDL-12345_30_STABLE

At some point, you may get a message saying the upstream branch has been updated and you should rebase.  In this case, you want to do something like:

  • `git fetch upstream`
  • `git checkout MDL-12345_master`
  • `git rebase upstream/master`
  • `git push --force origin MDL-12345_master` (where origin is your remote github repository)
Average of ratings: Useful (5)
In reply to Mark Johnson

Re: How to submit a patch through issue tracker

by Lawrence Elango -

Hello Mark

  Thanks for the in-depth explanation of the whole process of submitting and creating the right branches.It was very helpful.Hoping to adapt as soon as possible

Regards

Lawrence

In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Rex Lorenzo -

Lawrence, please see the coding problems identified here:

http://integration.moodle.org/job/Precheck%20remote%20branch/21847/artifact/work/smurf.html

Also, you should remove the commits that added and then deleted the patch file. See: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

In reply to Rex Lorenzo

Re: How to submit a patch through issue tracker

by Lawrence Elango -

Hi Lorenzo

  thanks alot.i had some problems with my installation so cloned moodle again from my repo after forking it from moodle.i did this before reading your mail.i dont know if this would cause any problems but rebasing was successful.ill appreciate any help if i missed something

Regards

Lawrence

In reply to Mark Johnson

Re: How to submit a patch through issue tracker

by Antonello Moro -

Great guide, I used it to submit a patch, thanks a lot. Now I need to rebase my repo, but I'm at a dead end. If I cd to my local git repo, and I do:

git remote addhttps://github.com/moodle/moodle.git upstream


I get the following error:


fatal: 'https://github.com/moodle/moodle.git' is not a valid remote name


Any help would be really appreciated!

Thanks a lot,

Antonello


In reply to Lawrence Elango

Re: How to submit a patch through issue tracker

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hello,

the process is described here: https://docs.moodle.org/dev/Process#Fixing_a_bug

In reply to Marina Glancy

Re: How to submit a patch through issue tracker

by Lawrence Elango -

Thanks Marina.

     I followed that process.I had issues because i was caught up inbetween checking out a branch and creating the branch first on the github website.I also had problems with the naming comnventions of the push and had to rebase to be on track

Regards

Lawrence