Merge pull request #6045 from SDA-SE/feat/bitbucket-publish-2

Use the correct parameter to create a public repository in Bitbucket Server for the v2 templates
This commit is contained in:
Fredrik Adelöw
2021-06-15 14:58:34 +02:00
committed by GitHub
3 changed files with 9 additions and 4 deletions
+5
View File
@@ -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
@@ -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'),
@@ -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,