We strive for verbose and readable comments and docstrings. All code and documentation should follow our style guide. The hosted docs are automatically generated using Sphinx.
We deploy a local anvil chain to run system tests. Therefore, you must install foundry as a prerequisite for running tests.
Testing is achieved with py.test.
You can run all tests from the repository root directory by running python -m pytest
, or you can pick a specific test with python -m pytest {path/to/test_file.py}
.
General integration-level tests are in the tests
folder, while more isolated or unit tests are colocated with the files they are testing and end with a _test.py
suffix.
To run coverage locally you can follow these steps:
pip install coverage
coverage run -m pytest
coverage html
then just open htmlcov/index.html
to view the report!
We follow a standard feature branch rebase workflow that prioritizes short PRs with isolated improvements.
Commits to main
should only be made in the form of squash-merges from pull requests.
For example,
git checkout feature-branch
git add [files to be committed]
git commit -m 'Change summary'
later, some new commits show up in main, so we rebase our branch
git pull --rebase origin main
git push -f feature-branch
now, we have completed our feature, so we create a PR to merge the branch into main
Once the PR is approved, we perform a final rebase, if necessary, and then a squash merge.
This means each PR results in a single commit to main
.
Please provide a brief description of the PR in the summary instead of a list of commit strings.
We welcome contributions of new bot policies, alongside those in src/agent0/core/hyperdrive/policies
.
Submit a pull request that meets the following criteria:
- Do something an existing policy doesn't already accomplish
- Be well-documented and follow our existing STYLEGUIDE.md.
- Pass all linting and type checks (the GH actions will check this for you).
- Describe the bot's behavior in a
describe
classmethod similarly to existing bots, ending in asuper().describe()
call.
For code owners who wish to publish a release, make sure to follow these guidelines:
- Merge a PR that edits
pyproject.toml
to specify the new semver version. - From the updated
main
branch, make a new tag withgit tag vX.Y.Z
. - Push that tag to the remote repository with
git push --tags
. - Go to the
releases
tab in Github and add the new tag as a release. - Click the "Generate Release Notes" button to generate release notes.
- Add a brief summary under the "What's Changed" heading and create a "PRs" heading for the generated list of "PRs".