refactor: apply review suggestions

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-05-13 10:35:20 +02:00
parent 57f692e66c
commit f633efa1c7
4 changed files with 12 additions and 9 deletions
-1
View File
@@ -1,6 +1,5 @@
---
'@backstage/backend-common': patch
'@backstage/plugin-scaffolder-node': patch
---
Preparing for a stable new backend system release, we are deprecating utilities in the `backend-common` that are not used by the core framework, such as the isomorphic `Git` class. As we will no longer support the isomorphic `Git` utility in the framework packages, we recommend plugins that start maintaining their own implementation of this class.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-node': patch
---
To remove the dependency on the soon-to-be-deprecated `backend-common` package, this package now maintains its own isomorphic Git class implementation.
@@ -45,13 +45,7 @@ import {
SearchResponse,
UrlReader,
} from './types';
import { StaticAuthOptions, AuthCallbackOptions, Git } from './git';
export function isAuthCallbackOptions(
options: StaticAuthOptions | AuthCallbackOptions,
): options is AuthCallbackOptions {
return 'onAuth' in options;
}
import { Git } from './git';
const pipeline = promisify(pipelineCb);
+6 -1
View File
@@ -18,7 +18,6 @@ import fs from 'fs-extra';
import isomorphicGit, { ProgressCallback, AuthCallback } from 'isomorphic-git';
import http from 'isomorphic-git/http/node';
import { LoggerService } from '@backstage/backend-plugin-api';
import { isAuthCallbackOptions } from './GerritUrlReader';
/**
* Configure static credential for authentication
@@ -42,6 +41,12 @@ export type AuthCallbackOptions = {
logger?: LoggerService;
};
function isAuthCallbackOptions(
options: StaticAuthOptions | AuthCallbackOptions,
): options is AuthCallbackOptions {
return 'onAuth' in options;
}
/*
provider username password
Azure 'notempty' token