Welcome to the metrics-utility project. We appreciate your contributions, whether fixing bugs, improving documentation, or adding new features. This guide will help you get started with our contribution process.
This contributor's guide assumes you can run git & Python from the command line, have a GitHub account, and have locally configured git with a name, email, and any github authentication method. Please make sure this is the case first.
We use a forking workflow to ensure stability in the main repository. Follow these steps to contribute:
-
Fork the ansible/metrics-utility repository to your GitHub account.
-
Clone your fork to your local machine:
git clone git@github.com:<your-username>/metrics-utility.git cd metrics-utility
-
Add the
upstreamremote to allow updating the devel branch.git remote add upstream https://github.com/ansible/metrics-utility.git git fetch --all git branch -u upstream/devel devel
-
Make sure your
develbranch is up to date.git checkout devel git pull --ff-only
-
Create a feature branch off devel:
git checkout -b <branch-name>
- Remember to start from an up to date version of the
develbranch - Use a descriptive branch name that reflects the work being done.
- If your work is related to a Jira ticket, consider including the issue ID:
git checkout -b feat/AAP-1234-logging-improvements
- Otherwise, choose a meaningful name that reflects the change
- The Conventional branch naming guide provides additional examples.
- Remember to start from an up to date version of the
-
Make changes and commit them:
git add . git commit -m "Short, clear description of change"
- If you are an internal contributor, ensure commits are signed (Verified tag) - github docs, and that your git-configured
user.emailmatches the signature address. - Following Conventional commits is recommended but not enforced. Commits get squashed on merge.
- If you are an internal contributor, ensure commits are signed (Verified tag) - github docs, and that your git-configured
-
Make sure linters pass and fix them if not:
make lint
OR
make fix
-
Make sure tests pass:
make compose
AND
make testThe compose environment is providing a postgres database for testing, and a minio for S3 target tests. If existing tests fail, fix the code. If new tests fail, fix the tests.
-
Push your branch to your fork:
git push -u origin <branch-name>
-
Open a pull request against the
develbranch of the main repository. (by clicking the link in the push output or going to GitHub manually) -
Respond to reviewers' comments, fix any failing checks, evaluate and fix (or describe why not) any issues from reviewer bots. Follow the PR until merged.
To ensure consistency and maintainability, a PR should meet the following criteria:
- PR has a descriptive title & description
- for example by following the pull request template (
.github/pull_request_template.md)
- for example by following the pull request template (
- Code should be properly formatted and linted - either by
pre-commitor usingmake lintandmake fix- The make commands run
uv run ruff ... - Review the essential linter settings in
pyproject.tomlto ensure compliance.
- The make commands run
- All conversations on the PR must be resolved before merging.
- PR must receive an approval from a maintainer.
- Commits by internal contributors must be signed.
- PR must pass required checks, including linters and tests.
For internal contributors, if your PR references internal AAP issues, keep in mind that external contributors may not have access to these references. Ensure that public-facing information is clear. Request to join the to join the aap-metrics-write GitHub team for merge permissions.
For external contributors, since you don't have write access, a maintainer will review and merge your PR.
See the README for prerequisities and the developer setup.
It is recommended to follow the following structure for documentation:
metrics-utility/
├── README.md # project overview & quick start
└── docs/
├── foo.md
├── bar.md
└── baz.md
All documentation should be valid GitHub-flavored markdown.
Note: downstream documentation
- Do NOT include internal deployment details, configurations, or organization-specific processes in this repository.
- Downstream documentation should be maintained in internal repositories instead.
- When in doubt, check with maintainers before adding documentation that might contain internal details.
If you encounter a bug or have a feature request, open an issue in the GitHub repository.