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

support creating draft PRs for bitbucket server #359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ Pushes the branch to `origin` and then creates a Bitbucket pull request for the
- Create an application password within your [account settings](https://bitbucket.domain.com/plugins/servlet/access-tokens/manage).
- We need the scope: Repositories -> Read

#### Optional `push_settings`

- `draft` (default: `false`) if true will open the pull request as a draft.


### `all_repos.push.gitlab_pull_request`

Pushes the branch to `origin` and then creates a GitLab pull request for the branch.
Expand Down
2 changes: 2 additions & 0 deletions all_repos/push/bitbucket_server_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Settings(NamedTuple):
username: str
app_password: str
base_url: str
draft: bool = False

@property
def auth(self) -> str:
Expand Down Expand Up @@ -50,6 +51,7 @@ def make_pull_request(
'state': 'OPEN',
'open': True,
'closed': False,
'draft': settings.draft,
'fromRef': {
'id': head,
'repository': {
Expand Down
1 change: 1 addition & 0 deletions tests/push/bitbucket_server_pull_request_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ def test_settings_repr():
" username='cool_user',\n"
' app_password=...,\n'
" base_url='bitbucket.domain.com',\n"
' draft=False,\n'
')'
)
Loading