From Fedora Project Wiki

(add to taskotron category)
(bit more detail on pull requests in pagure)
 
(11 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
The repositories for the various components of [[Taskotron]] can be found on [https://pagure.io Pagure]:
 
The repositories for the various components of [[Taskotron]] can be found on [https://pagure.io Pagure]:
  
* [https://pagure.io/taskotron/libtaskotron libtaskotron]
+
''' https://pagure.io/group/taskotron '''
* [https://pagure.io/taskotron/taskotron-trigger taskotron-trigger]
 
* [https://pagure.io/taskotron/execdb ExecDB]
 
* [https://pagure.io/taskotron/resultsdb ResultsDB]
 
* [https://pagure.io/taskotron/resultsdb_frontend ResultsDB frontend]
 
* [https://pagure.io/taskotron/resultsdb_api ResultsDB API client library]
 
  
The repositories for the tasks developed alongside Taskotron itself are in the [https://bitbucket.org/fedoraqa Fedora QA project on Bitbucket]:
+
The repositories for the tasks developed alongside Taskotron itself are prefixed with ''task-''.
  
* [https://bitbucket.org/fedoraqa/task-rpmlint task-rpmlint]
+
Feel free to submit bugs or pull requests for any of these repositories. Pull requests in Pagure work much as they do in github, which you may well be familiar with: you can use the web interface to 'fork' the main project into your user namespace, then push changes to your fork (it's best to use one git branch per change) and use the web interface to submit pull requests from branches in your fork.
* [https://bitbucket.org/fedoraqa/task-depcheck task-depcheck]
 
* [https://bitbucket.org/fedoraqa/task-upgradepath task-upgradepath]
 
* [https://bitbucket.org/fedoraqa/task-rpmgrill task-rpmgrill]
 
* [https://bitbucket.org/fedoraqa/task-dockerautotest task-dockerautotest]
 
  
If you need team membership, send a message out to qa-devel@ or file a ticket in [[QA:Phabricator]] against the infrastructure project.
+
== Getting help ==
  
== Issue and code change tracking ==
+
Remember, if you want to help out but are having trouble following these instructions, you can always get in touch with us for help! Please mail {{fplist|qa-devel}} or ask in {{fpchat|#fedora-qa}} and someone will likely be able to help you out.
 
 
Tracking of issues and code changes for all Taskotron projects happens in the [https://phab.qa.fedoraproject.org Fedora QA instance] of [[QA:Phabricator|Phabricator]]. Please see [[QA:Phabricator#issues-diffs|this section of the page]] for general instructions on submitting issues and 'diffs' in Phabricator.
 
  
 
== Taskotron-specific instructions ==
 
== Taskotron-specific instructions ==
  
 
There are some specific considerations for contributing to Taskotron components.
 
There are some specific considerations for contributing to Taskotron components.
 +
 +
=== virtualenv ===
 +
 +
For most Taskotron components, we recommend you submit diffs from within a [http://docs.python-guide.org/en/latest/dev/virtualenvs/ virtualenv]. This will ensure the tests and linter (see below) run correctly. If run directly from the host system, they may not do so. The general process for creating and entering a virtualenv is as follows:
 +
 +
dnf install python2-virtualenv python-pip
 +
virtualenv --system-site-packages env_somename/
 +
source env_somename/bin/activate
 +
 +
{{code|env_somename}} is an arbitrary name for the virtualenv; it's customary to name it for the project, but you can call it anything. To exit the virtualenv, run {{code|deactivate}}. Usually, after entering the environment, this will install the requirements for testing (and, if appropriate, running a development instance of) the project, and install the project within the virtualenv in 'editable' mode so that changes you make to the source will be immediately reflected when running the code in the virtualenv:
 +
 +
pip install --ignore-installed -r requirements.txt
 +
pip install -e .
 +
 +
Each project's own README file should usually contain more detailed instructions on this step for the specific project, so check that out too.
  
 
=== gitflow ===
 
=== gitflow ===
  
Gitflow is a git branching strategy that has been used successfully in the blocker tracking app and several Fedora infra apps.
+
Gitflow is a git branching strategy that has been used successfully in the blocker tracking app and several Fedora infra apps. Most Taskotron component projects use the gitflow strategy.
  
 
* [http://nvie.com/posts/a-successful-git-branching-model/ Description of the gitflow strategy]
 
* [http://nvie.com/posts/a-successful-git-branching-model/ Description of the gitflow strategy]
 
* [https://github.com/nvie/gitflow gitflow tool code and docs]
 
* [https://github.com/nvie/gitflow gitflow tool code and docs]
  
{{admon/note|Use the develop branch|When using gitflow, the current in-development branch is <code>develop</code>, not <code>master</code>. Be careful not to start developing against an older branch}}
+
Run
 +
 
 +
# fork the project and clone it
 +
git checkout develop
 +
git pull
 +
git checkout -b feature/fixurl
 +
# do your work
 +
git commit
 +
git push
 +
# submit a pull request from web UI
  
=== Tests ===
+
Always remember to do a {{code|git pull}} to get all the latest changes.
  
Taskotron components usually have test suites built on [http://docs.pytest.org/en/latest/ Pytest]. Ensure you have {{package|pytest}} installed to run the tests.
+
{{admon/note|Use the develop branch|When using gitflow, the current in-development branch is {{code|develop}}, not {{code|master}}. This means you should always branch off {{code|develop}} when developing changes.}}
  
=== Linting ===
+
=== Tests and linting ===
  
As we are using code linting, you will also need the flake8 tool - run {{code|sudo dnf install python-flake8}} to install it.
+
Taskotron components usually have test suites built on [http://docs.pytest.org/en/latest/ Pytest], and run lint checks using [https://github.com/PyCQA/flake8 flake8]. To ensure you have these packages installed, run {{code|sudo dnf install pytest python2-flake8 python-pep8}}. When testing and submitting changes, remember to run {{code|pytest}} inside your virtualenv to ensure the tests run correctly. Run {{code|flake8}} and {{code|pep8}} on files you modified to check for other errors (TODO: add better instructions).
  
 
=== General Thoughts and conventions ===
 
=== General Thoughts and conventions ===
Line 50: Line 63:
 
* All code going into develop branches '''MUST''' be reviewed
 
* All code going into develop branches '''MUST''' be reviewed
 
* All code should have good unit tests where appropriate
 
* All code should have good unit tests where appropriate
** When in doubt, ask
+
* When in doubt, ask
  
 
[[Category:Taskotron]]
 
[[Category:Taskotron]]

Latest revision as of 18:32, 4 September 2017

Repositories

The repositories for the various components of Taskotron can be found on Pagure:

https://pagure.io/group/taskotron

The repositories for the tasks developed alongside Taskotron itself are prefixed with task-.

Feel free to submit bugs or pull requests for any of these repositories. Pull requests in Pagure work much as they do in github, which you may well be familiar with: you can use the web interface to 'fork' the main project into your user namespace, then push changes to your fork (it's best to use one git branch per change) and use the web interface to submit pull requests from branches in your fork.

Getting help

Remember, if you want to help out but are having trouble following these instructions, you can always get in touch with us for help! Please mail qa-devel or ask in #fedora-qa[?] and someone will likely be able to help you out.

Taskotron-specific instructions

There are some specific considerations for contributing to Taskotron components.

virtualenv

For most Taskotron components, we recommend you submit diffs from within a virtualenv. This will ensure the tests and linter (see below) run correctly. If run directly from the host system, they may not do so. The general process for creating and entering a virtualenv is as follows:

dnf install python2-virtualenv python-pip
virtualenv --system-site-packages env_somename/
source env_somename/bin/activate

env_somename is an arbitrary name for the virtualenv; it's customary to name it for the project, but you can call it anything. To exit the virtualenv, run deactivate. Usually, after entering the environment, this will install the requirements for testing (and, if appropriate, running a development instance of) the project, and install the project within the virtualenv in 'editable' mode so that changes you make to the source will be immediately reflected when running the code in the virtualenv:

pip install --ignore-installed -r requirements.txt
pip install -e .

Each project's own README file should usually contain more detailed instructions on this step for the specific project, so check that out too.

gitflow

Gitflow is a git branching strategy that has been used successfully in the blocker tracking app and several Fedora infra apps. Most Taskotron component projects use the gitflow strategy.

Run

# fork the project and clone it
git checkout develop
git pull
git checkout -b feature/fixurl
# do your work
git commit
git push
# submit a pull request from web UI

Always remember to do a git pull to get all the latest changes.

Note.png
Use the develop branch
When using gitflow, the current in-development branch is develop, not master. This means you should always branch off develop when developing changes.

Tests and linting

Taskotron components usually have test suites built on Pytest, and run lint checks using flake8. To ensure you have these packages installed, run sudo dnf install pytest python2-flake8 python-pep8. When testing and submitting changes, remember to run pytest inside your virtualenv to ensure the tests run correctly. Run flake8 and pep8 on files you modified to check for other errors (TODO: add better instructions).

General Thoughts and conventions

  • Be smart
  • All code going into develop branches MUST be reviewed
  • All code should have good unit tests where appropriate
  • When in doubt, ask