Bitbucket push webhook handler to generate a list of files changed on a push
Project description
Bitbucket hook diffstat
Overview
Bitbucket push webhook handler to generate a list of files changed on a push.
It processes branch updates, and the branch creates events and extracts the file paths of the files whose content was changed in that event, including the removal or creation of the file itself.
In the case of a branch update event, it gets the changeset between the current HEAD of the branch and the previous HEAD of that branch.
In case the branch is created, it gets the changeset between the current HEAD of the branch and the HEAD of the main branch of the repository.
It uses Bitbucket diffstat
, repositories
, and branches
APIs. It handles some basic retries on unexpected HTTP response codes from BitBucket.
Usage
from bitbucket_hook_diffstat import process_bitbucket_push_events
result = process_bitbucket_push_events(
push_payload, repo_owner, repo_name, bitbucket_user, bitbucket_password
) # it might raise an Exception, please check `bitbucket_hook_diffstat/exceptions.py`
result # Is a dict of a zero or more branch names - strings to the set of one or many file pathnames - strings.
{'master': {'.gitignore'}}
push_payload
is a Bitbucket repository push event
repo_owner
and repo_name
one can retrieve from the repository URL https://bitbucket.org/repo_owner/repo_name
bitbucket_password
is an "app password" and bitbucket_user
is available as "Username" in Bitbucket profile settings. This user should be authorized to do Repositories Read.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bitbucket-hook-diffstat-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b9ca4d67ff1685b76d834129623c9e3ef171589a8ad50ea2c02742897cd7711 |
|
MD5 | 1a06ab9acaea5c8202ab4fd85ca632d5 |
|
BLAKE2b-256 | b18047708467e0d81876ddbc6efee4618867f2c82f13a15f969ba5bd33df60f3 |
Hashes for bitbucket_hook_diffstat-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b706bb0f5752472fe8a7d7c3231899c3b1b6b6f7d6d3d1ebb6a56ac333701f7d |
|
MD5 | 298090a1d2a182f484cdc5e731f05c40 |
|
BLAKE2b-256 | 19eb41e786d5b9413a12bf1d44dcd3c31411fe4fe379b028aafde3d5673ce359 |