feat(bitbucket): add server-level hook-script management methods - #1653
Merged
gonchik merged 1 commit intoAug 16, 2026
Merged
Conversation
Add get_hook_script, get_hook_script_content, update_hook_script and delete_hook_script for Bitbucket Data Center global hook scripts, completing the server-level endpoints requested in atlassian-api#1554. Includes unit tests and documentation.
Member
|
Thanks @mrcrysta1 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1653 +/- ##
==========================================
+ Coverage 59.74% 59.76% +0.02%
==========================================
Files 101 101
Lines 16868 16881 +13
Branches 1746 1748 +2
==========================================
+ Hits 10077 10089 +12
Misses 6393 6393
- Partials 398 399 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the four remaining server-level hook-script endpoints for Bitbucket
Data Center (8+), completing the coverage requested in #1554. The
project/repository-level methods already existed; this PR closes the global
management gap:
get_hook_script(script_id)→GET /rest/api/latest/hook-scripts/{scriptId}get_hook_script_content(script_id)→GET /rest/api/latest/hook-scripts/{scriptId}/content(raw body, usesnot_json_response=True)update_hook_script(script_id, content, name, hook_type, description=None)→PUT /rest/api/latest/hook-scripts/{scriptId}(multipart form, mirrorscreate_hook_script)delete_hook_script(script_id)→DELETE /rest/api/latest/hook-scripts/{scriptId}Each method follows the existing
create_hook_scriptstyle:hook_typevalidated against
PRE/POST, multipart fields passed as tuples, and theX-Atlassian-Token: no-checkheader for state-changing requests.Changes
atlassian/bitbucket/__init__.py: 4 new methods next tocreate_hook_scripttests/test_bitbucket_server.py: 6 new tests inTestHookScripts(URLs,multipart fields, hook-type validation,
not_json_responseflag)docs/bitbucket.rst: usage example for the new server-level methodsValidation
pytest tests/test_bitbucket_server.py -k HookScript: 9 passedblack --check atlassian/bitbucket/__init__.py tests/test_bitbucket_server.py: cleanNotes
This work was developed with AI assistance (code generation and tests), and
reviewed by a human before submission.