Blame doc/pr_custom_page.rst

Pierre-Yves Chibon a49ea7
Customize the PR page
Pierre-Yves Chibon a49ea7
=====================
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Pagure offers the possibility to customize the page to create pull-request
Pierre-Yves Chibon a49ea7
to add your specific information, such as: please follow the XYZ coding style,
Pierre-Yves Chibon a49ea7
run the tests or whatever you wish to inform contributors when they open a
Pierre-Yves Chibon a49ea7
new pull-request.
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
The customization is done via a file in the git repository containing the
Pierre-Yves Chibon a49ea7
meta-data for the pull-requests. This file must be placed under a ``templates``
Pierre-Yves Chibon a49ea7
folder, be named ``contributing.md`` and can be formated as you wish using
Pierre-Yves Chibon a49ea7
markdown.
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Example
Pierre-Yves Chibon a49ea7
-------
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
For a project named ``test`` on ``pagure.io``.
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
* First, clone the pull-request git repo [#f1]_ and move into it
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
::
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    git clone ssh://git@pagure.org/requests/test.git
Pierre-Yves Chibon a49ea7
    cd test
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
* Create the templates folder
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
::
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    mkdir templates
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
* Create the customized PR info
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
::
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    vim templates/contributing.md
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
And place in this file the following content:
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
::
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    Contributing to test
Pierre-Yves Chibon a49ea7
    ====================
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    When creating a pull-request against test, there are couple of items to do
Pierre-Yves Chibon a49ea7
    that will speed up the review process:
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    * Ensure the unit-tests are all passing (cf the ``runtests.sh`` script at the
Pierre-Yves Chibon a49ea7
      top level of the sources)
Pierre-Yves Chibon a49ea7
    * Check if your changes are [pep8](https://www.python.org/dev/peps/pep-0008/)
Pierre-Yves Chibon a49ea7
      compliant for this you can install ``python-pep8`` and run the ``pep8`` CLI
Pierre-Yves Chibon a49ea7
      tool
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
* Commit and push the changes to the git repo
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
::
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
    git add templates
Pierre-Yves Chibon a49ea7
    git commit -m "Customize the PR page"
Pierre-Yves Chibon a49ea7
    git push
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
* And this is how it will look like
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
.. image:: _static/pagure_custom_pr.png
Pierre-Yves Chibon a49ea7
        :target: _static/pagure_custom_pr.png
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
Pierre-Yves Chibon a49ea7
.. [#f1] All the URLs to the different git repositories can be found on the
Pierre-Yves Chibon a49ea7
         main page of the project, on the right-side menu, under the section
Pierre-Yves Chibon a49ea7
         ``Source GIT URLs``, click on ``more`` to see them.