From bef5795428c8aa6477d67e01f0f84f5a02f737c1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 10 Jun 2026 11:35:32 +0200 Subject: bitbucket: rename "username" to "email" It's Atlassian emails instead of usernames now. --- .github/workflows/ci.yml | 4 ++-- DEVELOPMENT.md | 6 +++--- cgitize/config.py | 2 +- examples/cgitize.toml | 7 ++++--- test/set_credentials.sh | 4 +++- test/unit/test_bitbucket.py | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c7afd1..e90be44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: env: CGITIZE_GITHUB_USERNAME: '${{ secrets.CGITIZE_GITHUB_USERNAME }}' CGITIZE_GITHUB_TOKEN: '${{ secrets.CGITIZE_GITHUB_TOKEN }}' - CGITIZE_BITBUCKET_USERNAME: '${{ secrets.CGITIZE_BITBUCKET_USERNAME }}' + CGITIZE_BITBUCKET_EMAIL: '${{ secrets.CGITIZE_BITBUCKET_EMAIL }}' CGITIZE_BITBUCKET_TOKEN: '${{ secrets.CGITIZE_BITBUCKET_TOKEN }}' CGITIZE_GITLAB_USERNAME: '${{ secrets.CGITIZE_GITLAB_USERNAME }}' CGITIZE_GITLAB_TOKEN: '${{ secrets.CGITIZE_GITLAB_TOKEN }}' @@ -66,7 +66,7 @@ jobs: env: CGITIZE_GITHUB_USERNAME: '${{ secrets.CGITIZE_GITHUB_USERNAME }}' CGITIZE_GITHUB_TOKEN: '${{ secrets.CGITIZE_GITHUB_TOKEN }}' - CGITIZE_BITBUCKET_USERNAME: '${{ secrets.CGITIZE_BITBUCKET_USERNAME }}' + CGITIZE_BITBUCKET_EMAIL: '${{ secrets.CGITIZE_BITBUCKET_EMAIL }}' CGITIZE_BITBUCKET_TOKEN: '${{ secrets.CGITIZE_BITBUCKET_TOKEN }}' CGITIZE_GITLAB_USERNAME: '${{ secrets.CGITIZE_GITLAB_USERNAME }}' CGITIZE_GITLAB_TOKEN: '${{ secrets.CGITIZE_GITLAB_TOKEN }}' diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3fd937b..aa91655 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -18,11 +18,11 @@ test. You need to set the following environment variables for the authenticated access tests to work: -* `CGITIZE_BITBUCKET_USERNAME`: `cgitize-test` +* `CGITIZE_BITBUCKET_EMAIL` * `CGITIZE_BITBUCKET_TOKEN` -* `CGITIZE_GITHUB_USERNAME`: `cgitize-test` +* `CGITIZE_GITHUB_USERNAME` * `CGITIZE_GITHUB_TOKEN` -* `CGITIZE_GITLAB_USERNAME`: `cgitize-test` +* `CGITIZE_GITLAB_USERNAME` * `CGITIZE_GITLAB_TOKEN` You can run `. test/set_credentials.sh`; it'll ask you to fill in the secrets. diff --git a/cgitize/config.py b/cgitize/config.py index 6d304ac..f240570 100644 --- a/cgitize/config.py +++ b/cgitize/config.py @@ -143,7 +143,7 @@ class BitbucketSection(ServiceSection): @property def username(self): - return self._get_config_or_env('username', 'CGITIZE_BITBUCKET_USERNAME') + return self._get_config_or_env('username', 'CGITIZE_BITBUCKET_EMAIL') @property def url_auth(self): diff --git a/examples/cgitize.toml b/examples/cgitize.toml index 72bb135..6fc7f9e 100644 --- a/examples/cgitize.toml +++ b/examples/cgitize.toml @@ -59,11 +59,12 @@ dir = "python" # Bitbucket settings are similar to those for GitHub. [bitbucket] -# Access tokens are called "app passwords" on Bitbucket. +# Atlassian API token. # The environment variable is CGITIZE_BITBUCKET_TOKEN. #token = "XXX" -# The environment variable is CGITIZE_BITBUCKET_USERNAME. -#username = "your-username" +# Atlassian account email address. +# The environment variable is CGITIZE_BITBUCKET_EMAIL. +#email = "your-email" [bitbucket.users.me] name = "cgitize-test-workspace" diff --git a/test/set_credentials.sh b/test/set_credentials.sh index 1d8fd87..ec6e45a 100644 --- a/test/set_credentials.sh +++ b/test/set_credentials.sh @@ -1,3 +1,5 @@ +IFS= read -r -s -p 'Bitbucket email: ' CGITIZE_BITBUCKET_EMAIL +echo IFS= read -r -s -p 'Bitbucket token: ' CGITIZE_BITBUCKET_TOKEN echo IFS= read -r -s -p 'GitHub token: ' CGITIZE_GITHUB_TOKEN @@ -5,7 +7,7 @@ echo IFS= read -r -s -p 'GitLab token: ' CGITIZE_GITLAB_TOKEN echo -export CGITIZE_BITBUCKET_USERNAME=cgitize-test +export CGITIZE_BITBUCKET_EMAIL export CGITIZE_BITBUCKET_TOKEN export CGITIZE_GITHUB_USERNAME=cgitize-test export CGITIZE_GITHUB_TOKEN diff --git a/test/unit/test_bitbucket.py b/test/unit/test_bitbucket.py index 26e86bf..e81cdef 100644 --- a/test/unit/test_bitbucket.py +++ b/test/unit/test_bitbucket.py @@ -13,7 +13,7 @@ from requests.exceptions import HTTPError class BitbucketTests(unittest.TestCase): def setUp(self): self.bitbucket = Cloud( - username=os.environ.get('CGITIZE_BITBUCKET_USERNAME'), + username=os.environ.get('CGITIZE_BITBUCKET_EMAIL'), password=os.environ.get('CGITIZE_BITBUCKET_TOKEN'), cloud=True, ) -- cgit v1.3