Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitbucket: update merge_pull_request method to add merge_message, close_source_branch and merge_strategy parameters #1437

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

jorgegomzar
Copy link
Contributor

Hello there,

I recently discovered this library, nice work btw, and wanted to use it to automate some CICD in my company.

When trying to merge pull requests I noticed that merge_pull_request method was failing, after some investigation and searching in Bitbucket API docs I found that some parameters were missing from the POST body --> source

This PR aims to add these parameters. I took the liberty of also adding type hints and validation via Enum class for the MergeStrategies, hope this is okay with you.

I ran make qa and here is the final output:

doc8: commands[0]> doc8 --ignore-path docs/_build/ docs/
Scanning...
Validating...
========
Total files scanned = 9
Total files ignored = 0
Total accumulated errors = 0
Detailed error counts:
    - doc8.checks.CheckCarriageReturn = 0
    - doc8.checks.CheckIndentationNoTab = 0
    - doc8.checks.CheckMaxLineLength = 0
    - doc8.checks.CheckNewlineEndOfFile = 0
    - doc8.checks.CheckTrailingWhitespace = 0
    - doc8.checks.CheckValidity = 0
  py3: OK (11.48=setup[6.27]+cmd[0.18,2.83,2.19] seconds)
  flake8: OK (1.40=setup[0.01]+cmd[1.39] seconds)
  black: OK (2.00=setup[0.01]+cmd[1.99] seconds)
  mypy: OK (0.87=setup[0.01]+cmd[0.86] seconds)
  bandit: OK (1.86=setup[0.01]+cmd[1.85] seconds)
  doc8: OK (0.89=setup[0.01]+cmd[0.89] seconds)
  congratulations :) (18.65 seconds)

I did not add any test though since the CONTRIBUTOR.rst doesn't mention anything about it, but if you want me to, please let me know.

Thanks!

…se_source_branch and merge_strategy parameters
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 34.42%. Comparing base (d08b7fb) to head (841d46b).
Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
atlassian/bitbucket/__init__.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1437      +/-   ##
==========================================
+ Coverage   34.38%   34.42%   +0.04%     
==========================================
  Files          46       46              
  Lines        8586     8592       +6     
  Branches     1601     1602       +1     
==========================================
+ Hits         2952     2958       +6     
  Misses       5511     5511              
  Partials      123      123              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants