feat(bitbucket): add gitUser field to support API token auth on Bitbucket Cloud#918
Merged
brendan-kellam merged 4 commits intomainfrom Feb 21, 2026
Merged
Conversation
…cket Cloud BitBucket Cloud API tokens require different usernames for the REST API (email address) and git clone (Atlassian username). Add an optional `gitUser` field to the BitBucket connection config that, when set, is used for git clone credentials instead of `user`. Fixes #892 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Caution Review failedThe pull request is closed. WalkthroughAdds an optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/snippets/schemas/v3/connection.schema.mdx`:
- Around line 693-696: The gitUser schema description is missing a trailing
period, causing punctuation inconsistency with the user description; update the
"gitUser" property's description in the generated schema (look for the "gitUser"
property in the v3 Bitbucket schema generation, e.g., in the generator output
for bitbucket.json) to end with a period ("...this is your Bitbucket username.")
or, if you prefer consistent styling, update the generator/template that
produces descriptions for properties like "gitUser" and "user" so all
descriptions in the schemas/v3/bitbucket.json output follow the same punctuation
convention.
In `@docs/snippets/schemas/v3/index.schema.mdx`:
- Around line 1104-1111: Update the description for the gitUser schema property
so it documents the full fallback chain: state that gitUser is the username for
git clone over HTTPS, and if unset it falls back to 'user', and if both gitUser
and user are unset it then falls back to 'x-token-auth'; reference the existing
properties by name (gitUser, user, x-token-auth) so readers can find the related
fields.
In `@packages/schemas/src/v3/bitbucket.type.ts`:
- Around line 12-15: The JSDoc for the Bitbucket property gitUser is missing a
trailing period; update the source description for the gitUser property (the
jsdoc/comment that generates gitUser) to end with a period ("...this is your
Bitbucket username."), then re-run the generation pipeline so the change
propagates to the generated artifacts (index.type.ts, connection.type.ts,
bitbucket.schema.ts, connection.schema.ts) and any other auto-generated copies;
ensure the updated comment is present in the original schema/type source that
drives generation.
In `@packages/schemas/src/v3/index.schema.ts`:
- Around line 1103-1110: The gitUser description currently only mentions falling
back to user but the implementation falls back gitUser → user → x-token-auth;
update the gitUser property description to document the full fallback chain
(e.g., "If not set, falls back to 'user', then to 'x-token-auth'") and make the
same textual change to the other generated schema files containing gitUser
(bitbucket.schema.ts and connection.schema.ts) so all schemas consistently
reflect the actual behavior.
---
Duplicate comments:
In `@docs/snippets/schemas/v3/bitbucket.schema.mdx`:
- Around line 12-19: The documentation snippet for the Bitbucket credentials
wrongly states the fallback for git clone auth; update the descriptions for
"user" and "gitUser" in bitbucket.schema.mdx to reflect the x-token-auth
fallback chain (gitUser falls back to x-token-auth then to user as defined in
the source schema), correct the text mentioning API token/email vs username
accordingly, and after fixing the source schema ensure you regenerate this
snippet so the docs mirror the schema's x-token-auth fallback behavior.
In `@packages/schemas/src/v3/connection.type.ts`:
- Around line 263-266: The JSDoc for the optional field gitUser in the
Connection type is missing a trailing period; update the comment above the
gitUser property (symbol: gitUser) to end the sentence with a period (making it
consistent with the similar comment in bitbucket.type.ts) so the documentation
punctuation is consistent.
In `@packages/schemas/src/v3/index.type.ts`:
- Around line 461-464: The JSDoc for the optional property gitUser is missing a
trailing period across generated copies; update the doc comment for gitUser
(symbol: gitUser) to end with a period in this file and correct the generator
source/template that produces bitbucket.type.ts and other duplicates so future
regenerations include the trailing period; specifically, change the comment text
"For API tokens, this is your Bitbucket username" to "For API tokens, this is
your Bitbucket username." in the generator and in the immediate occurrence here.
In `@schemas/v3/bitbucket.json`:
- Around line 10-17: The field descriptions for "user" and "gitUser" in
schemas/v3/bitbucket.json are missing the x-token-auth fallback; update the
"description" strings for both properties ("user" and "gitUser") to mention the
x-token-auth fallback behavior (i.e., that authentication may fall back to
x-token-auth where applicable) and then regenerate the schema output to keep it
in sync with the updated source schema.
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
gitUserfield to the Bitbucket connection config, used for git clone authentication over HTTPSuserhandles the API andgitUserhandles git clonegitUserbehave identically (falls back touser, thenx-token-auth)Fixes #892
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation