From 55a834f3ccb5b154dfdebe129b2cf9100fcce2fa Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Tue, 15 Jun 2021 14:29:01 +0200 Subject: [PATCH] Use the correct parameter to create a public repository in Bitbucket Server for the v2 templates Signed-off-by: Dominik Henneke --- .changeset/healthy-windows-dance.md | 5 +++++ .../scaffolder/actions/builtin/publish/bitbucket.test.ts | 2 +- .../src/scaffolder/actions/builtin/publish/bitbucket.ts | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/healthy-windows-dance.md diff --git a/.changeset/healthy-windows-dance.md b/.changeset/healthy-windows-dance.md new file mode 100644 index 0000000000..1015fb63c3 --- /dev/null +++ b/.changeset/healthy-windows-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Use the correct parameter to create a public repository in Bitbucket Server for the v2 templates diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts index d5330fb61c..4a7cb13525 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts @@ -140,7 +140,7 @@ describe('publish:bitbucket', () => { 'https://hosted.bitbucket.com/rest/api/1.0/projects/owner/repos', (req, res, ctx) => { expect(req.headers.get('Authorization')).toBe('Bearer thing'); - expect(req.body).toEqual({ is_private: true, name: 'repo' }); + expect(req.body).toEqual({ public: false, name: 'repo' }); return res( ctx.status(201), ctx.set('Content-Type', 'application/json'), diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts index 5977515c25..b1b4f96807 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts @@ -19,10 +19,10 @@ import { BitbucketIntegrationConfig, ScmIntegrationRegistry, } from '@backstage/integration'; -import { initRepoAndPush } from '../../../stages/publish/helpers'; -import { getRepoSourceDirectory, parseRepoUrl } from './util'; import fetch from 'cross-fetch'; +import { initRepoAndPush } from '../../../stages/publish/helpers'; import { createTemplateAction } from '../../createTemplateAction'; +import { getRepoSourceDirectory, parseRepoUrl } from './util'; const createBitbucketCloudRepository = async (opts: { owner: string; @@ -102,7 +102,7 @@ const createBitbucketServerRepository = async (opts: { body: JSON.stringify({ name: repo, description: description, - is_private: repoVisibility === 'private', + public: repoVisibility === 'public', }), headers: { Authorization: authorization,