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

fix: rename "Bitbucket Server" with "Bitbucket Data Center" #13311

Merged
merged 1 commit into from
Dec 16, 2024
Merged
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
2 changes: 1 addition & 1 deletion docs/admin/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ BITBUCKETSERVER_CREDENTIALS

.. versionadded:: 4.16

List for credentials for Bitbucket servers.
List for credentials for Bitbucket Data Center.

.. code-block:: python

Expand Down
154 changes: 109 additions & 45 deletions docs/admin/continuous.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,51 +354,115 @@ choosing :guilabel:`GitHub`, :guilabel:`GitLab`, :guilabel:`Gitea`, :guilabel:`G
:guilabel:`Azure DevOps`, or :guilabel:`Pagure` as :ref:`component-vcs` in :ref:`component`.

Overall, following options are available with Git, Mercurial, GitHub, GitLab,
Gitea, Pagure, Azure DevOps, Bitbucket Server and Bitbucket Cloud:

+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Desired setup | :ref:`component-vcs` | :ref:`component-push` | :ref:`component-push_branch` |
+=============================================+===============================+===============================+===============================+
| No push | :ref:`vcs-git` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Push directly | :ref:`vcs-git` | SSH URL | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Push to separate branch | :ref:`vcs-git` | SSH URL | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| No push | :ref:`vcs-mercurial` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Push directly | :ref:`vcs-mercurial` | SSH URL | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Push to separate branch | :ref:`vcs-mercurial` | SSH URL | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| GitHub pull request from fork | :ref:`vcs-github` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| GitHub pull request from branch | :ref:`vcs-github` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| GitLab merge request from fork | :ref:`vcs-gitlab` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| GitLab merge request from branch | :ref:`vcs-gitlab` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Gitea merge request from fork | :ref:`vcs-gitea` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Gitea merge request from branch | :ref:`vcs-gitea` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Pagure merge request from fork | :ref:`vcs-pagure` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Pagure merge request from branch | :ref:`vcs-pagure` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Azure DevOps pull request from fork | :ref:`vcs-azure-devops` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Azure DevOps pull request from branch | :ref:`vcs-azure-devops` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Bitbucket server pull request from fork | :ref:`vcs-bitbucket-server` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Bitbucket server pull request from branch | :ref:`vcs-bitbucket-server` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Bitbucket Cloud pull request from fork | :ref:`vcs-bitbucket-cloud` | `empty` | `empty` |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
| Bitbucket Cloud pull request from branch | :ref:`vcs-bitbucket-cloud` | SSH URL [#empty]_ | Branch name |
+---------------------------------------------+-------------------------------+-------------------------------+-------------------------------+
Gitea, Pagure, Azure DevOps, Bitbucket Data Center and Bitbucket Cloud:

.. list-table::
:header-rows: 1

* - Desired setup
- :ref:`component-vcs`
- :ref:`component-push`
- :ref:`component-push_branch`

* - No push
- :ref:`vcs-git`
- `empty`
- `empty`

* - Push directly
- :ref:`vcs-git`
- SSH URL
- `empty`

* - Push to separate branch
- :ref:`vcs-git`
- SSH URL
- Branch name

* - No push
- :ref:`vcs-mercurial`
- `empty`
- `empty`

* - Push directly
- :ref:`vcs-mercurial`
- SSH URL
- `empty`

* - Push to separate branch
- :ref:`vcs-mercurial`
- SSH URL
- Branch name

* - GitHub pull request from fork
- :ref:`vcs-github`
- `empty`
- `empty`

* - GitHub pull request from branch
- :ref:`vcs-github`
- SSH URL [#empty]_
- Branch name

* - GitLab merge request from fork
- :ref:`vcs-gitlab`
- `empty`
- `empty`

* - GitLab merge request from branch
- :ref:`vcs-gitlab`
- SSH URL [#empty]_
- Branch name

* - Gitea merge request from fork
- :ref:`vcs-gitea`
- `empty`
- `empty`

* - Gitea merge request from branch
- :ref:`vcs-gitea`
- SSH URL [#empty]_
- Branch name

* - Pagure merge request from fork
- :ref:`vcs-pagure`
- `empty`
- `empty`

* - Pagure merge request from branch
- :ref:`vcs-pagure`
- SSH URL [#empty]_
- Branch name

* - Azure DevOps pull request from fork
- :ref:`vcs-azure-devops`
- `empty`
- `empty`

* - Azure DevOps pull request from branch
- :ref:`vcs-azure-devops`
- SSH URL [#empty]_
- Branch name

* - Bitbucket Data Center pull request from fork
- :ref:`vcs-bitbucket-server`
- `empty`
- `empty`

* - Bitbucket Data Center pull request from branch
- :ref:`vcs-bitbucket-server`
- SSH URL [#empty]_
- Branch name

* - Bitbucket Cloud pull request from fork
- :ref:`vcs-bitbucket-cloud`
- `empty`
- `empty`

* - Bitbucket Cloud pull request from branch
- :ref:`vcs-bitbucket-cloud`
- SSH URL [#empty]_
- Branch name

.. [#empty] Can be empty in case :ref:`component-repo` supports pushing.

Expand Down
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Not yet released.

**Improvements**

* Renamed :ref:`vcs-bitbucket-server` to match new product name.

**Bug fixes**

**Compatibility**
Expand Down
12 changes: 6 additions & 6 deletions docs/vcs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ Weblate settings to make this work. Once configured, you will see a
.. _vcs-bitbucket-server:
.. _bitbucket-server-push:

Bitbucket Server pull requests
------------------------------
Bitbucket Data Center pull requests
-----------------------------------

.. versionadded:: 4.16

This just adds a thin layer atop :ref:`vcs-git` using the
`Bitbucket Server API`_ to allow pushing translation changes as pull requests
`Bitbucket Data Center API`_ to allow pushing translation changes as pull requests
instead of pushing directly to the repository.

.. warning::
Expand All @@ -431,14 +431,14 @@ while :ref:`vcs-bitbucket-server` creates pull request.

You need to configure API credentials (:setting:`BITBUCKETSERVER_CREDENTIALS`) in the
Weblate settings to make this work. Once configured, you will see a
:guilabel:`Bitbucket Server` option when selecting :ref:`component-vcs`.
:guilabel:`Bitbucket Data Center` option when selecting :ref:`component-vcs`.

.. seealso::

:ref:`push-changes`,
:setting:`BITBUCKETSERVER_CREDENTIALS`

.. _Bitbucket Server API: https://developer.atlassian.com/server/bitbucket/
.. _Bitbucket Data Center API: https://developer.atlassian.com/server/bitbucket/

.. _vcs-bitbucket-cloud:
.. _bitbucket-cloud-push:
Expand All @@ -454,7 +454,7 @@ instead of pushing directly to the repository.

.. warning::

This is different from Bitbucket Server API.
This is different from Bitbucket Data Center API.


There is no need to use this to access Git repositories, ordinary :ref:`vcs-git`
Expand Down
8 changes: 4 additions & 4 deletions weblate/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@
self, repo: str | None = None
) -> tuple[str | None, str | None, str | None, str, str, str]:
if repo is None:
repo = self.component.push or self.component.repo

Check failure on line 817 in weblate/vcs/git.py

View workflow job for this annotation

GitHub Actions / mypy

Item "None" of "Component | None" has no attribute "push"

Check failure on line 817 in weblate/vcs/git.py

View workflow job for this annotation

GitHub Actions / mypy

Item "None" of "Component | None" has no attribute "repo"
parsed = urllib.parse.urlparse(repo)
host = parsed.hostname
scheme: str | None = parsed.scheme
Expand Down Expand Up @@ -1056,7 +1056,7 @@

def get_merge_message(self):
lines = render_template(
self.component.pull_message.strip(), component=self.component

Check failure on line 1059 in weblate/vcs/git.py

View workflow job for this annotation

GitHub Actions / mypy

Item "None" of "Component | None" has no attribute "pull_message"
).splitlines()
return lines[0], "\n".join(lines[1:]).strip()

Expand Down Expand Up @@ -1270,7 +1270,7 @@
self, repo: str | None = None
) -> tuple[str | None, str | None, str | None, str, str, str]:
if repo is None:
repo = self.component.repo

Check failure on line 1273 in weblate/vcs/git.py

View workflow job for this annotation

GitHub Actions / mypy

Item "None" of "Component | None" has no attribute "repo"

scheme_regex = r"^[a-z]+:\/\/.*" # matches for example ssh://* and https://*

Expand Down Expand Up @@ -2045,14 +2045,14 @@


class BitbucketServerRepository(GitMergeRequestBase):
# Translators: Bitbucket Server is a product name, it differs from Bitbucked Cloud
name = gettext_lazy("Bitbucket Server pull request")
# Translators: Bitbucket Data Center is a product name, it differs from Bitbucked Cloud
name = gettext_lazy("Bitbucket Data Center pull request")
identifier = "bitbucketserver"
_version = None
API_TEMPLATE = "{scheme}://{host}/rest/api/1.0/projects/{owner}/repos/{slug}"
bb_fork: dict = {}
push_label = gettext_lazy(
"This will push changes and create a Bitbucket Server pull request."
"This will push changes and create a Bitbucket Data Center pull request."
)

def get_headers(self, credentials: GitCredentials) -> dict[str, str]:
Expand Down Expand Up @@ -2174,7 +2174,7 @@
)

"""
Bitbucket Server will return an error if a PR already exists.
Bitbucket Data Center will return an error if a PR already exists.
The push method in the parent class pushes changes to the correct
fork or branch, and always calls this create_pull_request method after.
If the PR exists already just do nothing because Bitbucket will
Expand Down
Loading