{"id":21452283,"url":"https://github.com/packit/contributing","last_synced_at":"2026-01-03T15:10:05.623Z","repository":{"id":43147702,"uuid":"297585572","full_name":"packit/contributing","owner":"packit","description":"Repo that contains contribution guidelines","archived":false,"fork":false,"pushed_at":"2024-10-14T23:09:27.000Z","size":47,"stargazers_count":1,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-23T12:31:45.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/packit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-22T08:31:55.000Z","updated_at":"2024-07-05T08:40:56.000Z","dependencies_parsed_at":"2023-02-16T15:46:11.171Z","dependency_job_id":"c9563cd5-f830-4fa7-9058-e2e4afaea1b1","html_url":"https://github.com/packit/contributing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packit%2Fcontributing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packit%2Fcontributing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packit%2Fcontributing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packit%2Fcontributing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/packit","download_url":"https://codeload.github.com/packit/contributing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965240,"owners_count":20375901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T04:28:39.335Z","updated_at":"2026-01-03T15:10:05.578Z","avatar_url":"https://github.com/packit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contribution guidelines for Packit projects\n\nThank you for your interest in contributing to one of our projects.\nThe following is a set of guidelines for contributing to our projects.\n\nUse your best judgement, and feel free to propose changes to this document in a pull request.\n\nBy contributing to this project you agree to the Developer Certificate of Origin (DCO). This document is a simple statement that you, as a contributor, have the legal right to submit the contribution. See the [DCO](DCO) file for details.\n\n# Reporting Bugs\n\nBefore creating bug reports, please check a list of known issues to see if the\nproblem has already been reported (or fixed in a `main` branch).\n\nIf you're unable to find an open issue addressing the problem, open a new one.\nBe sure to include a **descriptive title and a clear description**. Ideally, please\nprovide:\n\n- version you are using\n- the command you executed and a debug output (using option `--debug`)\n\nIf possible, add a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.\n\n**Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.\nYou can also comment on the closed issue to indicate that upstream should provide a new release with a fix.\n\n## Suggesting Enhancements\n\nEnhancement suggestions are tracked as GitHub issues.\nWhen you are creating an enhancement issue, **use a clear and descriptive title** and **provide a clear description of the suggested enhancement** in as many details as possible.\n\n# Guidelines for Developers\n\n## Is this your first contribution?\n\nPlease take a few minutes to read GitHub's guide on [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/).\nIt's a quick read, and it's a great way to introduce yourself to how things work behind the scenes in open-source projects.\n\n## Dependencies\n\nThe **python3-devel**, **krb5-devel** and **gcc** packages are needed in order to be able to\n\n`pip3 install packitos`\n\nOn Fedora you can install them like this:\n\n`sudo dnf install python3-devel krb5-devel gcc`\n\nIf you are introducing a new python dependency, please make sure it's added to:\n\n- `setup.cfg`\n\n## Changelog\n\nWhen you are contributing to changelog, please follow these suggestions:\n\n- Changelogs is maintained mainly during release process.\n- The changelog is meant to be read by everyone. Imagine that an average user\n  will read it and should understand the changes.\n- Every line should be a complete sentence. Either tell what is the change that the tool is doing or describe it precisely:\n  - Bad: `Use search method in label regex`\n  - Good: `X now uses search method when...`\n- And finally, with the changelogs we are essentially selling our projects:\n  think about a situation that you met someone at a conference and you are\n  trying to convince the person to use the project and that the changelog\n  should help with that.\n\n## How to contribute code to our projects\n\n1. Create a fork of the desired repository.\n2. Create a new branch just for the bug/feature you are working on.\n3. Once you have completed your work, create a Pull Request, ensuring that it meets the requirements listed below.\n\n## Requirements for Pull Requests (PR)\n\n- Use `pre-commit` (see [below](#pre-commit)).\n- Follow git workflow (see [below](#git-workflow))\n- Cover new code with a test case (new or existing one).\n- All tests have to pass.\n- Create a PR against the `main` branch.\n- The `mergeit` label:\n  - Is used to instruct CI and/or reviewer that you're really done with the PR.\n  - PRs are merged if they have `mergeit` label **AND** are approved.\n- Status checks SHOULD all be green.\n  - Reviewer(s) have final word and HAVE TO run tests locally if they merge a PR with a red CI.\n\n### `pre-commit`\n\nThere's a [pre-commit](https://pre-commit.com) config file in [.pre-commit-config.yaml](.pre-commit-config.yaml).\n\nYou need to install pre-commit to [utilize](https://pre-commit.com/#usage) it locally on your workstation, either from your distribution\n\n    dnf install pre-commit\n\nor from PyPI:\n\n    pip3 install pre-commit\n\n- `pre-commit install -t pre-commit -t pre-push` - to install pre-commit into your [git hooks](https://githooks.com). pre-commit will from now on run all the checkers/linters/formatters on every commit. If you later want to commit without running it, just run `git commit` with `-n/--no-verify`.\n- Or if you want to manually run all the checkers/linters/formatters, run `pre-commit run --all-files`.\n\n### Git workflow\n\n- If you are new to git, check the git basics [here](./git-basics.md).\n- Write reasonable commit messages (See [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/)).\n  - Please provide the reason or motivation for the introduced change in the body of the\n    commit message, or reference an issue. This is going to be helpful in the future to\n    understand _why_ the change was made.\n- Use common sense when creating commits, not too big, not too small.\n  You can also squash them at the end of review. Try to think about the reviewer\n  going through the pull request and commits. For example don't make too many changes\n  that aren't related, e.g. resolving 2 unrelated issues in one PR or having all\n  changes in one commit is not a good idea.\n- Rebasing lets you resolve any merge conflicts on your side. Also it allows CI\n  to check everything is passing, i.e. no mistakes were made by fixing conflicts.\n- You can mention issues that will be closed in a PR description, e.g.:\n  `Closes #123`, `Fixes #123`; [more info](https://docs.github.com/en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords)\n\n#### Rebasing\n\nTo keep our git history clean and easy to navigate we rebase our branches before\nmerging as mentioned above. `pre-commit` checks if you need to rebase.\n\nFor more info regarding rebasing and merging see:\n\n- [Atlassian tutorial for merging and rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)\n- [Git - When to Merge vs. When to Rebase](https://derekgourlay.com/blog/git-when-to-merge-vs-when-to-rebase/)\n- [Git team workflows: merge or rebase?](https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase)\n\n##### pre-commit git hook and rebasing\n\nWe have switched our rebase checks from pre-commit hook to pre-push hook, so the\nproblem and possible solutions described below should not be relevant anymore.\n\nIn case you have encountered any problems we recommend following new installation\ninstructions:\n\n```sh\n$ pre-commit install -t pre-commit -t pre-push\n```\n\nAnd in case you have already installed pre-commit as git hooks **before** we\nswitched, we recommend you to try following to reinstall them:\n\n```sh\n$ pre-commit install -t pre-commit -t pre-push -f\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eRebase to commit, but commit to rebase\u003c/summary\u003e\n\nIn case you have installed pre-commit as a git hook and you want to commit changes,\nyou might encounter a problem when you need to rebase your branch, but to do that\nyou need to commit changes. [Closer info](https://github.com/packit/pre-commit-hooks/issues/2).\n\nTo resolve this issue there are 3 options:\n\n1. skip the rebase check in pre-commit hook:\u003cbr\u003e\n   `env SKIP=check-rebase git commit`\n2. skip whole pre-commit check with:\u003cbr\u003e\n   `git commit -n` or `git commit --no-verify`\n3. stash your changes, rebase, pop the stash and commit\n\nWe recommend 3rd option, for the 1st it's easy to forget to rebase afterwards and\nfor the 2nd you can additionally fail other checks.\n\n\u003c/details\u003e\n\n#### Examples of git history\n\n\u003cdetails\u003e\n\u003csummary\u003eGit history that we want to have\u003c/summary\u003e\n\n```\n*   e3ed88b (HEAD -\u003e contribution-guide, upstream/master, origin/master, origin/HEAD, master) Merge pull request #470 from lachmanfrantisek/fix_lru_cache\n|\\\n| * 1ab7d9f Use parenthesis for lru_cache decorator\n|/\n*   e9c5bb4 Merge pull request #468 from lachmanfrantisek/hostname\n|\\\n| * de2d6cf Add hostname property to service class\n| * cd2ed17 Fix inheritance of GitlabService from BaseGitService\n|/\n*   028c344 Merge pull request #465 from packit/0.15.0-release\n|\\\n| * 7b619d6 0.15.0 release\n|/\n*   acdf7df Merge pull request #463 from lachmanfrantisek/support-multi-part-namespaces\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGit history that we \u003cb\u003edon't\u003c/b\u003e want to have\u003c/summary\u003e\n\n```\n*   4c8aca8 Merge pull request #120 from TomasTomecek/add-zuul\n|\\\n| * fc2b449 use zuul for realz now\n| * 2304683 add zuul config\n| * 5285bd3 bump base image to F30\n* |   4d0fbe2 Merge pull request #114 from lbarcziova/create_method_create_release\n|\\ \\\n| * | 36a9396 test changed\n| * | 22f681d method create release for github created\n* | |   2ef4ea1 Merge pull request #119 from lbarcziova/clean_utils.py\n|\\ \\ \\\n| |/ /\n|/| |\n| * | 5f1b8f0 unused functions removed\n* | |   a93c361 Merge pull request #117 from marusinm/add-getreleases-to-abstract\n|\\ \\ \\\n| |/ /\n|/| |\n| * | 0a97236 add get_releses for Pagure\n| * | 55e4c57 add get_releases/get_release into abstract.py\n|/ /\n* |   badeddd Merge pull request #101 from marusinm/read-permissions\n```\n\n\u003c/details\u003e\n\n### Checkers/linters/formatters\n\nTo make sure our code is [PEP8](https://www.python.org/dev/peps/pep-0008/) compliant, we use:\n\n- [black code formatter](https://github.com/psf/black)\n- [Flake8 code linter](http://flake8.pycqa.org)\n- [mypy static type checker](http://mypy-lang.org)\n- [pyupgrade to upgrade syntax](https://github.com/asottile/pyupgrade)\n\nThey are included as pre-commit tasks if necessary.\n\n### Docstrings\n\nHistorically docstrings in Packit-projects were written in Sphinx-style (aka\n[reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/)).\n\nIn order to improve readability, and make the writing of docstrings easier,\nall projects are transitioning to use [Google-style\ndocstrings](https://google.github.io/styleguide/pyguide.html#381-docstrings).\nDocstrings for new code should be written in this later format. The two\nformats should never be mixed within the same docstring.\n\n#### Examples for Google-style docstrings\n\nFunctions, arguments, return values, errors raised:\n\n```python\ndef check_subpath(\n    subpath: Path, path: Path, ensure_trailing_slash: bool = False\n) -\u003e str:\n    \"\"\"Check if 'subpath' is a subpath of 'path'\n\n    Args:\n        subpath: Subpath to be checked.\n        path: Path agains which subpath is checked.\n\n    Returns:\n        'subpath', resolved, in case it is a subpath of 'path'.\n\n    Raises:\n        PackitException, if 'subpath' is not a subpath of 'path'.\n    \"\"\"\n```\n\nGenerators:\n\n```python\ndef iter_srcs(synced_files: Sequence[SyncFilesItem]) -\u003e Iterator[str]:\n    \"\"\"Iterate over all the src-s in a list of SyncFilesItem\n\n    Args:\n        synced_files: List of SyncFilesItem.\n\n    Yields:\n        src-s from every SyncFilesItem, one by one.\n    \"\"\"\n```\n\nClasses:\n\n- Document attributes.\n- If `__init__` args are the same as attributes, don't write a docstring for\n  it.\n- `self` doesn't need to be documented as an arg for methods.\n\n```python\nclass SyncFilesItem:\n    \"\"\"Some files to sync to destination\n\n    Think about this as a wrapper around 'rsync'.\n\n    Attributes:\n        src: List of paths to sync.\n        dest: Destination to sync to.\n        mkpath: Create the destination's path component.\n        delete: Delete extra files from dest dirs.\n        filters: List of rsync filters used for syncing.\n    \"\"\"\n\n    def __init__(\n        self,\n        src: Sequence[Union[str, Path]],\n        dest: Union[str, Path],\n        mkpath: bool = False,\n        delete: bool = False,\n        filters: Optional[List[str]] = None,\n    ):\n        # pathlib.Path has no support for trailing slashes, but\n\n```\n\n---\n\nThank you for your interest!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpackit%2Fcontributing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpackit%2Fcontributing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpackit%2Fcontributing/lists"}