snowplow-python-tracker is a fork of the original Snowplow Python tracker v0.8.0.
- About this document
- Getting the code
- Setting up an environment
- Running in development
- Testing
- Debugging
- Adding or modifying a changelog entry
- Submitting a Pull Request
- Troubleshooting Tips
There are many ways to contribute to the ongoing development of snowplow-python-tracker, such as by participating in discussions and issues. We encourage you to first read our higher-level document: "Expectations for Open Source Contributors".
The rest of this document serves as a more granular guide for contributing code changes to snowplow-python-tracker (this repository). It is not intended as a guide for using snowplow-python-tracker, and some pieces assume a level of familiarity with Python development (virtualenvs, pip, etc). Specific code snippets in this guide assume you are using macOS or Linux and are comfortable with the command line.
- CLA: Please note that anyone contributing code to
snowplow-python-trackermust sign the Contributor License Agreement. If you are unable to sign the CLA, thesnowplow-python-trackermaintainers will unfortunately be unable to merge any of your Pull Requests. We welcome you to participate in discussions, open issues, and comment on existing ones. - Branches: All pull requests from community contributors should target the
masterbranch (default). - Releases: This repository is released only as needed.
You will need git in order to download and modify the source code.
If you are not a member of the dbt-labs GitHub organization, you can contribute to snowplow-python-tracker by forking the snowplow-python-tracker repository. For a detailed overview on forking, check out the GitHub docs on forking. In short, you will need to:
- Fork the
snowplow-python-trackerrepository - Clone your fork locally
- Check out a new branch for your proposed changes
- Push changes to your fork
- Open a pull request against
dbt-labs/snowplow-python-trackerfrom your forked repository
If you are a member of the dbt-labs GitHub organization, you will have push access to the snowplow-python-tracker repo. Rather than forking snowplow-python-tracker to make your changes, just clone the repository, check out a new branch, and push directly to that branch.
There are some tools that will be helpful to you in developing locally. While this is the list relevant for snowplow-python-tracker development, many of these tools are used commonly across open-source python projects.
We strongly recommend using virtual environments when developing code in snowplow-python-tracker. We recommend creating this virtualenv
in the root of the snowplow-python-tracker repository. To create a new virtualenv, run:
python3 -m venv env
source env/bin/activateThis will create and activate a new Python virtual environment.
First make sure that you set up your virtualenv as described in Setting up an environment. Also ensure you have the latest version of pip installed with pip install --upgrade pip. Next, install snowplow-python-tracker (and its dependencies):
git
pre-commit installOnce you're able to manually test that your code change is working as expected, it's important to run existing automated tests, as well as adding some new ones. These tests will ensure that:
- Your code changes do not unexpectedly break other established functionality
- Your code changes can handle all known edge cases
- The functionality you're adding will keep working in the future
None needed.
docker-compose run --rm test tox
- This is a fork of snowplow-python-tracker and bets practices in that repository should be followed here
Code can be merged into the current development branch main by opening a pull request. A snowplow-python-tracker maintainer will review your PR. They may suggest code revision for style or clarity, or request that you add unit or integration test(s). These are good things! We believe that, with a little bit of help, anyone can contribute high-quality code.
Automated tests run via GitHub Actions. If you're a first-time contributor, all tests (including code checks and unit tests) will require a maintainer to approve. Changes in the snowplow-python-tracker repository trigger integration tests against Postgres. dbt Labs also provides CI environments in which to test changes to other adapters, triggered by PRs in those adapters' repositories, as well as periodic maintenance checks of each adapter in concert with the latest snowplow-python-tracker code changes.
Once all tests are passing and your PR has been approved, a snowplow-python-tracker maintainer will merge your changes into the active development branch. And that's it! Happy developing 🎉
- Sometimes, the content license agreement auto-check bot doesn't find a user's entry in its roster. If you need to force a rerun, add
@cla-bot checkin a comment on the pull request.