Replacement for https://docs.pagure.org/fedpkg/ Signed-off-by: Ondřej Nosek <onosek@redhat.com>
6.5 KiB
Index
- [Places and links][places]
- [Testing][testing]
- [Release process][release-process]
- [Documentation][documentation]
- [Code-review process][code-review]
Contributing
We love seeing Pull Requests from anyone.
For bigger or controversial changes, consider first discussing it via issue or any other method with the maintainers of this repository. Otherwise, there's a risk they might disagree with it and you could spend time on it in vain. Or you can just open a Pull Request and keep the discussion there.
All code should work well with Python 3.
Code is [reviewed][code-review] by package maintainers.
Sign Off
All commits must be signed-off on. Please use git commit -s to do that. This serves as a confirmation that you have the right to submit your changes. See Developer Certificate of Origin for details.
Other tips
You can increase the chance of your Pull Request being merged by:
- having good test coverage
- writing documentation
- following PEP 8 for code formatting
don't have bandit complains(not active in the Jenkins)- don't have ruff complains (some categories are currently excluded in the configuration)
- writing a good commit message
[places]:
Places and links
- code is hosted on Fedora Forge (upstream GIT)
- web documentation can be found here
- issue tracker
- Pull Requests (PR)
[testing]:
Testing process
Unittests are implemented to prevent issues and cover the code. When a new Pull Request is created (or rebased), unit tests are triggered in Jenkins. Test status is shown in the green (success) or red (failure) box on the Pull Request's page afterwards.
To see detailed test results, open the URL (click on the colour box), select default configuration and then Console Output.
How to run unit tests manually or offline, see the initial page or file README.rst.
[release-process]:
Release process
A fedpkg's release process could have two variants (both performed by maintainers):
-
A new fedpkg's release.
-
A release of a patch.
Releases are irregular (usually once per few months). They depend on the number of unreleased features and fixes and the time since the last release.
Patches are usually requested by customers or provided when there is an urgent issue found.
Sometimes rpkg (fedpkg depends on this library) needs to be released together with fedpkg. Or some functionality is implemented just in the rpkg instead.
[documentation]:
Documentation
Rpkg contains the web documentation. It is generated from templates that are stored in the "doc" directory together with documentation-building scripts and Makefile. Anyone can contribute with changes, but final regeneration is done by the maintainer during a new version [release process][release-process].
Contributors can check results by regenerating documentation offline:
cd doc
dnf install python3-sphinx python3-sphinx_rtd_theme
make html
[code-review]:
Code-review process
-
Motivation
Code reviews performed by various team members should maintain a steady quality and satisfy the same requirements. This document contains the baseline of checks that should be part of a code review. It is a high-level guide.
-
Process
When doing a code review, answer the questions in sections below.
Code in a Pull Request needs approval from one of the fedpkg's maintainers.
-
Requirements
- Does the change fix the problem and satisfy requirements?
-
Best practices
- Is the code formatted properly? Is it readable?
- Are there no unnecessary changes?
- Are errors handled correctly?
- Is there an appropriate amount of comments?
- Is the code understandable?
- Is there enough documentation?
- Is the code efficient enough? Do you see obvious performance issues?
- Does the commit message follow conventions?
-
Testing
- Do unit tests pass?
- Is static application security testing reporting no problems?
- Are there tests for the new code?
- Did the author test the changes?
-
Security
- Is all input correctly validated?
- Is all output correctly escaped?
- Is there a risk of exposing any private information?
-
BONUS: Security - Perform threat modelling
- Who are the actors (people, services) who are going to interact with the new feature?
- What is the attack surface: how does the feature get input? Network communication? Web interface? CLI?
- Consider threats:
- Spoofing: pretending you're someone you are not
- Tampering: modifying data
- Repudiation: Can someone change information without the system owner knowing about it ("I didn't do it, nobody saw me, can't prove anything")
- Information disclosure: leaking private information
- Denial of Service: stopping something from working or responding
- Elevation of Privilege: Upgrade access level from user to admin
- Document any findings in a comment on the Pull Request.