Difference between revisions of "Using the Github UI to Make Pull Requests"

From Joomla! Documentation

(Correct closing tag)
(Marked this version for translation)
Line 54: Line 54:
  
 
<translate>
 
<translate>
 +
<!--T:32-->
 
Before you start navigating through the files check that you are in the right <code>branch</code> (there's a dropdown box to select one). At the moment while I write this there are several branches. <code>Staging</code> for development of the next 3.9 version. <code>3.10-dev</code> for the comming 3.10 version and <code>4.0-dev</code>. Branch names can change! Ask in a new issue on GitHub if you don't know which one to select.</translate>
 
Before you start navigating through the files check that you are in the right <code>branch</code> (there's a dropdown box to select one). At the moment while I write this there are several branches. <code>Staging</code> for development of the next 3.9 version. <code>3.10-dev</code> for the comming 3.10 version and <code>4.0-dev</code>. Branch names can change! Ask in a new issue on GitHub if you don't know which one to select.</translate>
  

Revision as of 17:00, 12 May 2020

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français
Tutorial

This article helps you understanding and creating Pull Requests on Github, so you can contribute to a project like Joomla!.

Many changes, including bug fixes and feature additions can be implemented and reviewed via the normal GitHub pull request workflow.

Some changes though are "substantial", and we ask that these be put through a bit of a design process and produce a consensus among the community and the core team.

Before making a pull request[edit]

A hastily proposed pull request can hurt its chances of acceptance. Low quality proposals, proposals for previously rejected features, may be quickly rejected, which can be demotivating for the unprepared contributor. Laying some groundwork ahead of the pull request can make the process smoother.

Although there is no single way to prepare for submitting a pull request, it is generally a good idea to pursue feedback from other project developers beforehand to ascertain that the pull request may be desirable. Although it may seem like a useful feature or bug fix, there may be reasons it cannot work that you have not considered (or could not know about).

As a rule of thumb, receiving encouraging feedback from long-standing project developers, and particularly members of the core team or existing contributors, is a good indication that the pull request is worth pursuing. To get feedback, we suggest you join the Volunteers Portal and join Glip to ask other developers. Once you are ready, we suggest, before doing any code, you submit an issue to the Joomla! issue tracker with "RFC" at the beginning. That will create a request for comments which will help you to identify any additional work or issues you may have to overcome to get your idea accepted.

What is a Pull Request?[edit]

A Pull Request is a request to pull some code to a repository (project) on GitHub.

In basic language you are asking if some code changes/additions you made can be used in the project. This changes can be the solution for a bug or a new feature. Github has a simple web interface that makes it very easy to propose a simple change to code. You don't need to install any software or do anything beside register for a git hub account.


Identify the change you like to made[edit]

First of all, map what changes you like to made.

For example, we like to add an icon for at the article info block, before the authors name. On the moment of writing, this icon is not displayed yet.

Infoblock before.png

Find the file you want to modify on Github[edit]

If you don't have a GitHub account yet, sign up on GitHub. It is free and very easy to do. After that, go to the Joomla! CMS repository and find the file you like to edit. You can navigate through by clicking on the folder and file name.

Before you start navigating through the files check that you are in the right branch (there's a dropdown box to select one). At the moment while I write this there are several branches. Staging for development of the next 3.9 version. 3.10-dev for the comming 3.10 version and 4.0-dev. Branch names can change! Ask in a new issue on GitHub if you don't know which one to select.

This can be a hard step sometimes, because Joomla! counts more than 6000 files. In our example we have to edit the following file: /layouts/joomla/content/info_block/author.php.

Github joomlacms.png


Make your changes[edit]

Navigate to the file, and edit the file by clicking on the pencil icon on the right.

In our example, we add the following code to line 14 of the file: autor.php

<span class="icon-user"></span>

Github filechange.png

Note: you may have noticed the blue message above the page. This message is telling you that GitHub made a copy of the project for you, where you can make changes. This copy is called a Fork. The changes you made in this copy can be used in the original project. If you like to read more about how GitHub works, you can read this article for some background information.


Add a title and description[edit]

Below the editor, we can specify our Pull Request by adding a title and a description.

The title has to be short, and must tell what this pull request does.

The description contains more detailed information about the Pull request and some information how to test it. Make this information so complete and clear as possible. When you made a Pull Request of an issue on GitHub, it is very common to add also the issue ID in the description. You can do this by typing a # (hash tag) with directly following the issue ID. You can find this ID directly after the title of the issue, in the same notation.

Github description.png


Send the Pull Request[edit]

Click on the button "Propose file changes" and after that on the button "Create Pull Request". Your pull request is made now!

Create pull request.PNG


And now?[edit]

The only thing you have to do now is wait until someone will test this PR. When someone comments, you will be notified via an email. It can happen that someone requests addition information, so try to stay up-to-date with you Pull Request.

If a Pull Request is successfully tested twice, a moderator will add the label 'RTC' to it. RTC means: Ready To Commit'. In basic language it tells someone who has commit rights: This Pull request is successfully tested, and can be added to Joomla!. The admin will add (Merge) the project to the Joomla! CMS github repository. Your Pull Request is definitive now, and will be present in the next version of Joomla! if it was about fixing a bug or in the next minor version if the PR was about a new feature.