chore: removed unnecessary type declaration from entity provider
Signed-off-by: brentg-telus <50498366+brentg-telus@users.noreply.github.com>
This commit is contained in:
@@ -47,18 +47,15 @@ export class GitHubEntityProvider implements EntityProvider {
|
||||
// (undocumented)
|
||||
static fromConfig(
|
||||
config: Config,
|
||||
options: GitHubEntityProviderOptions,
|
||||
options: {
|
||||
logger: Logger;
|
||||
schedule: TaskRunner;
|
||||
},
|
||||
): GitHubEntityProvider[];
|
||||
// (undocumented)
|
||||
getProviderName(): string;
|
||||
// (undocumented)
|
||||
refresh(): Promise<void>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface GitHubEntityProviderOptions {
|
||||
logger: Logger;
|
||||
schedule: TaskRunner;
|
||||
refresh(logger: Logger): Promise<void>;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
||||
@@ -26,5 +26,4 @@ export { GithubOrgReaderProcessor } from './processors/GithubOrgReaderProcessor'
|
||||
export { GitHubEntityProvider } from './providers/GitHubEntityProvider';
|
||||
export { GitHubOrgEntityProvider } from './providers/GitHubOrgEntityProvider';
|
||||
export type { GitHubOrgEntityProviderOptions } from './providers/GitHubOrgEntityProvider';
|
||||
export type { GitHubEntityProviderOptions } from './providers/GitHubEntityProvider';
|
||||
export type { GithubMultiOrgConfig } from './lib';
|
||||
|
||||
@@ -39,26 +39,6 @@ import {
|
||||
} from './GitHubEntityProviderConfig';
|
||||
import { getOrganizationRepositories, Repository } from '../lib/github';
|
||||
|
||||
/**
|
||||
* Options for {@link GitHubEntityProvider}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface GitHubEntityProviderOptions {
|
||||
/**
|
||||
* A Scheduled Task Runner
|
||||
*
|
||||
* {@link @backstage/backend-tasks#PluginTaskScheduler.createScheduledTaskRunner}
|
||||
* to enable automatic scheduling of tasks.
|
||||
*/
|
||||
schedule: TaskRunner;
|
||||
|
||||
/**
|
||||
* The logger to use.
|
||||
*/
|
||||
logger: Logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discovers catalog files located in [GitHub](https://github.com).
|
||||
* The provider will search your GitHub account and register catalog files matching the configured path
|
||||
@@ -77,7 +57,10 @@ export class GitHubEntityProvider implements EntityProvider {
|
||||
|
||||
static fromConfig(
|
||||
config: Config,
|
||||
options: GitHubEntityProviderOptions,
|
||||
options: {
|
||||
logger: Logger;
|
||||
schedule: TaskRunner;
|
||||
},
|
||||
): GitHubEntityProvider[] {
|
||||
const integrations = ScmIntegrations.fromConfig(config);
|
||||
const integration = integrations.github.byHost('github.com');
|
||||
@@ -138,7 +121,7 @@ export class GitHubEntityProvider implements EntityProvider {
|
||||
taskInstanceId: uuid.v4(),
|
||||
});
|
||||
try {
|
||||
await this.refresh();
|
||||
await this.refresh(logger);
|
||||
} catch (error) {
|
||||
logger.error(error);
|
||||
}
|
||||
@@ -147,7 +130,7 @@ export class GitHubEntityProvider implements EntityProvider {
|
||||
};
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
async refresh(logger: Logger) {
|
||||
if (!this.connection) {
|
||||
throw new Error('Not initialized');
|
||||
}
|
||||
@@ -169,7 +152,7 @@ export class GitHubEntityProvider implements EntityProvider {
|
||||
entities,
|
||||
});
|
||||
|
||||
this.logger.info(
|
||||
logger.info(
|
||||
`Read ${targets.length} GitHub repositories (${entities.length} matching the pattern)`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user