Camelcase GitHub and GitLab (#2034)
* Camelcase GitHub and GitLab * GitLab * Code GitLab * GitHub in code * Fix auth naming * Update docs/features/software-templates/adding-templates.md Co-authored-by: Raghunandan Balachandran <soapraj@gmail.com> * Update docs/features/software-templates/extending/create-your-own-preparer.md Co-authored-by: Raghunandan Balachandran <soapraj@gmail.com> Co-authored-by: Raghunandan Balachandran <soapraj@gmail.com>
This commit is contained in:
@@ -54,7 +54,7 @@ contains more information about the required fields.
|
||||
Once we have a `template.yaml` ready, we can then add it to the service catalog
|
||||
for use by the scaffolder.
|
||||
|
||||
Currently the catalog supports loading definitions from Github + Local Files. To
|
||||
Currently the catalog supports loading definitions from GitHub + Local Files. To
|
||||
load from other places, not only will there need to be another preparer, but the
|
||||
support to load the location will also need to be added to the Catalog.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ The `protocol` is set on the
|
||||
when added to the service catalog. You can see more about this `PreparerKey`
|
||||
here in [Register your own template](../adding-templates.md)
|
||||
|
||||
**note:** Currently the catalog supports loading definitions from Github + Local
|
||||
**note:** Currently the catalog supports loading definitions from GitHub + Local
|
||||
Files, which translate into the two `PreparerKeys` `file` and `github`. To load
|
||||
from other places, not only will there need to be another preparer, but the
|
||||
support to load the location will also need to be added to the Catalog.
|
||||
|
||||
@@ -34,7 +34,7 @@ internally.
|
||||
|
||||
After filling in these variables, you'll get some more fields to fill out which
|
||||
are required for backstage usage. The owner, which is a `user` in the backstage
|
||||
system, and the `storePath` which right now must be a Github Organisation and a
|
||||
system, and the `storePath` which right now must be a GitHub Organisation and a
|
||||
non-existing github repository name in the format `organisation/reponame`.
|
||||
|
||||

|
||||
|
||||
@@ -109,7 +109,7 @@ export default async function createPlugin({ logger }: PluginEnvironment) {
|
||||
preparers.register('file', filePreparer);
|
||||
preparers.register('github', githubPreparer);
|
||||
|
||||
// Create Github client with your access token from environment variables
|
||||
// Create GitHub client with your access token from environment variables
|
||||
const githubClient = new Octokit({ auth: process.env.GITHUB_ACCESS_TOKEN });
|
||||
const publisher = new GithubPublisher({ client: githubClient });
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ ApiRef:
|
||||
|
||||
## githubAuth
|
||||
|
||||
Provides authentication towards Github APIs
|
||||
Provides authentication towards GitHub APIs
|
||||
|
||||
Implemented types: [OAuthApi](./OAuthApi.md),
|
||||
[ProfileInfoApi](./ProfileInfoApi.md),
|
||||
@@ -67,7 +67,7 @@ ApiRef:
|
||||
|
||||
## gitlabAuth
|
||||
|
||||
Provides authentication towards Gitlab APIs
|
||||
Provides authentication towards GitLab APIs
|
||||
|
||||
Implemented types: [OAuthApi](./OAuthApi.md),
|
||||
[ProfileInfoApi](./ProfileInfoApi.md),
|
||||
|
||||
@@ -13,7 +13,7 @@ Two days ago, we released the open source version of [Backstage](https://backsta
|
||||
|
||||
## What’s the big infrastructure problem?
|
||||
|
||||
As companies grow, their infrastructure systems get messier. Consider a team that wants to deploy something to the cloud. While Spotify has many awesome engineers, not every engineer is well-versed in our chosen cloud-provider tooling. Yet everyone is required to know and understand Terraform, GCP/AWS/Azure CLIs, Gitlab CI, Prometheus, Kubernetes, Docker, various monitoring and alerting tools, and much, much more. Once other resources come into play (databases, queueing, etc.), each engineer requires even more tools and domain-specific knowledge (or “disciplines”), from backend to machine learning, to mobile and data.
|
||||
As companies grow, their infrastructure systems get messier. Consider a team that wants to deploy something to the cloud. While Spotify has many awesome engineers, not every engineer is well-versed in our chosen cloud-provider tooling. Yet everyone is required to know and understand Terraform, GCP/AWS/Azure CLIs, GitLab CI, Prometheus, Kubernetes, Docker, various monitoring and alerting tools, and much, much more. Once other resources come into play (databases, queueing, etc.), each engineer requires even more tools and domain-specific knowledge (or “disciplines”), from backend to machine learning, to mobile and data.
|
||||
|
||||
## What’s the fix?
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ export const providers = [
|
||||
},
|
||||
{
|
||||
id: 'gitlab-auth-provider',
|
||||
title: 'Gitlab',
|
||||
message: 'Sign In using Gitlab',
|
||||
title: 'GitLab',
|
||||
message: 'Sign In using GitLab',
|
||||
apiRef: gitlabAuthApiRef,
|
||||
},
|
||||
{
|
||||
id: 'github-auth-provider',
|
||||
title: 'Github',
|
||||
message: 'Sign In using Github',
|
||||
title: 'GitHub',
|
||||
message: 'Sign In using GitHub',
|
||||
apiRef: githubAuthApiRef,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -222,7 +222,7 @@ export const googleAuthApiRef = createApiRef<
|
||||
});
|
||||
|
||||
/**
|
||||
* Provides authentication towards Github APIs.
|
||||
* Provides authentication towards GitHub APIs.
|
||||
*
|
||||
* See https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/
|
||||
* for a full list of supported scopes.
|
||||
@@ -231,7 +231,7 @@ export const githubAuthApiRef = createApiRef<
|
||||
OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionStateApi
|
||||
>({
|
||||
id: 'core.auth.github',
|
||||
description: 'Provides authentication towards Github APIs',
|
||||
description: 'Provides authentication towards GitHub APIs',
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -252,7 +252,7 @@ export const oktaAuthApiRef = createApiRef<
|
||||
});
|
||||
|
||||
/**
|
||||
* Provides authentication towards Gitlab APIs.
|
||||
* Provides authentication towards GitLab APIs.
|
||||
*
|
||||
* See https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#limiting-scopes-of-a-personal-access-token
|
||||
* for a full list of supported scopes.
|
||||
@@ -261,7 +261,7 @@ export const gitlabAuthApiRef = createApiRef<
|
||||
OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionStateApi
|
||||
>({
|
||||
id: 'core.auth.gitlab',
|
||||
description: 'Provides authentication towards Gitlab APIs',
|
||||
description: 'Provides authentication towards GitLab APIs',
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,14 +62,14 @@ export function SidebarUserSettings() {
|
||||
)}
|
||||
{providers.includes('github') && (
|
||||
<OAuthProviderSettings
|
||||
title="Github"
|
||||
title="GitHub"
|
||||
apiRef={githubAuthApiRef}
|
||||
icon={Star}
|
||||
/>
|
||||
)}
|
||||
{providers.includes('gitlab') && (
|
||||
<OAuthProviderSettings
|
||||
title="Gitlab"
|
||||
title="GitLab"
|
||||
apiRef={gitlabAuthApiRef}
|
||||
icon={Star}
|
||||
/>
|
||||
|
||||
@@ -74,7 +74,7 @@ export class GithubAuthProvider implements OAuthProviderHandlers {
|
||||
idToken: params.id_token,
|
||||
};
|
||||
|
||||
// Github provides an id numeric value (123)
|
||||
// GitHub provides an id numeric value (123)
|
||||
// as a fallback
|
||||
const id = passportProfile!.id;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ describe('GitlabApiReaderProcessor', () => {
|
||||
'https://gitlab.com/groupA/teams/teamA/repoA/-/blob/branch/my/path/',
|
||||
url: null,
|
||||
err:
|
||||
'Incorrect url: https://gitlab.com/groupA/teams/teamA/repoA/-/blob/branch/my/path/, Error: Gitlab url does not end in .ya?ml',
|
||||
'Incorrect url: https://gitlab.com/groupA/teams/teamA/repoA/-/blob/branch/my/path/, Error: GitLab url does not end in .ya?ml',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export class GitlabApiReaderProcessor implements LocationProcessor {
|
||||
const branchAndfilePath = url.pathname.split('/-/blob/')[1];
|
||||
|
||||
if (!branchAndfilePath.match(/\.ya?ml$/)) {
|
||||
throw new Error('Gitlab url does not end in .ya?ml');
|
||||
throw new Error('GitLab url does not end in .ya?ml');
|
||||
}
|
||||
|
||||
const [branch, ...filePath] = branchAndfilePath.split('/');
|
||||
@@ -127,7 +127,7 @@ export class GitlabApiReaderProcessor implements LocationProcessor {
|
||||
|
||||
return projectID;
|
||||
} catch (e) {
|
||||
throw new Error(`Could not get Gitlab ProjectID for: ${target}, ${e}`);
|
||||
throw new Error(`Could not get GitLab ProjectID for: ${target}, ${e}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export class GitlabReaderProcessor implements LocationProcessor {
|
||||
blobKeyword !== 'blob' ||
|
||||
!restOfPath.join('/').match(/\.yaml$/)
|
||||
) {
|
||||
throw new Error('Wrong Gitlab URL');
|
||||
throw new Error('Wrong GitLab URL');
|
||||
}
|
||||
|
||||
// Replace 'blob' with 'raw'
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
|
||||
export const githubActionsApiRef = createApiRef<GithubActionsApi>({
|
||||
id: 'plugin.githubactions.service',
|
||||
description: 'Used by the Github Actions plugin to make requests',
|
||||
description: 'Used by the GitHub Actions plugin to make requests',
|
||||
});
|
||||
|
||||
export type GithubActionsApi = {
|
||||
|
||||
@@ -33,7 +33,7 @@ export type GithubEndpointConfig = {
|
||||
id: string;
|
||||
title: string;
|
||||
/**
|
||||
* Github GraphQL API url, defaults to https://api.github.com/graphql
|
||||
* GitHub GraphQL API url, defaults to https://api.github.com/graphql
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,7 @@ const {
|
||||
mockRemote: jest.Mocked<NodeGit.Remote>;
|
||||
};
|
||||
|
||||
describe('Github Publisher', () => {
|
||||
describe('GitHub Publisher', () => {
|
||||
const publisher = new GithubPublisher({ client: new Octokit() });
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user