chore: make the changes backwards compatible to ease the migration

Signed-off-by: djamaile <rdjamaile@gmail.com>
This commit is contained in:
djamaile
2022-06-09 11:50:48 +02:00
parent 7f78d71537
commit 34b84b4072
2 changed files with 17 additions and 3 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
---
'@backstage/plugin-scaffolder-backend': minor
'@backstage/plugin-scaffolder-backend': major
---
refactored the gitlab publish merge request action to not use the `projectId` property. Instead use the `host` and `owner` property from the `RepoUrlPicker`. This decreases the amount of fields the user has to fill in.
**DEPRECATION**: The `projectid` input parameters to the `publish:gitlab:merge-request`, it's no longer required as it can be decoded from the `repoUrl` input parameter.
**DEPRECATION**: The `projectid` output of the action in favour of `projectPath`
@@ -40,6 +40,8 @@ export const createPublishGitlabMergeRequestAction = (options: {
branchName: string;
targetPath: string;
token?: string;
/** @deprecated */
projectid?: string;
}>({
id: 'publish:gitlab:merge-request',
schema: {
@@ -52,6 +54,12 @@ export const createPublishGitlabMergeRequestAction = (options: {
title: 'Repository Location',
description: `Accepts the format 'gitlab.com/group_name/project_name' where 'project_name' is the repository name and 'group_name' is a group or username`,
},
/** @deprecated */
projectid: {
type: 'string',
title: 'projectid',
description: 'Project ID/Name(slug) of the Gitlab Project',
},
title: {
type: 'string',
title: 'Merge Request Name',
@@ -82,6 +90,10 @@ export const createPublishGitlabMergeRequestAction = (options: {
output: {
type: 'object',
properties: {
projectid: {
title: 'Gitlab Project id/Name(slug)',
type: 'string',
},
projectPath: {
title: 'Gitlab Project path',
type: 'string',
@@ -173,7 +185,8 @@ export const createPublishGitlabMergeRequestAction = (options: {
).then((mergeRequest: { web_url: string }) => {
return mergeRequest.web_url;
});
ctx.output('project path: ', projectPath);
ctx.output('projectid', projectPath);
ctx.output('projectPath', projectPath);
ctx.output('mergeRequestUrl', mergeRequestUrl);
} catch (e) {
throw new InputError(`Merge request creation failed${e}`);