@@ -3,15 +3,30 @@
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
/// <reference types="node" />
|
||||
|
||||
import { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { TaskSecrets } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateInfo } from '@backstage/plugin-scaffolder-common';
|
||||
import * as winston from 'winston';
|
||||
import { Writable } from 'stream';
|
||||
|
||||
// @public
|
||||
export const createMockActionContext: <
|
||||
TActionInput extends JsonObject = JsonObject,
|
||||
TActionOutput extends JsonObject = JsonObject,
|
||||
>(
|
||||
input?: TActionInput | undefined,
|
||||
options?:
|
||||
| {
|
||||
input?: TActionInput | undefined;
|
||||
logger?: winston.Logger | undefined;
|
||||
logStream?: Writable | undefined;
|
||||
secrets?: TaskSecrets | undefined;
|
||||
templateInfo?: TemplateInfo | undefined;
|
||||
workspacePath?: string | undefined;
|
||||
}
|
||||
| undefined,
|
||||
) => ActionContext<TActionInput, TActionOutput>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
@@ -14,30 +14,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import { PassThrough, Writable } from 'stream';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
import { ActionContext, TaskSecrets } from '@backstage/plugin-scaffolder-node';
|
||||
import * as winston from 'winston';
|
||||
import { TemplateInfo } from '@backstage/plugin-scaffolder-common';
|
||||
|
||||
/**
|
||||
* A utility method to create a mock action context for scaffolder actions.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @public
|
||||
* @param options
|
||||
* @param options - optional parameters to override default mock context
|
||||
*/
|
||||
export const createMockActionContext = <
|
||||
TActionInput extends JsonObject = JsonObject,
|
||||
TActionOutput extends JsonObject = JsonObject,
|
||||
>(options?: {
|
||||
input?: TActionInput;
|
||||
workspacePath?: string;
|
||||
logger?: winston.Logger;
|
||||
logStream?: Writable;
|
||||
secrets?: TaskSecrets;
|
||||
templateInfo?: TemplateInfo;
|
||||
workspacePath?: string;
|
||||
}): ActionContext<TActionInput, TActionOutput> => {
|
||||
const defaultContext = {
|
||||
logger: getVoidLogger(),
|
||||
@@ -58,12 +58,19 @@ export const createMockActionContext = <
|
||||
};
|
||||
}
|
||||
|
||||
const { input, workspacePath, logger, templateInfo } = options;
|
||||
const { input, logger, logStream, secrets, templateInfo, workspacePath } =
|
||||
options;
|
||||
|
||||
return {
|
||||
...defaultContext,
|
||||
...(workspacePath ? { workspacePath } : createDefaultWorkspace()),
|
||||
...(workspacePath && {
|
||||
createTemporaryDirectory: jest.fn().mockResolvedValue(workspacePath),
|
||||
}),
|
||||
...(logger && { logger }),
|
||||
...(logStream && { logStream }),
|
||||
...(input && { input }),
|
||||
...(secrets && { secrets }),
|
||||
templateInfo,
|
||||
};
|
||||
};
|
||||
|
||||
+4
-2
@@ -60,8 +60,10 @@ describe('publish:bitbucketServer', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const action = createPublishBitbucketServerAction({ integrations, config });
|
||||
const mockContext = createMockActionContext({
|
||||
repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',
|
||||
repoVisibility: 'private' as const,
|
||||
input: {
|
||||
repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',
|
||||
repoVisibility: 'private' as const,
|
||||
},
|
||||
});
|
||||
const server = setupServer();
|
||||
setupRequestMockHandlers(server);
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
"@backstage/backend-test-utils": "workspace:^",
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/core-app-api": "workspace:^",
|
||||
"@backstage/scaffolder-test-utils": "workspace:^",
|
||||
"jest-date-mock": "^1.0.8"
|
||||
},
|
||||
"files": [
|
||||
|
||||
+2
-9
@@ -14,9 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import { createGitlabGroupEnsureExistsAction } from './createGitlabGroupEnsureExistsAction';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { ConfigReader } from '@backstage/core-app-api';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
|
||||
@@ -35,13 +34,7 @@ jest.mock('@gitbeaker/node', () => ({
|
||||
}));
|
||||
|
||||
describe('gitlab:group:ensureExists', () => {
|
||||
const mockContext = {
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
+7
-20
@@ -14,8 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { createGitlabIssueAction, IssueType } from './createGitlabIssueAction';
|
||||
import { ConfigReader } from '@backstage/core-app-api';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
@@ -60,18 +59,14 @@ describe('gitlab:issues:create', () => {
|
||||
const action = createGitlabIssueAction({ integrations });
|
||||
|
||||
it('should return a Gitlab issue when called with minimal input params', async () => {
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
projectId: 123,
|
||||
title: 'Computer banks to rule the world',
|
||||
},
|
||||
workspacePath: 'seen2much',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
mockGitlabClient.Issues.create.mockResolvedValue({
|
||||
id: 42,
|
||||
@@ -109,7 +104,7 @@ describe('gitlab:issues:create', () => {
|
||||
});
|
||||
|
||||
it('should return a Gitlab issue when called with oAuth Token', async () => {
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
projectId: 123,
|
||||
@@ -117,11 +112,7 @@ describe('gitlab:issues:create', () => {
|
||||
token: 'myAwesomeToken',
|
||||
},
|
||||
workspacePath: 'seen2much',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
mockGitlabClient.Issues.create.mockResolvedValue({
|
||||
id: 42,
|
||||
@@ -159,7 +150,7 @@ describe('gitlab:issues:create', () => {
|
||||
});
|
||||
|
||||
it('should return a Gitlab issue when called with several input params', async () => {
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
projectId: 123,
|
||||
@@ -173,11 +164,7 @@ describe('gitlab:issues:create', () => {
|
||||
labels: 'operation:mindcrime',
|
||||
},
|
||||
workspacePath: 'seen2much',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
mockGitlabClient.Issues.create.mockResolvedValue({
|
||||
id: 42,
|
||||
|
||||
+3
-9
@@ -13,13 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { PassThrough } from 'stream';
|
||||
import yaml from 'yaml';
|
||||
import { createGitlabProjectAccessTokenAction } from './createGitlabProjectAccessTokenAction'; // Adjust the import based on your project structure
|
||||
import { examples } from './createGitlabProjectAccessTokenAction.examples';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
@@ -59,16 +58,11 @@ describe('gitlab:projectAccessToken:create examples', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const action = createGitlabProjectAccessTokenAction({ integrations });
|
||||
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
+3
-9
@@ -15,10 +15,9 @@
|
||||
*/
|
||||
|
||||
import { createGitlabProjectDeployTokenAction } from './createGitlabProjectDeployTokenAction';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
|
||||
const mockGitlabClient = {
|
||||
ProjectDeployTokens: {
|
||||
@@ -52,7 +51,7 @@ describe('gitlab:create-deploy-token', () => {
|
||||
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const action = createGitlabProjectDeployTokenAction({ integrations });
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
projectId: '123',
|
||||
@@ -60,12 +59,7 @@ describe('gitlab:create-deploy-token', () => {
|
||||
username: 'tokenuser',
|
||||
scopes: ['read_repository'],
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import yaml from 'yaml';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => {
|
||||
return {
|
||||
@@ -31,8 +32,6 @@ import { createPublishGitlabAction } from './gitlab';
|
||||
import { initRepoAndPush } from '@backstage/plugin-scaffolder-node';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
import { examples } from './gitlab.examples';
|
||||
|
||||
const mockGitlabClient = {
|
||||
@@ -76,16 +75,11 @@ describe('publish:gitlab', () => {
|
||||
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const action = createPublishGitlabAction({ integrations, config });
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
@@ -29,9 +29,8 @@ jest.mock('@backstage/plugin-scaffolder-node', () => {
|
||||
import { createPublishGitlabAction } from './gitlab';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
import { initRepoAndPush } from '@backstage/plugin-scaffolder-node';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
const mockGitlabClient = {
|
||||
Namespaces: {
|
||||
@@ -83,7 +82,8 @@ describe('publish:gitlab', () => {
|
||||
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const action = createPublishGitlabAction({ integrations, config });
|
||||
const mockContext = {
|
||||
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
repoVisibility: 'private' as const,
|
||||
@@ -91,13 +91,8 @@ describe('publish:gitlab', () => {
|
||||
ci_config_path: '.gitlab-ci.yml',
|
||||
},
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContextWithSettings = {
|
||||
});
|
||||
const mockContextWithSettings = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
repoVisibility: 'private' as const,
|
||||
@@ -108,13 +103,8 @@ describe('publish:gitlab', () => {
|
||||
topics: ['topic1', 'topic2'],
|
||||
},
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContextWithBranches = {
|
||||
});
|
||||
const mockContextWithBranches = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
repoVisibility: 'private' as const,
|
||||
@@ -135,13 +125,8 @@ describe('publish:gitlab', () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContextWithVariables = {
|
||||
});
|
||||
const mockContextWithVariables = createMockActionContext({
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
repoVisibility: 'private' as const,
|
||||
@@ -155,12 +140,7 @@ describe('publish:gitlab', () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
workspacePath: 'lol',
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { createRootLogger, getRootLogger } from '@backstage/backend-common';
|
||||
import { createRootLogger } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import { Writable } from 'stream';
|
||||
import { createPublishGitlabMergeRequestAction } from './gitlabMergeRequest';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
// Make sure root logger is initialized ahead of FS mock
|
||||
createRootLogger();
|
||||
@@ -118,14 +118,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
irrelevant: { 'bar.txt': 'Nothing to see here' },
|
||||
},
|
||||
});
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Projects.show).not.toHaveBeenCalled();
|
||||
@@ -160,14 +153,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
irrelevant: { 'bar.txt': 'Nothing to see here' },
|
||||
},
|
||||
});
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Projects.show).toHaveBeenCalledWith('owner/repo');
|
||||
@@ -205,14 +191,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith(
|
||||
@@ -240,14 +219,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith(
|
||||
@@ -281,14 +253,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith(
|
||||
@@ -321,14 +286,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith(
|
||||
@@ -361,14 +319,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith(
|
||||
@@ -400,14 +351,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith(
|
||||
@@ -435,14 +379,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
irrelevant: { 'bar.txt': 'Nothing to see here' },
|
||||
},
|
||||
});
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith(
|
||||
@@ -484,14 +421,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
irrelevant: { 'bar.txt': 'Nothing to see here' },
|
||||
},
|
||||
});
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith(
|
||||
@@ -528,14 +458,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith(
|
||||
@@ -570,14 +493,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith(
|
||||
@@ -612,14 +528,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith(
|
||||
@@ -657,14 +566,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
|
||||
await instance.handler(ctx);
|
||||
|
||||
@@ -702,14 +604,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
|
||||
await instance.handler(ctx);
|
||||
|
||||
@@ -739,14 +634,7 @@ describe('createGitLabMergeRequest', () => {
|
||||
commitAction: 'create',
|
||||
};
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
|
||||
await expect(instance.handler(ctx)).rejects.toThrow(
|
||||
'Relative path is not allowed to refer to a directory outside its parent',
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { createRootLogger, getRootLogger } from '@backstage/backend-common';
|
||||
import { createRootLogger } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import { Writable } from 'stream';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { createGitlabRepoPushAction } from './gitlabRepoPush';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
// Make sure root logger is initialized ahead of FS mock
|
||||
createRootLogger();
|
||||
@@ -93,14 +93,7 @@ describe('createGitLabCommit', () => {
|
||||
'foo.txt': 'Hello there!',
|
||||
},
|
||||
});
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Branches.create).toHaveBeenCalledTimes(0);
|
||||
@@ -139,14 +132,7 @@ describe('createGitLabCommit', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Branches.create).toHaveBeenCalledTimes(0);
|
||||
@@ -183,14 +169,7 @@ describe('createGitLabCommit', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Branches.create).toHaveBeenCalledTimes(0);
|
||||
@@ -227,14 +206,7 @@ describe('createGitLabCommit', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Branches.create).toHaveBeenCalledTimes(0);
|
||||
@@ -276,14 +248,7 @@ describe('createGitLabCommit', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
|
||||
await instance.handler(ctx);
|
||||
|
||||
@@ -325,14 +290,7 @@ describe('createGitLabCommit', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
|
||||
await instance.handler(ctx);
|
||||
|
||||
@@ -366,14 +324,7 @@ describe('createGitLabCommit', () => {
|
||||
commitAction: 'create',
|
||||
};
|
||||
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
|
||||
await expect(instance.handler(ctx)).rejects.toThrow(
|
||||
'Relative path is not allowed to refer to a directory outside its parent',
|
||||
@@ -398,14 +349,7 @@ describe('createGitLabCommit', () => {
|
||||
'foo.txt': 'Hello there!',
|
||||
},
|
||||
});
|
||||
const ctx = {
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
output: jest.fn(),
|
||||
logger: getRootLogger(),
|
||||
logStream: new Writable(),
|
||||
input,
|
||||
workspacePath,
|
||||
};
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith(
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "workspace:^",
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/scaffolder-test-utils": "workspace:^",
|
||||
"@types/command-exists": "^1.2.0",
|
||||
"@types/fs-extra": "^11.0.0",
|
||||
"@types/node": "^18.17.8",
|
||||
|
||||
@@ -27,18 +27,14 @@ jest.mock('./railsNewRunner', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import {
|
||||
ContainerRunner,
|
||||
getVoidLogger,
|
||||
UrlReader,
|
||||
} from '@backstage/backend-common';
|
||||
import { ContainerRunner, UrlReader } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createFetchRailsAction } from './index';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
describe('fetch:rails', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
@@ -53,8 +49,7 @@ describe('fetch:rails', () => {
|
||||
}),
|
||||
);
|
||||
|
||||
const mockTmpDir = mockDir.path;
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
url: 'https://rubyonrails.org/generator',
|
||||
targetPath: 'something',
|
||||
@@ -66,12 +61,8 @@ describe('fetch:rails', () => {
|
||||
baseUrl: 'somebase',
|
||||
entityRef: 'template:default/myTemplate',
|
||||
},
|
||||
workspacePath: mockTmpDir,
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn().mockResolvedValue(mockTmpDir),
|
||||
};
|
||||
workspacePath: mockDir.path,
|
||||
});
|
||||
|
||||
const mockReader: UrlReader = {
|
||||
readUrl: jest.fn(),
|
||||
@@ -102,7 +93,7 @@ describe('fetch:rails', () => {
|
||||
expect(fetchContents).toHaveBeenCalledWith({
|
||||
reader: mockReader,
|
||||
integrations,
|
||||
baseUrl: mockContext.templateInfo.baseUrl,
|
||||
baseUrl: mockContext.templateInfo?.baseUrl,
|
||||
fetchUrl: mockContext.input.url,
|
||||
outputPath: resolvePath(mockContext.workspacePath),
|
||||
});
|
||||
@@ -112,7 +103,7 @@ describe('fetch:rails', () => {
|
||||
await action.handler(mockContext);
|
||||
|
||||
expect(mockRailsTemplater.run).toHaveBeenCalledWith({
|
||||
workspacePath: mockTmpDir,
|
||||
workspacePath: mockContext.workspacePath,
|
||||
logStream: mockContext.logStream,
|
||||
values: mockContext.input.values,
|
||||
});
|
||||
@@ -128,7 +119,7 @@ describe('fetch:rails', () => {
|
||||
});
|
||||
|
||||
expect(mockRailsTemplater.run).toHaveBeenCalledWith({
|
||||
workspacePath: mockTmpDir,
|
||||
workspacePath: mockContext.workspacePath,
|
||||
logStream: mockContext.logStream,
|
||||
values: {
|
||||
...mockContext.input.values,
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "workspace:^",
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/scaffolder-test-utils": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"msw": "^2.0.0"
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { setupRequestMockHandlers } from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { InputError } from '@backstage/errors';
|
||||
import { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
@@ -42,19 +43,17 @@ describe('sentry:project:create action', () => {
|
||||
name: string;
|
||||
slug?: string;
|
||||
authToken?: string;
|
||||
}> => ({
|
||||
workspacePath: './dev/proj',
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
logger: jest.createMockFromModule('winston'),
|
||||
logStream: jest.createMockFromModule('stream'),
|
||||
input: {
|
||||
organizationSlug: 'org',
|
||||
teamSlug: 'team',
|
||||
name: 'test project',
|
||||
authToken: randomBytes(5).toString('hex'),
|
||||
},
|
||||
output: jest.fn(),
|
||||
});
|
||||
}> =>
|
||||
createMockActionContext({
|
||||
workspacePath: './dev/proj',
|
||||
logger: jest.createMockFromModule('winston'),
|
||||
input: {
|
||||
organizationSlug: 'org',
|
||||
teamSlug: 'team',
|
||||
name: 'test project',
|
||||
authToken: randomBytes(5).toString('hex'),
|
||||
},
|
||||
});
|
||||
|
||||
it('should request sentry project create with specified parameters.', async () => {
|
||||
expect.assertions(3);
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"dependencies": {
|
||||
"@backstage/backend-plugin-api": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-node": "workspace:^",
|
||||
"@backstage/scaffolder-test-utils": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"winston": "^3.2.1",
|
||||
"yeoman-environment": "^3.9.1"
|
||||
|
||||
@@ -18,9 +18,8 @@ import { yeomanRun } from './yeomanRun';
|
||||
|
||||
jest.mock('./yeomanRun');
|
||||
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import os from 'os';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createRunYeomanAction } from './yeoman';
|
||||
import type { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
@@ -46,18 +45,14 @@ describe('run:yeoman', () => {
|
||||
const options = {
|
||||
code: 'owner',
|
||||
};
|
||||
mockContext = {
|
||||
mockContext = createMockActionContext({
|
||||
input: {
|
||||
namespace,
|
||||
args,
|
||||
options,
|
||||
},
|
||||
workspacePath: mockTmpDir,
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn().mockResolvedValue(mockTmpDir),
|
||||
};
|
||||
});
|
||||
|
||||
await action.handler(mockContext);
|
||||
expect(yeomanRun).toHaveBeenCalledWith(
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "workspace:^",
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/scaffolder-test-utils": "workspace:^",
|
||||
"@types/fs-extra": "^11.0.0",
|
||||
"@types/nunjucks": "^3.1.4",
|
||||
"@types/supertest": "^2.0.8",
|
||||
|
||||
+3
-10
@@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import os from 'os';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { createFetchCatalogEntityAction } from './fetch';
|
||||
@@ -36,14 +34,9 @@ describe('catalog:fetch examples', () => {
|
||||
catalogClient: catalogClient as unknown as CatalogApi,
|
||||
});
|
||||
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
const mockContext = createMockActionContext({
|
||||
secrets: { backstageToken: 'secret' },
|
||||
};
|
||||
});
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import os from 'os';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { createFetchCatalogEntityAction } from './fetch';
|
||||
@@ -34,14 +32,10 @@ describe('catalog:fetch', () => {
|
||||
catalogClient: catalogClient as unknown as CatalogApi,
|
||||
});
|
||||
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
const mockContext = createMockActionContext({
|
||||
secrets: { backstageToken: 'secret' },
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
+2
-10
@@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import os from 'os';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
@@ -44,13 +42,7 @@ describe('catalog:register', () => {
|
||||
catalogClient: catalogClient as unknown as CatalogApi,
|
||||
});
|
||||
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import os from 'os';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
@@ -42,13 +40,8 @@ describe('catalog:register', () => {
|
||||
catalogClient: catalogClient as unknown as CatalogApi,
|
||||
});
|
||||
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
+3
-11
@@ -20,24 +20,16 @@ jest.mock('fs-extra');
|
||||
|
||||
const fsMock = fs as jest.Mocked<typeof fs>;
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import os from 'os';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { createCatalogWriteAction } from './write';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import * as yaml from 'yaml';
|
||||
import { examples } from './write.examples';
|
||||
import os from 'os';
|
||||
|
||||
describe('catalog:write', () => {
|
||||
const action = createCatalogWriteAction();
|
||||
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext({ workspacePath: os.tmpdir() });
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
@@ -20,9 +20,8 @@ jest.mock('fs-extra');
|
||||
|
||||
const fsMock = fs as jest.Mocked<typeof fs>;
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
import os from 'os';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { ANNOTATION_ORIGIN_LOCATION } from '@backstage/catalog-model';
|
||||
import { createCatalogWriteAction } from './write';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
@@ -31,18 +30,14 @@ import * as yaml from 'yaml';
|
||||
describe('catalog:write', () => {
|
||||
const action = createCatalogWriteAction();
|
||||
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const mockContext = createMockActionContext({
|
||||
workspacePath: os.tmpdir(),
|
||||
});
|
||||
|
||||
it('should write the catalog-info.yml in the workspace', async () => {
|
||||
const entity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
|
||||
+8
-17
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { Writable } from 'stream';
|
||||
import { createDebugLogAction } from './log';
|
||||
import { join } from 'path';
|
||||
@@ -30,15 +30,10 @@ describe('debug:log examples', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = mockDir.resolve('workspace');
|
||||
|
||||
const mockContext = {
|
||||
input: {},
|
||||
baseUrl: 'somebase',
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
const mockContext = createMockActionContext({
|
||||
logStream,
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
workspacePath,
|
||||
});
|
||||
|
||||
const action = createDebugLogAction();
|
||||
|
||||
@@ -51,12 +46,10 @@ describe('debug:log examples', () => {
|
||||
});
|
||||
|
||||
it('should log message', async () => {
|
||||
const context = {
|
||||
await action.handler({
|
||||
...mockContext,
|
||||
input: yaml.parse(examples[0].example).steps[0].input,
|
||||
};
|
||||
|
||||
await action.handler(context);
|
||||
});
|
||||
|
||||
expect(logStream.write).toHaveBeenCalledTimes(1);
|
||||
expect(logStream.write).toHaveBeenCalledWith(
|
||||
@@ -65,12 +58,10 @@ describe('debug:log examples', () => {
|
||||
});
|
||||
|
||||
it('should log the workspace content, if active', async () => {
|
||||
const context = {
|
||||
await action.handler({
|
||||
...mockContext,
|
||||
input: yaml.parse(examples[1].example).steps[0].input,
|
||||
};
|
||||
|
||||
await action.handler(context);
|
||||
});
|
||||
|
||||
expect(logStream.write).toHaveBeenCalledTimes(1);
|
||||
expect(logStream.write).toHaveBeenCalledWith(
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { Writable } from 'stream';
|
||||
import { createDebugLogAction } from './log';
|
||||
import { join } from 'path';
|
||||
@@ -29,15 +29,7 @@ describe('debug:log', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = mockDir.resolve('workspace');
|
||||
|
||||
const mockContext = {
|
||||
input: {},
|
||||
baseUrl: 'somebase',
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
logStream,
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext({ workspacePath, logStream });
|
||||
|
||||
const action = createDebugLogAction();
|
||||
|
||||
|
||||
+3
-13
@@ -14,12 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createWaitAction } from './wait';
|
||||
import { Writable } from 'stream';
|
||||
import { examples } from './wait.examples';
|
||||
import yaml from 'yaml';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
describe('debug:wait examples', () => {
|
||||
const action = createWaitAction();
|
||||
@@ -28,18 +27,9 @@ describe('debug:wait examples', () => {
|
||||
write: jest.fn(),
|
||||
} as jest.Mocked<Partial<Writable>> as jest.Mocked<Writable>;
|
||||
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = mockDir.resolve('workspace');
|
||||
|
||||
const mockContext = {
|
||||
input: {},
|
||||
baseUrl: 'somebase',
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
const mockContext = createMockActionContext({
|
||||
logStream,
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
@@ -14,10 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { createWaitAction } from './wait';
|
||||
import { Writable } from 'stream';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
describe('debug:wait', () => {
|
||||
const action = createWaitAction();
|
||||
@@ -26,18 +25,9 @@ describe('debug:wait', () => {
|
||||
write: jest.fn(),
|
||||
} as jest.Mocked<Partial<Writable>> as jest.Mocked<Writable>;
|
||||
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = mockDir.resolve('workspace');
|
||||
|
||||
const mockContext = {
|
||||
input: {},
|
||||
baseUrl: 'somebase',
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
const mockContext = createMockActionContext({
|
||||
logStream,
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
+9
-14
@@ -16,14 +16,13 @@
|
||||
|
||||
import yaml from 'yaml';
|
||||
|
||||
import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { getVoidLogger, UrlReader } from '@backstage/backend-common';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { createFetchPlainAction } from './plain';
|
||||
import { PassThrough } from 'stream';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { examples } from './plain.examples';
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
@@ -50,19 +49,15 @@ describe('fetch:plain examples', () => {
|
||||
});
|
||||
|
||||
const action = createFetchPlainAction({ integrations, reader });
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
|
||||
it('should fetch plain', async () => {
|
||||
await action.handler({
|
||||
...mockContext,
|
||||
input: yaml.parse(examples[0].example).steps[0].input,
|
||||
});
|
||||
await action.handler(
|
||||
createMockActionContext({
|
||||
...mockContext,
|
||||
input: yaml.parse(examples[0].example).steps[0].input,
|
||||
}),
|
||||
);
|
||||
expect(fetchContents).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
outputPath: resolvePath(mockContext.workspacePath),
|
||||
|
||||
@@ -19,14 +19,13 @@ jest.mock('@backstage/plugin-scaffolder-node', () => {
|
||||
return { ...actual, fetchContents: jest.fn() };
|
||||
});
|
||||
|
||||
import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { getVoidLogger, UrlReader } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { createFetchPlainAction } from './plain';
|
||||
import { PassThrough } from 'stream';
|
||||
|
||||
describe('fetch:plain', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
@@ -47,13 +46,7 @@ describe('fetch:plain', () => {
|
||||
});
|
||||
|
||||
const action = createFetchPlainAction({ integrations, reader });
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
|
||||
it('should disallow a target path outside working directory', async () => {
|
||||
await expect(
|
||||
|
||||
+4
-10
@@ -14,19 +14,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => {
|
||||
const actual = jest.requireActual('@backstage/plugin-scaffolder-node');
|
||||
return { ...actual, fetchFile: jest.fn() };
|
||||
});
|
||||
|
||||
import yaml from 'yaml';
|
||||
import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { getVoidLogger, UrlReader } from '@backstage/backend-common';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { createFetchPlainFileAction } from './plainFile';
|
||||
import { PassThrough } from 'stream';
|
||||
import { fetchFile } from '@backstage/plugin-scaffolder-node';
|
||||
import { examples } from './plainFile.examples';
|
||||
|
||||
@@ -49,13 +49,7 @@ describe('fetch:plain:file examples', () => {
|
||||
});
|
||||
|
||||
const action = createFetchPlainFileAction({ integrations, reader });
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
|
||||
it('should fetch plain', async () => {
|
||||
await action.handler({
|
||||
|
||||
@@ -19,14 +19,13 @@ jest.mock('@backstage/plugin-scaffolder-node', () => {
|
||||
return { ...actual, fetchFile: jest.fn() };
|
||||
});
|
||||
|
||||
import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { getVoidLogger, UrlReader } from '@backstage/backend-common';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { fetchFile } from '@backstage/plugin-scaffolder-node';
|
||||
import { createFetchPlainFileAction } from './plainFile';
|
||||
import { PassThrough } from 'stream';
|
||||
|
||||
describe('fetch:plain:file', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
@@ -47,13 +46,7 @@ describe('fetch:plain:file', () => {
|
||||
});
|
||||
|
||||
const action = createFetchPlainFileAction({ integrations, reader });
|
||||
const mockContext = {
|
||||
workspacePath: os.tmpdir(),
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
const mockContext = createMockActionContext();
|
||||
|
||||
it('should disallow a target path outside working directory', async () => {
|
||||
await expect(
|
||||
|
||||
+11
-23
@@ -16,13 +16,9 @@
|
||||
|
||||
import { join as joinPath, sep as pathSep } from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import {
|
||||
getVoidLogger,
|
||||
resolvePackagePath,
|
||||
UrlReader,
|
||||
} from '@backstage/backend-common';
|
||||
import { resolvePackagePath, UrlReader } from '@backstage/backend-common';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { createFetchTemplateAction } from './template';
|
||||
import {
|
||||
ActionContext,
|
||||
@@ -61,23 +57,15 @@ describe('fetch:template examples', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = mockDir.resolve('workspace');
|
||||
|
||||
const logger = getVoidLogger();
|
||||
|
||||
const mockContext = (input: any) => ({
|
||||
templateInfo: {
|
||||
baseUrl: 'base-url',
|
||||
entityRef: 'template:default/test-template',
|
||||
},
|
||||
input: input,
|
||||
output: jest.fn(),
|
||||
logStream: new PassThrough(),
|
||||
logger,
|
||||
workspacePath,
|
||||
|
||||
async createTemporaryDirectory() {
|
||||
return fs.mkdtemp(mockDir.resolve('tmp-'));
|
||||
},
|
||||
});
|
||||
const mockContext = (input: any) =>
|
||||
createMockActionContext({
|
||||
templateInfo: {
|
||||
baseUrl: 'base-url',
|
||||
entityRef: 'template:default/test-template',
|
||||
},
|
||||
input,
|
||||
workspacePath,
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
mockDir.clear();
|
||||
|
||||
@@ -21,13 +21,8 @@ jest.mock('@backstage/plugin-scaffolder-node', () => {
|
||||
|
||||
import { join as joinPath, sep as pathSep } from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import {
|
||||
getVoidLogger,
|
||||
resolvePackagePath,
|
||||
UrlReader,
|
||||
} from '@backstage/backend-common';
|
||||
import { resolvePackagePath, UrlReader } from '@backstage/backend-common';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createFetchTemplateAction } from './template';
|
||||
import {
|
||||
fetchContents,
|
||||
@@ -35,6 +30,7 @@ import {
|
||||
TemplateAction,
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
|
||||
type FetchTemplateInput = ReturnType<
|
||||
typeof createFetchTemplateAction
|
||||
@@ -59,29 +55,22 @@ describe('fetch:template', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = mockDir.resolve('workspace');
|
||||
|
||||
const logger = getVoidLogger();
|
||||
|
||||
const mockContext = (inputPatch: Partial<FetchTemplateInput> = {}) => ({
|
||||
templateInfo: {
|
||||
baseUrl: 'base-url',
|
||||
entityRef: 'template:default/test-template',
|
||||
},
|
||||
input: {
|
||||
url: './skeleton',
|
||||
targetPath: './target',
|
||||
values: {
|
||||
test: 'value',
|
||||
const mockContext = (inputPatch: Partial<FetchTemplateInput> = {}) =>
|
||||
createMockActionContext({
|
||||
templateInfo: {
|
||||
baseUrl: 'base-url',
|
||||
entityRef: 'template:default/test-template',
|
||||
},
|
||||
...inputPatch,
|
||||
},
|
||||
output: jest.fn(),
|
||||
logStream: new PassThrough(),
|
||||
logger,
|
||||
workspacePath,
|
||||
async createTemporaryDirectory() {
|
||||
return fs.mkdtemp(mockDir.resolve('tmp-'));
|
||||
},
|
||||
});
|
||||
input: {
|
||||
url: './skeleton',
|
||||
targetPath: './target',
|
||||
values: {
|
||||
test: 'value',
|
||||
},
|
||||
...inputPatch,
|
||||
},
|
||||
workspacePath,
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
mockDir.setContent({
|
||||
|
||||
+3
-8
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
|
||||
import { createFilesystemDeleteAction } from './delete';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import yaml from 'yaml';
|
||||
@@ -31,16 +30,12 @@ describe('fs:delete examples', () => {
|
||||
|
||||
const files: string[] = yaml.parse(examples[0].example).steps[0].input.files;
|
||||
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
files: files,
|
||||
},
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { createFilesystemDeleteAction } from './delete';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import fs from 'fs-extra';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
|
||||
@@ -27,16 +26,12 @@ describe('fs:delete', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = resolvePath(mockDir.path, 'workspace');
|
||||
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
files: ['unit-test-a.js', 'unit-test-b.js'],
|
||||
},
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
|
||||
+3
-8
@@ -16,8 +16,7 @@
|
||||
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { createFilesystemRenameAction } from './rename';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import fs from 'fs-extra';
|
||||
import yaml from 'yaml';
|
||||
import { examples } from './rename.examples';
|
||||
@@ -31,16 +30,12 @@ describe('fs:rename examples', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const workspacePath = resolvePath(mockDir.path, 'workspace');
|
||||
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
files: files,
|
||||
},
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { createFilesystemRenameAction } from './rename';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createMockActionContext } from '@backstage/scaffolder-test-utils';
|
||||
import fs from 'fs-extra';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
|
||||
@@ -41,16 +40,12 @@ describe('fs:rename', () => {
|
||||
to: 'brand-new-folder',
|
||||
},
|
||||
];
|
||||
const mockContext = {
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
files: mockInputFiles,
|
||||
},
|
||||
workspacePath,
|
||||
logger: getVoidLogger(),
|
||||
logStream: new PassThrough(),
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
|
||||
@@ -8399,6 +8399,7 @@ __metadata:
|
||||
"@backstage/errors": "workspace:^"
|
||||
"@backstage/integration": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-node": "workspace:^"
|
||||
"@backstage/scaffolder-test-utils": "workspace:^"
|
||||
"@gitbeaker/core": ^35.8.0
|
||||
"@gitbeaker/node": ^35.8.0
|
||||
"@gitbeaker/rest": ^39.25.0
|
||||
@@ -8421,6 +8422,7 @@ __metadata:
|
||||
"@backstage/errors": "workspace:^"
|
||||
"@backstage/integration": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-node": "workspace:^"
|
||||
"@backstage/scaffolder-test-utils": "workspace:^"
|
||||
"@backstage/types": "workspace:^"
|
||||
"@types/command-exists": ^1.2.0
|
||||
"@types/fs-extra": ^11.0.0
|
||||
@@ -8441,6 +8443,7 @@ __metadata:
|
||||
"@backstage/config": "workspace:^"
|
||||
"@backstage/errors": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-node": "workspace:^"
|
||||
"@backstage/scaffolder-test-utils": "workspace:^"
|
||||
"@backstage/types": "workspace:^"
|
||||
msw: ^2.0.0
|
||||
yaml: ^2.3.3
|
||||
@@ -8455,6 +8458,7 @@ __metadata:
|
||||
"@backstage/backend-plugin-api": "workspace:^"
|
||||
"@backstage/cli": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-node": "workspace:^"
|
||||
"@backstage/scaffolder-test-utils": "workspace:^"
|
||||
"@backstage/types": "workspace:^"
|
||||
winston: ^3.2.1
|
||||
yeoman-environment: ^3.9.1
|
||||
@@ -8490,6 +8494,7 @@ __metadata:
|
||||
"@backstage/plugin-scaffolder-backend-module-gitlab": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-node": "workspace:^"
|
||||
"@backstage/scaffolder-test-utils": "workspace:^"
|
||||
"@backstage/types": "workspace:^"
|
||||
"@types/express": ^4.17.6
|
||||
"@types/fs-extra": ^11.0.0
|
||||
|
||||
Reference in New Issue
Block a user