there's a part 2 to my dream to be a Drupal dev - the previous installment was about creating patches, but the new recommended way of contributing code to Drupal is to create an issue fork and create a merge request.
As usual, documentation on Drupal.org for doing that is poor, and I spent hours to figure out how to get it done.
here are my steps:
*this supposes you have access to Drupal.org as well as Drupal GIT
Open an issue and describe what you want to do
Click "request push access"
Go to "version control", copy commands in section "Setting up repository for the first time"
git clone https://git.drupalcode.org/project/[webform_validation]
example: git clone https://git.drupalcode.org/project/webform_validation.git
cd [project_name]
example: cd webform_validation
go to the issue page and create a fork
go to issue fork, click on "show commands" and copy the commands listed under "Add & fetch this issue fork’s repository"
git remote add [project_name]-[issue_number] https://git.drupalcode.org/issue/[project_name]-[issue_number].git
git fetch [project_name]-[issue_number]
example:
git remote add webform_validation-3250792 https://git.drupalcode.org/issue/webform_validation-3250792.git
git fetch webform_validation-3250792
use the following command to see a list of available branches to work on:
git branch -a
then select ( = checkout in git lingo) your branch
git checkout [branch_name]
example:
git checkout 3250792-add-telephone-to
this will copy the current code from the repository to your local system.
*** make your code changes ***
then "commit" your changes, it's like telling the repository server that you would like to make changes to the project's code.
git commit -a
a text file window will popup.
write a description about what the change does in the text file, save.
then you have to "push" ( = publish) your code changes to the repository server.
git push
your code should now be on the server.
on the issue page, go to "compare" and check if your code changes are in the GIT. you should see line substractions in red and code additions in green.
if it looks good, go to the issue page and then click on "open merge request"
then the change will be in line for automatic testing
if the message "waiting for branch to pass" appears, click that message and if there is a button "do not wait for branch to pass" or something similar appears, click it.
then wait for some time and check back after some minutes for the automatic testing to finish.
after the build tested successfully, edit the issue and change its status to "needs review" to ask a maintainer to approve it.
done.
- Log in to post comments
Comments