[WIP] RHTAP-6071 Replace BitBucket AppPassword with API token#325
[WIP] RHTAP-6071 Replace BitBucket AppPassword with API token#325jkopriva wants to merge 1 commit intoredhat-appstudio:mainfrom
Conversation
Assisted-by: Cursor
📝 WalkthroughWalkthroughThis PR migrates Bitbucket authentication from a dual-path system (bearer accessToken or basic auth with appPassword) to a unified token-based authentication approach. Changes consolidate credential handling across the API client layer, HTTP client implementation, type definitions, and Git provider integrations. Changes
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Suggested Labels
Suggested Reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/rhtap/postcreation/strategies/commands/addJenkinsSecretsCommand.ts (1)
137-139: Token retrieval change is consistent with the Azure secrets command.The update from
getAppPassword()togetToken()maintains consistency with the unified token-based authentication approach across the codebase.Note: The
getGitOpsAuthPassword()method (lines 129-143) is nearly identical to the one inaddAzureSecrets.ts(lines 101-115). Consider extracting this to a shared utility in a future refactor to reduce duplication.,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/rhtap/postcreation/strategies/commands/addJenkinsSecretsCommand.ts` around lines 137 - 139, Replace Bitbucket's getAppPassword usage with the unified getToken call inside getGitOpsAuthPassword() so the GitType.BITBUCKET branch calls BitbucketProvider.getToken(); ensure the BitbucketProvider implementation exposes getToken() and returns the same token shape expected by callers. Also factor out the nearly identical getGitOpsAuthPassword() logic (present in addJenkinsSecretsCommand.ts and addAzureSecrets.ts) into a shared utility function (e.g., gitOpsAuth.getTokenForProvider) to remove duplication and have both files call that shared helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/rhtap/postcreation/strategies/commands/addJenkinsSecretsCommand.ts`:
- Around line 137-139: Replace Bitbucket's getAppPassword usage with the unified
getToken call inside getGitOpsAuthPassword() so the GitType.BITBUCKET branch
calls BitbucketProvider.getToken(); ensure the BitbucketProvider implementation
exposes getToken() and returns the same token shape expected by callers. Also
factor out the nearly identical getGitOpsAuthPassword() logic (present in
addJenkinsSecretsCommand.ts and addAzureSecrets.ts) into a shared utility
function (e.g., gitOpsAuth.getTokenForProvider) to remove duplication and have
both files call that shared helper.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f1fc5aec-4cf4-424c-85fc-0d507b81e02b
⛔ Files ignored due to path filters (1)
README.mdis excluded by none and included by none
📒 Files selected for processing (6)
src/api/bitbucket/bitbucket.client.tssrc/api/bitbucket/http/bitbucket-http.client.tssrc/api/bitbucket/types/bitbucket.types.tssrc/rhtap/core/integration/git/providers/bitbucket.tssrc/rhtap/postcreation/strategies/commands/addAzureSecrets.tssrc/rhtap/postcreation/strategies/commands/addJenkinsSecretsCommand.ts
|
This is blocked until we migrate to RHDH 1.10 |
|
@jkopriva: The following test has Failed, say /retest to rerun failed tests.
Inspecting Test ArtifactsTo inspect your test artifacts, follow these steps:
mkdir -p oras-artifacts
cd oras-artifacts
oras pull quay.io/konflux-test-storage/rhtap-team/rhtap-cli:e2e-4.20-8kjxzTest results analysis<not enabled> OCI Artifact Browser URL<not enabled> |
Assisted-by: Cursor
Summary by CodeRabbit
Breaking Changes
Documentation