feature: add support for deployment environment scope for bitbucket and refactor bitbucket create UI

This commit is contained in:
Scott Wilson
2024-11-08 19:31:18 -08:00
parent 65d642113d
commit d4c911a28f
14 changed files with 525 additions and 186 deletions

View File

@@ -3631,7 +3631,16 @@ const syncSecretsBitBucket = async ({
const res: { [key: string]: BitbucketVariable } = {};
let hasNextPage = true;
let variablesUrl = `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/pipelines_config/variables`;
let variablesUrl: string;
if (integration.targetServiceId) {
// scope: deployment environment
variablesUrl = `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/deployments_config/environments/${integration.targetServiceId}/variables`;
} else {
// scope: repository
variablesUrl = `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/pipelines_config/variables`;
}
while (hasNextPage) {
const { data }: { data: VariablesResponse } = await request.get(variablesUrl, {