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

Add new backend support #15

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion plugins/library-check-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.21.2",
"@backstage/backend-plugin-api": "^0.6.12",
"@backstage/backend-plugin-api": "^1.0.2",
"@backstage/backend-tasks": "^0.5.17",
"@backstage/backend-test-utils": "^0.3.3",
"@backstage/catalog-model": "^1.4.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { UrlReader } from '@backstage/backend-common';
import { Entity } from '@backstage/catalog-model';
import { Config } from '@backstage/config';
import {
Expand All @@ -14,12 +13,12 @@ import { Library, TLanguages } from '../types';
import * as T from '../types';
import { LibraryCheckService } from '../service/LibraryCheckService';
import { FileToLanguageMap, RegistryConfig } from '../mappers/RegistryMapper';
import { DiscoveryService } from '@backstage/backend-plugin-api';
import { DiscoveryService, UrlReaderService } from '@backstage/backend-plugin-api';

export class LibraryCheckProcessor implements CatalogProcessor {
private readonly integrations: ScmIntegrationRegistry;
private readonly logger: Logger;
private readonly reader: UrlReader;
private readonly reader: UrlReaderService;
private readonly descriptorHandler: DescriptorFileHandler;
private readonly libraryCheckService: LibraryCheckService;
private readonly discoveryService: DiscoveryService;
Expand All @@ -29,7 +28,7 @@ export class LibraryCheckProcessor implements CatalogProcessor {
options: {
logger: Logger;
discoveryService: DiscoveryService;
reader: UrlReader;
reader: UrlReaderService;
},
) {
const integrations = ScmIntegrations.fromConfig(config);
Expand All @@ -43,7 +42,7 @@ export class LibraryCheckProcessor implements CatalogProcessor {
constructor(options: {
integrations: ScmIntegrationRegistry;
logger: Logger;
reader: UrlReader;
reader: UrlReaderService;
discoveryService: DiscoveryService;
}) {
this.discoveryService = options.discoveryService;
Expand Down Expand Up @@ -148,7 +147,9 @@ export class LibraryCheckProcessor implements CatalogProcessor {
const { files } = await this.reader.search(url);

if (files.length !== 0) {

const processedFiles = await Promise.all(
//@ts-ignore
files.map(async file => {
try {
const bufferContent = await file.content();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { UrlReader } from '@backstage/backend-common';
import { Entity } from '@backstage/catalog-model';
import { Config } from '@backstage/config';
import {
Expand All @@ -9,7 +8,7 @@ import { CatalogProcessor } from '@backstage/plugin-catalog-node';
import { Logger } from 'winston';
import * as T from '../types';
import { LibraryCheckService } from '../service/LibraryCheckService';
import { DiscoveryService } from '@backstage/backend-plugin-api';
import {DiscoveryService, UrlReaderService} from '@backstage/backend-plugin-api';
import { semverImpact, versionToObj } from '../utils/semver';
import { LibraryUpdateRecord } from '../types';

Expand All @@ -22,7 +21,7 @@ export class LibraryCheckUpdaterProcessor implements CatalogProcessor {
config: Config,
options: {
logger: Logger;
reader: UrlReader;
reader: UrlReaderService;
discoveryService: DiscoveryService;
},
) {
Expand All @@ -37,7 +36,7 @@ export class LibraryCheckUpdaterProcessor implements CatalogProcessor {
constructor(options: {
integrations: ScmIntegrationRegistry;
logger: Logger;
reader: UrlReader;
reader: UrlReaderService;
discoveryService: DiscoveryService;
}) {
this.discoveryService = options.discoveryService;
Expand Down