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:
Johan Haals
2022-10-20 09:41:56 +02:00
committed by GitHub
36 changed files with 283 additions and 159 deletions
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { readGithubIntegrationConfigs } from '@backstage/integration';
import { GithubActionsApi } from './GithubActionsApi';
import { Octokit, RestEndpointMethodTypes } from '@octokit/rest';
import { ConfigApi, OAuthApi } from '@backstage/core-plugin-api';
@@ -36,7 +36,7 @@ export class GithubActionsClient implements GithubActionsApi {
private async getOctokit(hostname?: string): Promise<Octokit> {
// TODO: Get access token for the specified hostname
const token = await this.githubAuthApi.getAccessToken(['repo']);
const configs = readGitHubIntegrationConfigs(
const configs = readGithubIntegrationConfigs(
this.configApi.getOptionalConfigArray('integrations.github') ?? [],
);
const githubIntegrationConfig = configs.find(
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { readGithubIntegrationConfigs } from '@backstage/integration';
import { useEntity } from '@backstage/plugin-catalog-react';
import {
LinearProgress,
@@ -88,7 +88,7 @@ export const LatestWorkflowRunCard = (props: {
const config = useApi(configApiRef);
const errorApi = useApi(errorApiRef);
// TODO: Get github hostname from metadata annotation
const hostname = readGitHubIntegrationConfigs(
const hostname = readGithubIntegrationConfigs(
config.getOptionalConfigArray('integrations.github') ?? [],
)[0].host;
const [owner, repo] = (
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { readGithubIntegrationConfigs } from '@backstage/integration';
import { useEntity } from '@backstage/plugin-catalog-react';
import React, { useEffect } from 'react';
import { Link as RouterLink } from 'react-router-dom';
@@ -52,7 +52,7 @@ export const RecentWorkflowRunsCard = (props: {
const errorApi = useApi(errorApiRef);
// TODO: Get github hostname from metadata annotation
const hostname = readGitHubIntegrationConfigs(
const hostname = readGithubIntegrationConfigs(
config.getOptionalConfigArray('integrations.github') ?? [],
)[0].host;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { Entity } from '@backstage/catalog-model';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { readGithubIntegrationConfigs } from '@backstage/integration';
import {
Accordion,
AccordionDetails,
@@ -170,7 +170,7 @@ export const WorkflowRunDetails = ({ entity }: { entity: Entity }) => {
const projectName = getProjectNameFromEntity(entity);
// TODO: Get github hostname from metadata annotation
const hostname = readGitHubIntegrationConfigs(
const hostname = readGithubIntegrationConfigs(
config.getOptionalConfigArray('integrations.github') ?? [],
)[0].host;
const [owner, repo] = (projectName && projectName.split('/')) || [];
@@ -17,7 +17,7 @@
import { Entity } from '@backstage/catalog-model';
import { LogViewer } from '@backstage/core-components';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { readGithubIntegrationConfigs } from '@backstage/integration';
import {
Accordion,
AccordionSummary,
@@ -80,7 +80,7 @@ export const WorkflowRunLogs = ({
const projectName = getProjectNameFromEntity(entity);
// TODO: Get github hostname from metadata annotation
const hostname = readGitHubIntegrationConfigs(
const hostname = readGithubIntegrationConfigs(
config.getOptionalConfigArray('integrations.github') ?? [],
)[0].host;
const [owner, repo] = (projectName && projectName.split('/')) || [];
@@ -31,7 +31,7 @@ import SyncIcon from '@material-ui/icons/Sync';
import { buildRouteRef } from '../../routes';
import { getProjectNameFromEntity } from '../getProjectNameFromEntity';
import { Entity } from '@backstage/catalog-model';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { readGithubIntegrationConfigs } from '@backstage/integration';
import { EmptyState, Table, TableColumn } from '@backstage/core-components';
import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';
@@ -159,7 +159,7 @@ export const WorkflowRunsTable = ({
const config = useApi(configApiRef);
const projectName = getProjectNameFromEntity(entity);
// TODO: Get github hostname from metadata annotation
const hostname = readGitHubIntegrationConfigs(
const hostname = readGithubIntegrationConfigs(
config.getOptionalConfigArray('integrations.github') ?? [],
)[0].host;
const [owner, repo] = (projectName ?? '/').split('/');