Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

todo - version:bump to v1.30.2 #953

Merged
merged 5 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions workspaces/todo/.changeset/version-bump-1-30-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage-community/plugin-todo': patch
'@backstage-community/plugin-todo-backend': patch
---

Backstage version bump to v1.30.2
2 changes: 1 addition & 1 deletion workspaces/todo/backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.29.1"
"version": "1.30.2"
}
4 changes: 2 additions & 2 deletions workspaces/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"directory": "workspaces/todo"
},
"devDependencies": {
"@backstage/cli": "^0.26.11",
"@backstage/cli": "^0.27.0",
"@backstage/e2e-test-utils": "^0.1.1",
"@backstage/repo-tools": "^0.9.4",
"@backstage/repo-tools": "^0.9.5",
"@changesets/cli": "^2.27.1",
"@spotify/prettier-config": "^15.0.0",
"node-gyp": "^10.0.0",
Expand Down
10 changes: 7 additions & 3 deletions workspaces/todo/plugins/todo-backend/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import express from 'express';
import { LoggerService } from '@backstage/backend-plugin-api';
import { ScmIntegrations } from '@backstage/integration';
import { ServiceRef } from '@backstage/backend-plugin-api';
import { UrlReader } from '@backstage/backend-common';
import { UrlReaderService } from '@backstage/backend-plugin-api';

// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
Expand Down Expand Up @@ -120,7 +120,11 @@ export type TodoReaderServiceOptions = {
};

// @public (undocumented)
export const todoReaderServiceRef: ServiceRef<TodoReader, 'plugin'>;
export const todoReaderServiceRef: ServiceRef<
TodoReader,
'plugin',
'singleton'
>;

// @public (undocumented)
export class TodoScmReader implements TodoReader {
Expand All @@ -137,7 +141,7 @@ export class TodoScmReader implements TodoReader {
// @public (undocumented)
export type TodoScmReaderOptions = {
logger: LoggerService;
reader: UrlReader;
reader: UrlReaderService;
integrations: ScmIntegrations;
parser?: TodoParser;
filePathFilter?: (filePath: string) => boolean;
Expand Down
19 changes: 10 additions & 9 deletions workspaces/todo/plugins/todo-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,24 @@
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/backend-common": "^0.23.3",
"@backstage/backend-openapi-utils": "^0.1.15",
"@backstage/backend-plugin-api": "^0.7.0",
"@backstage/catalog-client": "^1.6.5",
"@backstage/catalog-model": "^1.5.0",
"@backstage/backend-common": "^0.24.0",
"@backstage/backend-openapi-utils": "^0.1.16",
"@backstage/backend-plugin-api": "^0.8.0",
"@backstage/catalog-client": "^1.6.6",
"@backstage/catalog-model": "^1.6.0",
"@backstage/config": "^1.2.0",
"@backstage/errors": "^1.2.4",
"@backstage/integration": "^1.13.0",
"@backstage/plugin-catalog-node": "^1.12.4",
"@backstage/integration": "^1.14.0",
"@backstage/plugin-catalog-node": "^1.12.5",
"@types/express": "^4.17.6",
"express": "^4.17.1",
"leasot": "^12.0.0",
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.26.11",
"@backstage/repo-tools": "^0.9.4",
"@backstage/backend-test-utils": "^0.5.0",
"@backstage/cli": "^0.27.0",
"@backstage/repo-tools": "^0.9.5",
"@types/supertest": "^6.0.0",
"supertest": "^7.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
* limitations under the License.
*/

import {
getVoidLogger,
ReadTreeResponse,
UrlReader,
} from '@backstage/backend-common';
import { ConfigReader } from '@backstage/config';
import { NotFoundError, NotModifiedError } from '@backstage/errors';
import { ScmIntegrations } from '@backstage/integration';
import { createTodoParser } from './createTodoParser';
import { TodoScmReader } from './TodoScmReader';
import {
UrlReaderService,
UrlReaderServiceReadTreeResponse,
} from '@backstage/backend-plugin-api';
import { mockServices } from '@backstage/backend-test-utils';

function mockReader(): jest.Mocked<UrlReader> {
function mockReader(): jest.Mocked<UrlReaderService> {
return {
read: jest.fn(),
readTree: jest.fn(),
search: jest.fn(),
readUrl: jest.fn(),
} as jest.Mocked<UrlReader>;
} as jest.Mocked<UrlReaderService>;
}

describe('TodoScmReader', () => {
it('should be created from config', () => {
const todoReader = TodoScmReader.fromConfig(new ConfigReader({}), {
logger: getVoidLogger(),
logger: mockServices.logger.mock(),
reader: mockReader(),
});
expect(todoReader).toEqual(expect.any(TodoScmReader));
Expand All @@ -46,7 +46,7 @@ describe('TodoScmReader', () => {
it('should read TODOs', async () => {
const reader = mockReader();
const todoReader = new TodoScmReader({
logger: getVoidLogger(),
logger: mockServices.logger.mock(),
reader,
integrations: ScmIntegrations.fromConfig(new ConfigReader({})),
});
Expand All @@ -59,7 +59,7 @@ describe('TodoScmReader', () => {
path: 'my-folder/my-file.js',
},
],
} as ReadTreeResponse);
} as UrlReaderServiceReadTreeResponse);

const url = 'https://github.com/backstage/backstage/catalog-info.yaml';
const expected = {
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('TodoScmReader', () => {
const parser = jest.fn(createTodoParser({ additionalTags: ['XXX'] }));
const reader = mockReader();
const todoReader = new TodoScmReader({
logger: getVoidLogger(),
logger: mockServices.logger.mock(),
reader,
parser,
integrations: ScmIntegrations.fromConfig(new ConfigReader({})),
Expand All @@ -135,7 +135,7 @@ describe('TodoScmReader', () => {
path: 'my-file.lua',
},
],
} as ReadTreeResponse);
} as UrlReaderServiceReadTreeResponse);

await expect(
todoReader.readTodos({
Expand All @@ -160,7 +160,7 @@ describe('TodoScmReader', () => {
});

it('should log and ignore parser errors', async () => {
const logger = getVoidLogger();
const logger = mockServices.logger.mock();
const errorSpy = jest.spyOn(logger, 'error');
const reader = mockReader();
const todoReader = new TodoScmReader({
Expand All @@ -179,7 +179,7 @@ describe('TodoScmReader', () => {
path: 'my-file.sh',
},
],
} as ReadTreeResponse);
} as UrlReaderServiceReadTreeResponse);

await expect(
todoReader.readTodos({
Expand All @@ -196,7 +196,7 @@ describe('TodoScmReader', () => {
const filePathFilter = jest.fn(() => true);

const todoReader = new TodoScmReader({
logger: getVoidLogger(),
logger: mockServices.logger.mock(),
reader,
integrations: ScmIntegrations.fromConfig(new ConfigReader({})),
filePathFilter,
Expand All @@ -208,7 +208,7 @@ describe('TodoScmReader', () => {
path: 'my-folder/my-file.js',
},
],
} as ReadTreeResponse);
} as UrlReaderServiceReadTreeResponse);
await expect(
todoReader.readTodos({
url: 'https://github.com/backstage/backstage/catalog-info.yaml',
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('TodoScmReader', () => {
const filePathFilter = jest.fn(() => false);

const todoReader = new TodoScmReader({
logger: getVoidLogger(),
logger: mockServices.logger.mock(),
reader,
integrations: ScmIntegrations.fromConfig(new ConfigReader({})),
filePathFilter,
Expand All @@ -256,7 +256,7 @@ describe('TodoScmReader', () => {
path: '',
},
],
} as ReadTreeResponse);
} as UrlReaderServiceReadTreeResponse);
await expect(
todoReader.readTodos({
url: 'https://github.com/backstage/backstage/catalog-info.yaml',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import { UrlReader } from '@backstage/backend-common';
import { ScmIntegrations } from '@backstage/integration';

import {
Expand All @@ -32,6 +31,7 @@ import {
createServiceFactory,
createServiceRef,
LoggerService,
UrlReaderService,
} from '@backstage/backend-plugin-api';

const excludedExtensions = [
Expand All @@ -49,7 +49,7 @@ const MAX_FILE_SIZE = 200000;
/** @public */
export type TodoScmReaderOptions = {
logger: LoggerService;
reader: UrlReader;
reader: UrlReaderService;
integrations: ScmIntegrations;
parser?: TodoParser;
filePathFilter?: (filePath: string) => boolean;
Expand All @@ -63,7 +63,7 @@ type CacheItem = {
/** @public */
export class TodoScmReader implements TodoReader {
private readonly logger: LoggerService;
private readonly reader: UrlReader;
private readonly reader: UrlReaderService;
private readonly parser: TodoParser;
private readonly integrations: ScmIntegrations;
private readonly filePathFilter: (filePath: string) => boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
import {
createServiceFactory,
createServiceRef,
ServiceRef,
} from '@backstage/backend-plugin-api';
import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';

Expand Down Expand Up @@ -138,22 +137,21 @@ export class TodoReaderService implements TodoService {
}
}

export const todoServiceRef: ServiceRef<TodoService> =
createServiceRef<TodoService>({
id: 'todo.client',
defaultFactory: async service =>
createServiceFactory({
service,
deps: {
catalogApi: catalogServiceRef,
todoReader: todoReaderServiceRef,
},
async factory({ catalogApi, todoReader }) {
const todoReaderService = new TodoReaderService({
catalogClient: catalogApi,
todoReader,
});
return todoReaderService;
},
}),
});
export const todoServiceRef = createServiceRef<TodoService>({
id: 'todo.client',
defaultFactory: async service =>
createServiceFactory({
service,
deps: {
catalogApi: catalogServiceRef,
todoReader: todoReaderServiceRef,
},
async factory({ catalogApi, todoReader }) {
const todoReaderService = new TodoReaderService({
catalogClient: catalogApi,
todoReader,
});
return todoReaderService;
},
}),
});
12 changes: 6 additions & 6 deletions workspaces/todo/plugins/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/catalog-model": "^1.5.0",
"@backstage/core-components": "^0.14.9",
"@backstage/catalog-model": "^1.6.0",
"@backstage/core-components": "^0.14.10",
"@backstage/core-plugin-api": "^1.9.3",
"@backstage/errors": "^1.2.4",
"@backstage/plugin-catalog-react": "^1.12.2",
"@backstage/plugin-catalog-react": "^1.12.3",
"@material-ui/icons": "^4.9.1",
"@types/react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.26.11",
"@backstage/dev-utils": "^1.0.35",
"@backstage/test-utils": "^1.5.8",
"@backstage/cli": "^0.27.0",
"@backstage/dev-utils": "^1.0.37",
"@backstage/test-utils": "^1.5.10",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^15.0.0",
Expand Down
Loading
Loading