From 277644e0984a73fce10dce7d497a5ccc44b9f05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 8 Mar 2021 19:08:24 +0100 Subject: [PATCH] Include missing fields in GitLab config schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/dull-parrots-burn.md | 5 +++++ packages/integration/config.d.ts | 26 +++++++++++++++++++++-- packages/integration/src/gitlab/config.ts | 17 ++++++--------- 3 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 .changeset/dull-parrots-burn.md diff --git a/.changeset/dull-parrots-burn.md b/.changeset/dull-parrots-burn.md new file mode 100644 index 0000000000..9ce6c32501 --- /dev/null +++ b/.changeset/dull-parrots-burn.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +Include missing fields in GitLab config schema. This sometimes prevented loading config on the frontend specifically, when using self-hosted GitLab. diff --git a/packages/integration/config.d.ts b/packages/integration/config.d.ts index 7d670ea505..f0d72b7ceb 100644 --- a/packages/integration/config.d.ts +++ b/packages/integration/config.d.ts @@ -117,15 +117,37 @@ export interface Config { /** Integration configuration for GitLab */ gitlab?: Array<{ /** - * The hostname of the given GitLab instance + * The host of the target that this matches on, e.g. "gitlab.com". + * * @visibility frontend */ host: string; /** - * Token used to authenticate requests. + * The base URL of the API of this provider, e.g. + * "https://gitlab.com/api/v4", with no trailing slash. + * + * May be omitted specifically for public GitLab; then it will be deduced. + * + * @visibility frontend + */ + apiBaseUrl?: string; + /** + * The authorization token to use for requests to this provider. + * + * If no token is specified, anonymous access is used. + * * @visibility secret */ token?: string; + /** + * The baseUrl of this provider, e.g. "https://gitlab.com", which is + * passed into the GitLab client. + * + * If no baseUrl is provided, it will default to https://${host}. + * + * @visibility frontend + */ + baseUrl?: string; }>; }; } diff --git a/packages/integration/src/gitlab/config.ts b/packages/integration/src/gitlab/config.ts index cf717e08d2..47c3494109 100644 --- a/packages/integration/src/gitlab/config.ts +++ b/packages/integration/src/gitlab/config.ts @@ -25,31 +25,28 @@ const GITLAB_API_BASE_URL = 'https://gitlab.com/api/v4'; */ export type GitLabIntegrationConfig = { /** - * The host of the target that this matches on, e.g. "gitlab.com" + * The host of the target that this matches on, e.g. "gitlab.com". */ host: string; /** - * The base URL of the API of this provider, e.g. "https://gitlab.com/api/v4", - * with no trailing slash. + * The base URL of the API of this provider, e.g. + * "https://gitlab.com/api/v4", with no trailing slash. * - * May be omitted specifically for GitLab; then it will be deduced. - * - * The API will always be preferred if both its base URL and a token are - * present. + * May be omitted specifically for public GitLab; then it will be deduced. */ apiBaseUrl: string; /** - * The authorization token to use for requests this provider. + * The authorization token to use for requests to this provider. * * If no token is specified, anonymous access is used. */ token?: string; /** - * The baseUrl of this provider, e.g "https://gitlab.com", - * which is passed into the gitlab client. + * The baseUrl of this provider, e.g. "https://gitlab.com", which is passed + * into the GitLab client. * * If no baseUrl is provided, it will default to https://${host} */