Merge pull request #14192 from Bonial-International-GmbH/pjungermann/github/naming-part2
chore(integration): use consistent naming of `[gG]ithub` in code
This commit is contained in:
@@ -22,7 +22,7 @@ import { ErrorRequestHandler } from 'express';
|
||||
import express from 'express';
|
||||
import { GerritIntegration } from '@backstage/integration';
|
||||
import { GithubCredentialsProvider } from '@backstage/integration';
|
||||
import { GitHubIntegration } from '@backstage/integration';
|
||||
import { GithubIntegration } from '@backstage/integration';
|
||||
import { GitLabIntegration } from '@backstage/integration';
|
||||
import { isChildPath } from '@backstage/cli-common';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
@@ -409,7 +409,7 @@ export class Git {
|
||||
// @public
|
||||
export class GithubUrlReader implements UrlReader {
|
||||
constructor(
|
||||
integration: GitHubIntegration,
|
||||
integration: GithubIntegration,
|
||||
deps: {
|
||||
treeResponseFactory: ReadTreeResponseFactory;
|
||||
credentialsProvider: GithubCredentialsProvider;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import {
|
||||
GithubCredentialsProvider,
|
||||
GitHubIntegration,
|
||||
readGitHubIntegrationConfig,
|
||||
GithubIntegration,
|
||||
readGithubIntegrationConfig,
|
||||
} from '@backstage/integration';
|
||||
import { setupRequestMockHandlers } from '@backstage/backend-test-utils';
|
||||
import fs from 'fs-extra';
|
||||
@@ -46,8 +46,8 @@ const mockCredentialsProvider = {
|
||||
} as unknown as GithubCredentialsProvider;
|
||||
|
||||
const githubProcessor = new GithubUrlReader(
|
||||
new GitHubIntegration(
|
||||
readGitHubIntegrationConfig(
|
||||
new GithubIntegration(
|
||||
readGithubIntegrationConfig(
|
||||
new ConfigReader({
|
||||
host: 'github.com',
|
||||
apiBaseUrl: 'https://api.github.com',
|
||||
@@ -58,8 +58,8 @@ const githubProcessor = new GithubUrlReader(
|
||||
);
|
||||
|
||||
const gheProcessor = new GithubUrlReader(
|
||||
new GitHubIntegration(
|
||||
readGitHubIntegrationConfig(
|
||||
new GithubIntegration(
|
||||
readGithubIntegrationConfig(
|
||||
new ConfigReader({
|
||||
host: 'ghe.github.com',
|
||||
apiBaseUrl: 'https://ghe.github.com/api/v3',
|
||||
@@ -539,8 +539,8 @@ describe('GithubUrlReader', () => {
|
||||
expect(() => {
|
||||
/* eslint-disable no-new */
|
||||
new GithubUrlReader(
|
||||
new GitHubIntegration(
|
||||
readGitHubIntegrationConfig(
|
||||
new GithubIntegration(
|
||||
readGithubIntegrationConfig(
|
||||
new ConfigReader({
|
||||
host: 'ghe.mycompany.net',
|
||||
}),
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
getGitHubFileFetchUrl,
|
||||
getGithubFileFetchUrl,
|
||||
DefaultGithubCredentialsProvider,
|
||||
GithubCredentialsProvider,
|
||||
GitHubIntegration,
|
||||
GithubIntegration,
|
||||
ScmIntegrations,
|
||||
} from '@backstage/integration';
|
||||
import { RestEndpointMethodTypes } from '@octokit/rest';
|
||||
@@ -72,7 +72,7 @@ export class GithubUrlReader implements UrlReader {
|
||||
};
|
||||
|
||||
constructor(
|
||||
private readonly integration: GitHubIntegration,
|
||||
private readonly integration: GithubIntegration,
|
||||
private readonly deps: {
|
||||
treeResponseFactory: ReadTreeResponseFactory;
|
||||
credentialsProvider: GithubCredentialsProvider;
|
||||
@@ -97,7 +97,7 @@ export class GithubUrlReader implements UrlReader {
|
||||
const credentials = await this.deps.credentialsProvider.getCredentials({
|
||||
url,
|
||||
});
|
||||
const ghUrl = getGitHubFileFetchUrl(
|
||||
const ghUrl = getGithubFileFetchUrl(
|
||||
url,
|
||||
this.integration.config,
|
||||
credentials,
|
||||
|
||||
Reference in New Issue
Block a user