Merge branch 'master' into feature/EKSCatalog

Signed-off-by: Jonah Back <jonah@jonahback.com>
This commit is contained in:
Jonah Back
2022-07-13 09:33:58 -07:00
370 changed files with 6709 additions and 2051 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Fixed bug where catalog metrics weren't being tracked.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Fix Error Code in Register Component DryRun
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Bumped create-app version.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes': patch
---
expose detectErrors function publicly
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/app-defaults': patch
'@backstage/core-app-api': patch
'@backstage/core-plugin-api': patch
---
Internal tweak removing usage of explicit type parameters for the `BackstagePlugin` type.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
Moving from Bitbucket Server endpoint from https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp222 to https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp224, to have the last commit in function of different branch, and not only the list of default branch
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Fix issues with optional directories and files
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/plugin-catalog-backend-module-msgraph': minor
---
Microsoft Graph plugin can supports many more options for authenticating with the Microsoft Graph API.
Previously only ClientId/ClientSecret was supported, but now all the authentication options of `DefaultAzureCredential` from `@azure/identity` are supported.
Including Managed Identity, Client Certificate, Azure CLI and VS Code.
If `clientId` and `clientSecret` are specified in configuration, the plugin behaves the same way as before.
If these fields are omitted, the plugin uses `DefaultAzureCredential` to automatically determine the best authentication method.
This is particularly useful for local development environments - the default configuration will try to use existing credentials from Visual Studio Code, Azure CLI and Azure PowerShell, without the user needing to configure any credentials in app-config.yaml
+10
View File
@@ -0,0 +1,10 @@
---
'@backstage/backend-common': patch
'@backstage/integration': patch
'@backstage/plugin-catalog-import': patch
'@backstage/plugin-git-release-manager': patch
'@backstage/plugin-github-actions': patch
'@backstage/plugin-github-pull-requests-board': patch
---
Upgrade @octokit/rest to 19.0.3
+61 -2
View File
@@ -1,5 +1,5 @@
{
"mode": "pre",
"mode": "exit",
"tag": "next",
"initialVersions": {
"example-app": "0.2.72",
@@ -159,55 +159,101 @@
"@backstage/plugin-xcmetrics": "0.2.26",
"@backstage/plugin-api-docs-module-protoc-gen-doc": "0.0.0",
"@backstage/plugin-catalog-backend-module-openapi": "0.0.0",
"@backstage/plugin-cost-insights-common": "0.0.0"
"@backstage/plugin-cost-insights-common": "0.0.0",
"@backstage/backend-app-api": "0.0.0",
"example-backend-next": "0.0.0",
"@backstage/backend-plugin-api": "0.0.0",
"@backstage/plugin-catalog-node": "0.0.0"
},
"changesets": [
"afraid-flies-try",
"beige-carpets-double",
"beige-carpets-triple",
"beige-horses-scream",
"beige-kiwis-know",
"blue-monkeys-explain",
"brave-badgers-pump",
"breezy-poems-grab",
"breezy-seas-exist",
"breezy-spiders-eat",
"bright-balloons-hide",
"calm-experts-buy",
"chilled-mirrors-grab",
"cold-coins-tickle",
"cool-toys-flow",
"create-app-1656408352",
"create-app-1657631847",
"cuddly-comics-pump",
"cuddly-flowers-provide",
"curly-candles-battle",
"curvy-weeks-matter",
"eight-suits-fail",
"eighty-windows-brush",
"fifty-cars-compare",
"fifty-vans-drum",
"five-fireants-run",
"forty-seals-complain",
"funny-fireants-shop",
"great-roses-pump",
"green-actors-argue",
"happy-boxes-melt",
"hip-ways-shop",
"hot-rice-sin",
"hungry-cougars-press",
"large-kangaroos-poke",
"lazy-steaks-tell",
"lemon-goats-obey",
"light-hornets-eat",
"little-geckos-end",
"little-guests-sell",
"long-bananas-rescue",
"loud-lemons-listen",
"many-vans-thank",
"mean-adults-argue",
"mean-berries-kick",
"metal-singers-matter",
"metal-windows-share",
"modern-ducks-lay",
"moody-crabs-march",
"nasty-zoos-cross",
"nervous-hounds-matter",
"nervous-humans-sip",
"nice-seas-jam",
"ninety-coats-learn",
"old-onions-hear",
"perfect-donuts-applaud",
"pink-cars-pretend",
"plenty-clouds-guess",
"polite-lions-sell",
"polite-moose-beam",
"popular-pots-yell",
"pretty-masks-live",
"proud-toys-return",
"purple-beans-march",
"purple-cherries-fix",
"quiet-pens-notice",
"red-games-decide",
"renovate-0546761",
"renovate-0cf9337",
"renovate-149779d",
"renovate-2ae4dda",
"renovate-33c3cf4",
"renovate-3aba547",
"renovate-4338117",
"renovate-4b5ff24",
"renovate-7438bff",
"renovate-833a91b",
"renovate-913f3dc",
"renovate-9454dab",
"renovate-9bbb0fb",
"renovate-cbb545a",
"renovate-d26eca1",
"renovate-dc1ee8d",
"renovate-dd35ce8",
"renovate-e091137",
"renovate-f43300b",
"rich-goats-breathe",
"rich-steaks-juggle",
"rude-llamas-lie",
"search-boats-double",
"search-lightning-cult",
@@ -215,38 +261,51 @@
"serious-houses-watch",
"serious-zebras-joke",
"shaggy-melons-drive",
"shaggy-spiders-notice",
"sharp-numbers-taste",
"sharp-planes-turn",
"shiny-seahorses-do",
"shiny-turkeys-doubt",
"short-deers-remember",
"short-olives-train",
"short-wolves-applaud",
"shy-cameras-develop",
"silent-coats-brake",
"silly-geese-design",
"silver-needles-unite",
"small-shoes-hide",
"smart-elephants-knock",
"smooth-sheep-hide",
"spicy-walls-repair",
"stale-needles-applaud",
"strange-tables-flash",
"strange-trains-collect",
"strong-lies-explain",
"sweet-plants-sparkle",
"swift-plants-fix",
"tame-guests-wave",
"techdocs-eyes-sit",
"techdocs-gorgeous-plants-sniff",
"techdocs-sheep-talk",
"techdocs-sixty-mugs-hug",
"techdocs-the-whole-pulse",
"ten-cobras-wash",
"tender-chicken-learn",
"tender-terms-flash",
"thick-cats-kiss",
"thick-radios-drive",
"thirty-rivers-watch",
"tricky-ravens-visit",
"twelve-candles-jump",
"twelve-peaches-tickle",
"two-crews-accept",
"two-owls-cry",
"unlucky-stingrays-juggle",
"warm-monkeys-study",
"weak-bananas-deliver",
"weak-jeans-cry",
"weak-llamas-repeat",
"wet-cameras-juggle",
"wet-dolphins-act",
"wicked-icons-grin",
"wicked-ladybugs-argue"
+43
View File
@@ -0,0 +1,43 @@
---
'@backstage/backend-common': patch
'@backstage/backend-tasks': patch
'@backstage/integration': patch
'@backstage/plugin-adr-backend': patch
'@backstage/plugin-app-backend': patch
'@backstage/plugin-auth-backend': patch
'@backstage/plugin-azure-devops': patch
'@backstage/plugin-bazaar': patch
'@backstage/plugin-bitrise': patch
'@backstage/plugin-catalog-backend': patch
'@backstage/plugin-cicd-statistics-module-gitlab': patch
'@backstage/plugin-cicd-statistics': patch
'@backstage/plugin-circleci': patch
'@backstage/plugin-cloudbuild': patch
'@backstage/plugin-code-climate': patch
'@backstage/plugin-code-coverage': patch
'@backstage/plugin-cost-insights': patch
'@backstage/plugin-firehydrant': patch
'@backstage/plugin-fossa': patch
'@backstage/plugin-gcalendar': patch
'@backstage/plugin-git-release-manager': patch
'@backstage/plugin-github-actions': patch
'@backstage/plugin-github-deployments': patch
'@backstage/plugin-gocd': patch
'@backstage/plugin-ilert': patch
'@backstage/plugin-jenkins': patch
'@backstage/plugin-kubernetes-backend': patch
'@backstage/plugin-kubernetes': patch
'@backstage/plugin-pagerduty': patch
'@backstage/plugin-periskop': patch
'@backstage/plugin-scaffolder-backend': patch
'@backstage/plugin-scaffolder': patch
'@backstage/plugin-sentry': patch
'@backstage/plugin-splunk-on-call': patch
'@backstage/plugin-tech-insights-backend-module-jsonfc': patch
'@backstage/plugin-tech-insights-backend': patch
'@backstage/plugin-tech-insights-common': patch
'@backstage/plugin-tech-insights-node': patch
'@backstage/plugin-xcmetrics': patch
---
Updated dependency `luxon` to `^3.0.0`.
+104
View File
@@ -0,0 +1,104 @@
---
'@backstage/backend-common': patch
'@backstage/backend-test-utils': patch
'@backstage/catalog-client': patch
'@backstage/cli': patch
'@backstage/config-loader': patch
'@backstage/core-app-api': patch
'@backstage/core-components': patch
'@backstage/core-plugin-api': patch
'@backstage/integration-react': patch
'@backstage/integration': patch
'@backstage/release-manifests': patch
'@backstage/test-utils': patch
'@backstage/plugin-adr-backend': patch
'@backstage/plugin-adr': patch
'@backstage/plugin-airbrake-backend': patch
'@backstage/plugin-airbrake': patch
'@backstage/plugin-allure': patch
'@backstage/plugin-analytics-module-ga': patch
'@backstage/plugin-apache-airflow': patch
'@backstage/plugin-api-docs': patch
'@backstage/plugin-app-backend': patch
'@backstage/plugin-auth-backend': patch
'@backstage/plugin-auth-node': patch
'@backstage/plugin-azure-devops-backend': patch
'@backstage/plugin-azure-devops': patch
'@backstage/plugin-badges': patch
'@backstage/plugin-bitbucket-cloud-common': patch
'@backstage/plugin-bitrise': patch
'@backstage/plugin-catalog-backend-module-azure': patch
'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch
'@backstage/plugin-catalog-backend-module-bitbucket': patch
'@backstage/plugin-catalog-backend-module-gerrit': patch
'@backstage/plugin-catalog-backend-module-github': patch
'@backstage/plugin-catalog-backend-module-gitlab': patch
'@backstage/plugin-catalog-backend-module-msgraph': patch
'@backstage/plugin-catalog-backend': patch
'@backstage/plugin-catalog-graphql': patch
'@backstage/plugin-catalog-import': patch
'@backstage/plugin-circleci': patch
'@backstage/plugin-cloudbuild': patch
'@backstage/plugin-code-climate': patch
'@backstage/plugin-code-coverage-backend': patch
'@backstage/plugin-code-coverage': patch
'@backstage/plugin-codescene': patch
'@backstage/plugin-config-schema': patch
'@backstage/plugin-cost-insights': patch
'@backstage/plugin-dynatrace': patch
'@backstage/plugin-explore-react': patch
'@backstage/plugin-explore': patch
'@backstage/plugin-firehydrant': patch
'@backstage/plugin-fossa': patch
'@backstage/plugin-gcalendar': patch
'@backstage/plugin-gcp-projects': patch
'@backstage/plugin-git-release-manager': patch
'@backstage/plugin-github-actions': patch
'@backstage/plugin-github-deployments': patch
'@backstage/plugin-github-pull-requests-board': patch
'@backstage/plugin-gitops-profiles': patch
'@backstage/plugin-gocd': patch
'@backstage/plugin-graphiql': patch
'@backstage/plugin-graphql-backend': patch
'@backstage/plugin-home': patch
'@backstage/plugin-ilert': patch
'@backstage/plugin-jenkins-backend': patch
'@backstage/plugin-jenkins': patch
'@backstage/plugin-kafka': patch
'@backstage/plugin-kubernetes': patch
'@backstage/plugin-lighthouse': patch
'@backstage/plugin-newrelic': patch
'@backstage/plugin-org': patch
'@backstage/plugin-pagerduty': patch
'@backstage/plugin-periskop-backend': patch
'@backstage/plugin-periskop': patch
'@backstage/plugin-permission-backend': patch
'@backstage/plugin-permission-common': patch
'@backstage/plugin-permission-node': patch
'@backstage/plugin-proxy-backend': patch
'@backstage/plugin-rollbar-backend': patch
'@backstage/plugin-rollbar': patch
'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch
'@backstage/plugin-scaffolder-backend': patch
'@backstage/plugin-scaffolder': patch
'@backstage/plugin-search': patch
'@backstage/plugin-sentry': patch
'@backstage/plugin-shortcuts': patch
'@backstage/plugin-sonarqube': patch
'@backstage/plugin-splunk-on-call': patch
'@backstage/plugin-stack-overflow': patch
'@backstage/plugin-tech-insights': patch
'@backstage/plugin-tech-radar': patch
'@backstage/plugin-techdocs-addons-test-utils': patch
'@backstage/plugin-techdocs-backend': patch
'@backstage/plugin-techdocs-module-addons-contrib': patch
'@backstage/plugin-techdocs': patch
'@backstage/plugin-todo-backend': patch
'@backstage/plugin-todo': patch
'@backstage/plugin-user-settings': patch
'@backstage/plugin-vault-backend': patch
'@backstage/plugin-vault': patch
'@backstage/plugin-xcmetrics': patch
---
Updated dependency `msw` to `^0.44.0`.
+8
View File
@@ -0,0 +1,8 @@
---
'@backstage/cli': patch
---
Updated dependency `@spotify/prettier-config` to `^14.0.0`.
Updated dependency `@spotify/eslint-config-base` to `^14.0.0`.
Updated dependency `@spotify/eslint-config-react` to `^14.0.0`.
Updated dependency `@spotify/eslint-config-typescript` to `^14.0.0`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend-module-elasticsearch': patch
---
Updated dependency `@opensearch-project/opensearch` to `^2.0.0`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Add sourcePath option to publish:gerrit action
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-common': patch
'@backstage/integration': patch
---
Support self-hosted gitlab installations with relative URL.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Improve accessibility for CopyTextButton
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-plugin-api': patch
---
Enabled the `@backstage/core-plugin-api/alpha` entry point.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder': patch
'@backstage/plugin-scaffolder-backend': patch
---
Allow to create Gerrit project using default owner
+1 -1
View File
@@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@main
- uses: actions/stale@v5
id: stale
with:
stale-issue-message: >
+3
View File
@@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
@@ -44,6 +45,7 @@ jobs:
needs: install
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
@@ -120,6 +122,7 @@ jobs:
needs: install
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
+1
View File
@@ -28,6 +28,7 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [14.x, 16.x]
+230 -3
View File
@@ -3,12 +3,239 @@ id: org
title: Microsoft Azure Active Directory Organizational Data
sidebar_label: Org Data
# prettier-ignore
description: Importing users and groups from a Microsoft Azure Active Directory into Backstage
description: Importing users and groups from Microsoft Azure Active Directory into Backstage
---
The Backstage catalog can be set up to ingest organizational data - users and
teams - directly from a tenant in Microsoft Azure Active Directory via the
Microsoft Graph API.
More details on this are available in the
[README of the `@backstage/plugin-catalog-backend-module-msgraph` package](https://github.com/backstage/backstage/blob/master/plugins/catalog-backend-module-msgraph/README.md).
## Installation
The package is not installed by default, therefore you have to add `@backstage/plugin-catalog-backend-module-msgraph` to your backend package.
```bash
# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-catalog-backend-module-msgraph
```
Next add the basic configuration to `app-config.yaml`
```yaml
catalog:
providers:
microsoftGraphOrg:
default:
tenantId: ${AZURE_TENANT_ID}
user:
filter: accountEnabled eq true and userType eq 'member'
group:
filter: >
securityEnabled eq false
and mailEnabled eq true
and groupTypes/any(c:c+eq+'Unified')
```
Finally, register the plugin in `catalog.ts`.
For large organizations, this plugin can take a long time, so be careful setting low frequency / timeouts.
```diff
// packages/backend/src/plugins/catalog.ts
+import { MicrosoftGraphOrgEntityProvider } from '@backstage/plugin-catalog-backend-module-msgraph';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
+ builder.addEntityProvider(
+ MicrosoftGraphOrgEntityProvider.fromConfig(env.config, {
+ logger: env.logger,
+ schedule: env.scheduler.createScheduledTaskRunner({
+ frequency: { hours: 1 },
+ timeout: { minutes: 50 },
+ initialDelay: { seconds: 15}
+ }),
+ }),
+ );
```
## Authenticating with Microsoft Graph
### Local Development
For a local dev environment, it's recommended you have the Azure CLI or Azure PowerShell installed, and are logged in to those.
Alternatively you can use VSCode with the Azure extension if you install `@azure/identity-vscode`.
When these are set up, the plugin will authenticate with the Microsoft Graph API without you needing to configure any credentials, or granting any special permissions.
If you can't do this, you'll have to create an App Registration.
## App Registration
If none of the other authentication methods work, you can create an app registration in the azure portal.
By default the graph plugin requires the following Application permissions (not Delegated) for Microsoft Graph:
- `GroupMember.Read.All`
- `User.Read.All`
If your organization required Admin Consent for these permissions, that will need to be granted.
When authenticating with a ClientId/ClientSecret, you can either set the `AZURE_TENANT_ID`, `AZURE_CLIENT_ID` and `AZURE_CLIENT_SECRET` environment variables, or specify the values in configuration
```yaml
microsoftGraphOrg:
default:
##...
clientId: 9ef1aac6-b454-4e69-9cf5-7199df049281
clientSecret: REDACTED
```
To authenticate with a certificate rather than a client secret, you can set the `AZURE_TENANT_ID`, `AZURE_CLIENT_ID` and `AZURE_CLIENT_CERTIFICATE_PATH` environments
### Managed Identity
If deploying to resources that supports Managed Identity, and has identities configured (e.g. Azure App Services, Azure Container Apps), Managed Identity should be picked up without any additional configuration.
If your app has multiple managed identities, you may need to set the `AZURE_CLIENT_ID` environment variable to tell Azure Identity which identity to use.
You will need to grant the same permissions to your identity as described for App Registrations above.
## Filtering imported Users and Groups
By default, the plugin will import all users and groups from your directory.
This can be customized through filters and search queries.
### Groups
A smaller set of groups can be obtained by configuring a search query or a filter.
If both `filter` and `search` are provided, then groups must match both to be ingested.
```yaml
microsoftGraphOrg:
providerId:
group:
filter: securityEnabled eq false and mailEnabled eq true and groupTypes/any(c:c+eq+'Unified')
search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")'
```
In addition to these groups, one additional group will be created for your organization.
All imported groups will be a child of this group.
### Users
There are two modes for importing users - You can import all user objects matching a `filter`.
```yaml
microsoftGraphOrg:
providerId:
user:
filter: accountEnabled eq true and userType eq 'member'
```
Alternatively you can import users that are members of specific groups.
For each group matching the `search` and `filter` query, each group member will be imported.
Only direct group members will be imported, not transient users.
```yaml
microsoftGraphOrg:
providerId:
userGroupMember:
filter: "displayName eq 'Backstage Users'"
search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")'
```
## Customizing Transformation
Ingested entities can be customized by providing custom transformers.
These can be used to completely replace the built in logic, or used to tweak it by using the default transformers (`defaultGroupTransformer`, `defaultUserTransformer` and `defaultOrganizationTransformer`
Entities can also be excluded from backstage by returning `undefined`.
These Transformers are be registered when configuring `MicrosoftGraphOrgEntityProvider`
```diff
builder.addEntityProvider(
MicrosoftGraphOrgEntityProvider.fromConfig(env.config, {
// ...
+ groupTransformer: myGroupTransformer,
+ userTransformer: myUserTransformer,
+ organizationTransformer: myOrganizationTransformer,
}),
);
```
When using custom transformers, you may want to customize the data returned.
Several configuration options can be provided to tweak the Microsoft Graph query to get the data you need
```yaml
microsoftGraphOrg:
providerId:
user:
expand: manager
group:
expand: member
select: ['id', 'displayName', 'description']
```
The following provides an example of each kind of transformer
```ts
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
import {
defaultGroupTransformer,
defaultUserTransformer,
defaultOrganizationTransformer,
} from '@backstage/plugin-catalog-backend-module-msgraph';
import { GroupEntity, UserEntity } from '@backstage/catalog-model';
// This group transformer completely replaces the built in logic with custom logic.
export async function myGroupTransformer(
group: MicrosoftGraph.Group,
groupPhoto?: string,
): Promise<GroupEntity | undefined> {
return {
apiVersion: 'backstage.io/v1alpha1',
kind: 'Group',
metadata: {
name: group.id!,
annotations: {},
},
spec: {
type: 'aad',
children: [],
},
};
}
// This user transformer makes use of the built in logic, but also sets the description field
export async function myUserTransformer(
graphUser: MicrosoftGraph.User,
userPhoto?: string,
): Promise<UserEntity | undefined> {
const backstageUser = await defaultUserTransformer(graphUser, userPhoto);
if (backstageUser) {
backstageUser.metadata.description = 'Loaded from Azure Active Directory';
}
return backstageUser;
}
// Example organization transformer that removes the organization group completely
export async function myOrganizationTransformer(
graphOrganization: MicrosoftGraph.Organization,
): Promise<GroupEntity | undefined> {
return undefined;
}
```
## Troubleshooting
### Authentication / Token Errors
See [Troubleshooting Azure Identity Authentication Issues](https://aka.ms/azsdk/js/identity/troubleshoot)
### Error while reading users from Microsoft Graph: Authorization_RequestDenied - Insufficient privileges to complete the operation.
- Make sure you've granted all the required permissions to your application registration or managed identity
- Make sure the permissions are `Application` permissions rather than `Delegated`
- If your organization has configured "Admin consent" to be required, make sure this has been granted for your application permissions
- If your group queries are returning Microsoft Teams groups, you may need to grant addition permissions (e.g. `Team.ReadBasic.All`, `TeamMember.Read.All`)
- If you've added additional `select` or `expand` fields, those may need additional permissions granted
+1 -1
View File
@@ -74,7 +74,7 @@ The extension type is a simple one:
```ts
export type Extension<T> = {
expose(plugin: BackstagePlugin<any, any>): T;
expose(plugin: BackstagePlugin): T;
};
```
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -16,7 +16,7 @@
"lock:check": "yarn-lock-check"
},
"devDependencies": {
"@spotify/prettier-config": "^13.0.1",
"@spotify/prettier-config": "^14.0.0",
"docusaurus": "^2.0.0-alpha.70",
"js-yaml": "^4.1.0",
"prettier": "^2.6.2",
+4 -4
View File
@@ -909,10 +909,10 @@
resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==
"@spotify/prettier-config@^13.0.1":
version "13.0.1"
resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-13.0.1.tgz#0fdceb3d4ab543259ce6adc0ec1d10e34898b812"
integrity sha512-oVd4hjx2+y0MeUdk1l+ItwVLwlrDlvTlGwXBWMMzPYc7DLyxuxFvDfoHGkAQkrikfAgtdnzxrW6u9a8ywUqdfw==
"@spotify/prettier-config@^14.0.0":
version "14.0.1"
resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-14.0.1.tgz#a3a2342ec07693647ab76a64a623fbb79d464fa7"
integrity sha512-NHT7IpIVOsAMhPfDVf1S/jfq59j7d2ru3XoU9An/Aqy9MDr/ZmAvQEAPFiz+qlm41xEGkNK34yEi71LC03G2oA==
"@types/cheerio@^0.22.8":
version "0.22.23"
+3 -3
View File
@@ -49,7 +49,7 @@
"@types/react": "^17",
"@types/react-dom": "^17"
},
"version": "1.4.0-next.2",
"version": "1.4.0-next.3",
"dependencies": {
"@manypkg/get-packages": "^1.1.3",
"@microsoft/api-documenter": "^7.17.11",
@@ -59,8 +59,8 @@
},
"devDependencies": {
"@changesets/cli": "^2.14.0",
"@octokit/rest": "^18.12.0",
"@spotify/prettier-config": "^13.0.0",
"@octokit/rest": "^19.0.3",
"@spotify/prettier-config": "^14.0.0",
"@types/node": "^16.11.26",
"@types/webpack": "^5.28.0",
"command-exists": "^1.2.9",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/app-defaults
## 1.0.4-next.3
### Patch Changes
- 881fc75a75: Internal tweak removing usage of explicit type parameters for the `BackstagePlugin` type.
- Updated dependencies
- @backstage/core-app-api@1.0.4-next.1
- @backstage/core-plugin-api@1.0.4-next.0
- @backstage/core-components@0.10.0-next.3
- @backstage/plugin-permission-react@0.4.3-next.1
## 1.0.4-next.2
### Patch Changes
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/app-defaults",
"description": "Provides the default wiring of a Backstage App",
"version": "1.0.4-next.2",
"version": "1.0.4-next.3",
"private": false,
"publishConfig": {
"access": "public",
@@ -33,10 +33,10 @@
"start": "backstage-cli package start"
},
"dependencies": {
"@backstage/core-components": "^0.10.0-next.2",
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/plugin-permission-react": "^0.4.3-next.0",
"@backstage/core-components": "^0.10.0-next.3",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/plugin-permission-react": "^0.4.3-next.1",
"@backstage/theme": "^0.2.16-next.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -46,8 +46,8 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/test-utils": "^1.1.2-next.2",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@types/jest": "^26.0.7",
+1 -1
View File
@@ -50,7 +50,7 @@ export function createApp(
...icons,
...options?.icons,
},
plugins: (options?.plugins as BackstagePlugin<any, any>[]) ?? [],
plugins: (options?.plugins as BackstagePlugin[]) ?? [],
themes: options?.themes ?? themes,
});
}
+57
View File
@@ -1,5 +1,62 @@
# example-app
## 0.2.73-next.3
### Patch Changes
- Updated dependencies
- @backstage/plugin-code-coverage@0.2.0-next.3
- @backstage/plugin-scaffolder@1.4.0-next.3
- @backstage/plugin-kubernetes@0.7.0-next.3
- @backstage/plugin-tech-radar@0.5.14-next.3
- @backstage/plugin-newrelic-dashboard@0.2.0-next.3
- @backstage/app-defaults@1.0.4-next.3
- @backstage/core-app-api@1.0.4-next.1
- @backstage/core-plugin-api@1.0.4-next.0
- @backstage/core-components@0.10.0-next.3
- @backstage/plugin-sentry@0.4.0-next.3
- @backstage/cli@0.18.0-next.3
- @backstage/integration-react@1.1.2-next.3
- @backstage/plugin-airbrake@0.3.7-next.3
- @backstage/plugin-apache-airflow@0.2.0-next.3
- @backstage/plugin-api-docs@0.8.7-next.3
- @backstage/plugin-azure-devops@0.1.23-next.3
- @backstage/plugin-badges@0.2.31-next.3
- @backstage/plugin-catalog-import@0.8.10-next.3
- @backstage/plugin-circleci@0.3.7-next.3
- @backstage/plugin-cloudbuild@0.3.7-next.3
- @backstage/plugin-cost-insights@0.11.29-next.3
- @backstage/plugin-dynatrace@0.1.1-next.3
- @backstage/plugin-explore@0.3.38-next.3
- @backstage/plugin-gcalendar@0.3.3-next.3
- @backstage/plugin-gcp-projects@0.3.26-next.3
- @backstage/plugin-github-actions@0.5.7-next.3
- @backstage/plugin-gocd@0.1.13-next.3
- @backstage/plugin-graphiql@0.2.39-next.3
- @backstage/plugin-home@0.4.23-next.3
- @backstage/plugin-jenkins@0.7.6-next.3
- @backstage/plugin-kafka@0.3.7-next.3
- @backstage/plugin-lighthouse@0.3.7-next.3
- @backstage/plugin-newrelic@0.3.25-next.3
- @backstage/plugin-org@0.5.7-next.3
- @backstage/plugin-pagerduty@0.5.0-next.3
- @backstage/plugin-rollbar@0.4.7-next.3
- @backstage/plugin-search@0.9.1-next.3
- @backstage/plugin-shortcuts@0.2.8-next.3
- @backstage/plugin-stack-overflow@0.1.3-next.3
- @backstage/plugin-tech-insights@0.2.3-next.3
- @backstage/plugin-techdocs-module-addons-contrib@1.0.2-next.3
- @backstage/plugin-techdocs@1.2.1-next.3
- @backstage/plugin-todo@0.2.9-next.3
- @backstage/plugin-user-settings@0.4.6-next.3
- @backstage/catalog-model@1.1.0-next.3
- @backstage/plugin-catalog-react@1.1.2-next.3
- @backstage/plugin-catalog@1.4.0-next.3
- @backstage/plugin-catalog-graph@0.2.19-next.3
- @backstage/plugin-permission-react@0.4.3-next.1
- @backstage/plugin-search-react@0.2.2-next.3
- @backstage/plugin-techdocs-react@1.0.2-next.2
## 0.2.73-next.2
### Patch Changes
+54 -54
View File
@@ -1,71 +1,71 @@
{
"name": "example-app",
"version": "0.2.73-next.2",
"version": "0.2.73-next.3",
"private": true,
"backstage": {
"role": "frontend"
},
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^1.0.4-next.2",
"@backstage/catalog-model": "^1.1.0-next.2",
"@backstage/cli": "^0.18.0-next.2",
"@backstage/app-defaults": "^1.0.4-next.3",
"@backstage/catalog-model": "^1.1.0-next.3",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/config": "^1.0.1",
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/core-components": "^0.10.0-next.2",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/integration-react": "^1.1.2-next.2",
"@backstage/plugin-airbrake": "^0.3.7-next.2",
"@backstage/plugin-api-docs": "^0.8.7-next.2",
"@backstage/plugin-azure-devops": "^0.1.23-next.2",
"@backstage/plugin-apache-airflow": "^0.2.0-next.2",
"@backstage/plugin-badges": "^0.2.31-next.2",
"@backstage/plugin-catalog": "^1.4.0-next.2",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/core-components": "^0.10.0-next.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/integration-react": "^1.1.2-next.3",
"@backstage/plugin-airbrake": "^0.3.7-next.3",
"@backstage/plugin-api-docs": "^0.8.7-next.3",
"@backstage/plugin-azure-devops": "^0.1.23-next.3",
"@backstage/plugin-apache-airflow": "^0.2.0-next.3",
"@backstage/plugin-badges": "^0.2.31-next.3",
"@backstage/plugin-catalog": "^1.4.0-next.3",
"@backstage/plugin-catalog-common": "^1.0.4-next.0",
"@backstage/plugin-catalog-graph": "^0.2.19-next.2",
"@backstage/plugin-catalog-import": "^0.8.10-next.2",
"@backstage/plugin-catalog-react": "^1.1.2-next.2",
"@backstage/plugin-circleci": "^0.3.7-next.2",
"@backstage/plugin-cloudbuild": "^0.3.7-next.2",
"@backstage/plugin-code-coverage": "^0.1.34-next.2",
"@backstage/plugin-cost-insights": "^0.11.29-next.2",
"@backstage/plugin-dynatrace": "^0.1.1-next.2",
"@backstage/plugin-explore": "^0.3.38-next.2",
"@backstage/plugin-gcalendar": "^0.3.3-next.2",
"@backstage/plugin-gcp-projects": "^0.3.26-next.2",
"@backstage/plugin-github-actions": "^0.5.7-next.2",
"@backstage/plugin-gocd": "^0.1.13-next.2",
"@backstage/plugin-graphiql": "^0.2.39-next.2",
"@backstage/plugin-home": "^0.4.23-next.2",
"@backstage/plugin-jenkins": "^0.7.6-next.2",
"@backstage/plugin-kafka": "^0.3.7-next.2",
"@backstage/plugin-kubernetes": "^0.6.7-next.2",
"@backstage/plugin-lighthouse": "^0.3.7-next.2",
"@backstage/plugin-newrelic": "^0.3.25-next.2",
"@backstage/plugin-newrelic-dashboard": "^0.1.15-next.2",
"@backstage/plugin-org": "^0.5.7-next.2",
"@backstage/plugin-pagerduty": "0.5.0-next.2",
"@backstage/plugin-permission-react": "^0.4.3-next.0",
"@backstage/plugin-rollbar": "^0.4.7-next.2",
"@backstage/plugin-scaffolder": "^1.4.0-next.2",
"@backstage/plugin-search": "^0.9.1-next.2",
"@backstage/plugin-search-react": "^0.2.2-next.2",
"@backstage/plugin-catalog-graph": "^0.2.19-next.3",
"@backstage/plugin-catalog-import": "^0.8.10-next.3",
"@backstage/plugin-catalog-react": "^1.1.2-next.3",
"@backstage/plugin-circleci": "^0.3.7-next.3",
"@backstage/plugin-cloudbuild": "^0.3.7-next.3",
"@backstage/plugin-code-coverage": "^0.2.0-next.3",
"@backstage/plugin-cost-insights": "^0.11.29-next.3",
"@backstage/plugin-dynatrace": "^0.1.1-next.3",
"@backstage/plugin-explore": "^0.3.38-next.3",
"@backstage/plugin-gcalendar": "^0.3.3-next.3",
"@backstage/plugin-gcp-projects": "^0.3.26-next.3",
"@backstage/plugin-github-actions": "^0.5.7-next.3",
"@backstage/plugin-gocd": "^0.1.13-next.3",
"@backstage/plugin-graphiql": "^0.2.39-next.3",
"@backstage/plugin-home": "^0.4.23-next.3",
"@backstage/plugin-jenkins": "^0.7.6-next.3",
"@backstage/plugin-kafka": "^0.3.7-next.3",
"@backstage/plugin-kubernetes": "^0.7.0-next.3",
"@backstage/plugin-lighthouse": "^0.3.7-next.3",
"@backstage/plugin-newrelic": "^0.3.25-next.3",
"@backstage/plugin-newrelic-dashboard": "^0.2.0-next.3",
"@backstage/plugin-org": "^0.5.7-next.3",
"@backstage/plugin-pagerduty": "0.5.0-next.3",
"@backstage/plugin-permission-react": "^0.4.3-next.1",
"@backstage/plugin-rollbar": "^0.4.7-next.3",
"@backstage/plugin-scaffolder": "^1.4.0-next.3",
"@backstage/plugin-search": "^0.9.1-next.3",
"@backstage/plugin-search-react": "^0.2.2-next.3",
"@backstage/plugin-search-common": "^0.3.6-next.0",
"@backstage/plugin-sentry": "^0.3.45-next.2",
"@backstage/plugin-shortcuts": "^0.2.8-next.2",
"@backstage/plugin-stack-overflow": "^0.1.3-next.2",
"@backstage/plugin-tech-radar": "^0.5.14-next.2",
"@backstage/plugin-techdocs": "^1.2.1-next.2",
"@backstage/plugin-techdocs-react": "^1.0.2-next.1",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.0.2-next.2",
"@backstage/plugin-todo": "^0.2.9-next.2",
"@backstage/plugin-user-settings": "^0.4.6-next.2",
"@backstage/plugin-tech-insights": "^0.2.3-next.2",
"@backstage/plugin-sentry": "^0.4.0-next.3",
"@backstage/plugin-shortcuts": "^0.2.8-next.3",
"@backstage/plugin-stack-overflow": "^0.1.3-next.3",
"@backstage/plugin-tech-radar": "^0.5.14-next.3",
"@backstage/plugin-techdocs": "^1.2.1-next.3",
"@backstage/plugin-techdocs-react": "^1.0.2-next.2",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.0.2-next.3",
"@backstage/plugin-todo": "^0.2.9-next.3",
"@backstage/plugin-user-settings": "^0.4.6-next.3",
"@backstage/plugin-tech-insights": "^0.2.3-next.3",
"@backstage/theme": "^0.2.16-next.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
"@octokit/rest": "^18.5.3",
"@octokit/rest": "^19.0.3",
"@roadiehq/backstage-plugin-buildkite": "^2.0.0",
"@roadiehq/backstage-plugin-github-insights": "^2.0.0",
"@roadiehq/backstage-plugin-github-pull-requests": "^2.0.0",
@@ -81,7 +81,7 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/test-utils": "^1.1.2-next.2",
"@rjsf/core": "^3.2.1",
"@testing-library/cypress": "^8.0.2",
"@testing-library/jest-dom": "^5.10.1",
+17
View File
@@ -0,0 +1,17 @@
# @backstage/backend-app-api
## 0.1.0-next.0
### Minor Changes
- 91c1d12123: Add initial plumbing for creating backends using the experimental backend framework.
This package is highly **EXPERIMENTAL** and should not be used in production.
### Patch Changes
- Updated dependencies
- @backstage/backend-plugin-api@0.1.0-next.0
- @backstage/backend-common@0.14.1-next.3
- @backstage/plugin-permission-node@0.6.3-next.2
- @backstage/backend-tasks@0.3.3-next.3
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-app-api",
"description": "Core API used by Backstage backend apps",
"version": "0.0.0",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -34,16 +34,16 @@
"start": "backstage-cli package start"
},
"dependencies": {
"@backstage/backend-plugin-api": "^0.0.0",
"@backstage/backend-common": "^0.14.1-next.2",
"@backstage/backend-tasks": "^0.3.3-next.2",
"@backstage/plugin-permission-node": "^0.6.3-next.1",
"@backstage/backend-plugin-api": "^0.1.0-next.0",
"@backstage/backend-common": "^0.14.1-next.3",
"@backstage/backend-tasks": "^0.3.3-next.3",
"@backstage/plugin-permission-node": "^0.6.3-next.2",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2"
"@backstage/cli": "^0.18.0-next.3"
},
"files": [
"dist",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/backend-common
## 0.14.1-next.3
### Patch Changes
- 90c87f28e8: Moving from Bitbucket Server endpoint from https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp222 to https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp224, to have the last commit in function of different branch, and not only the list of default branch
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- 4e9a90e307: Updated dependency `luxon` to `^3.0.0`.
- Updated dependencies
- @backstage/config-loader@1.1.3-next.1
- @backstage/integration@1.2.2-next.3
## 0.14.1-next.2
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-common",
"description": "Common functionality library for Backstage backends",
"version": "0.14.1-next.2",
"version": "0.14.1-next.3",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -36,13 +36,13 @@
"dependencies": {
"@backstage/cli-common": "^0.1.9",
"@backstage/config": "^1.0.1",
"@backstage/config-loader": "^1.1.3-next.0",
"@backstage/config-loader": "^1.1.3-next.1",
"@backstage/errors": "^1.1.0-next.0",
"@backstage/integration": "^1.2.2-next.2",
"@backstage/integration": "^1.2.2-next.3",
"@backstage/types": "^1.0.0",
"@google-cloud/storage": "^6.0.0",
"@manypkg/get-packages": "^1.1.3",
"@octokit/rest": "^18.5.3",
"@octokit/rest": "^19.0.3",
"@types/cors": "^2.8.6",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
@@ -68,7 +68,7 @@
"knex": "^2.0.0",
"lodash": "^4.17.21",
"logform": "^2.3.2",
"luxon": "^2.3.1",
"luxon": "^3.0.0",
"minimatch": "^5.0.0",
"minimist": "^1.2.5",
"morgan": "^1.10.0",
@@ -91,8 +91,8 @@
}
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.26-next.2",
"@backstage/cli": "^0.18.0-next.2",
"@backstage/backend-test-utils": "^0.1.26-next.3",
"@backstage/cli": "^0.18.0-next.3",
"@types/archiver": "^5.1.0",
"@types/base64-stream": "^1.0.2",
"@types/compression": "^1.7.0",
@@ -112,7 +112,7 @@
"better-sqlite3": "^7.5.0",
"http-errors": "^2.0.0",
"mock-fs": "^5.1.0",
"msw": "^0.43.0",
"msw": "^0.44.0",
"mysql2": "^2.2.5",
"recursive-readdir": "^2.2.2",
"supertest": "^6.1.3"
@@ -83,13 +83,11 @@ describe('BitbucketServerUrlReader', () => {
),
),
rest.get(
'https://api.bitbucket.mycompany.net/rest/api/1.0/projects/backstage/repos/mock/commits',
'https://api.bitbucket.mycompany.net/rest/api/1.0/projects/backstage/repos/mock/commits/*',
(_, res, ctx) =>
res(
ctx.status(200),
ctx.json({
values: [{ id: '12ab34cd56ef78gh90ij12kl34mn56op78qr90st' }],
}),
ctx.json({ id: '12ab34cd56ef78gh90ij12kl34mn56op78qr90st' }),
),
),
);
@@ -132,13 +130,11 @@ describe('BitbucketServerUrlReader', () => {
),
),
rest.get(
'https://api.bitbucket.mycompany.net/rest/api/1.0/projects/backstage/repos/mock/commits',
'https://api.bitbucket.mycompany.net/rest/api/1.0/projects/backstage/repos/mock/commits/*',
(_, res, ctx) =>
res(
ctx.status(200),
ctx.json({
values: [{ id: '12ab34cd56ef78gh90ij12kl34mn56op78qr90st' }],
}),
ctx.json({ id: '12ab34cd56ef78gh90ij12kl34mn56op78qr90st' }),
),
),
);
@@ -186,33 +186,29 @@ export class BitbucketServerUrlReader implements UrlReader {
}
private async getLastCommitShortHash(url: string): Promise<string> {
const { name: repoName, owner: project } = parseGitUrl(url);
const { name: repoName, owner: project, ref: branch } = parseGitUrl(url);
// Bitbucket Server https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp222
const commitsApiUrl = `${this.integration.config.apiBaseUrl}/projects/${project}/repos/${repoName}/commits`;
// Bitbucket Server https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp224
const commitApiUrl = `${this.integration.config.apiBaseUrl}/projects/${project}/repos/${repoName}/commits/${branch}`;
const commitsResponse = await fetch(
commitsApiUrl,
const commitResponse = await fetch(
commitApiUrl,
getBitbucketServerRequestOptions(this.integration.config),
);
if (!commitsResponse.ok) {
const message = `Failed to retrieve commits from ${commitsApiUrl}, ${commitsResponse.status} ${commitsResponse.statusText}`;
if (commitsResponse.status === 404) {
if (!commitResponse.ok) {
const message = `Failed to retrieve commits from ${commitApiUrl}, ${commitResponse.status} ${commitResponse.statusText}`;
if (commitResponse.status === 404) {
throw new NotFoundError(message);
}
throw new Error(message);
}
const commits = await commitsResponse.json();
if (
commits &&
commits.values &&
commits.values.length > 0 &&
commits.values[0].id
) {
return commits.values[0].id.substring(0, 12);
const commits = await commitResponse.json();
if (commits && commits.id) {
return commits.id.substring(0, 12);
}
throw new Error(`Failed to read response from ${commitsApiUrl}`);
throw new Error(`Failed to read response from ${commitApiUrl}`);
}
}
@@ -16,6 +16,7 @@
import {
getGitLabFileFetchUrl,
getGitLabIntegrationRelativePath,
getGitLabRequestOptions,
GitLabIntegration,
ScmIntegrations,
@@ -37,7 +38,7 @@ import {
ReadUrlResponse,
ReadUrlOptions,
} from './types';
import { trimEnd } from 'lodash';
import { trimEnd, trimStart } from 'lodash';
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
/**
@@ -117,13 +118,24 @@ export class GitlabUrlReader implements UrlReader {
const { etag, signal } = options ?? {};
const { ref, full_name, filepath } = parseGitUrl(url);
let repoFullName = full_name;
const relativePath = getGitLabIntegrationRelativePath(
this.integration.config,
);
// Considering self hosted gitlab with relative
if (relativePath) {
repoFullName = trimStart(full_name, relativePath);
}
// Use GitLab API to get the default branch
// encodeURIComponent is required for GitLab API
// https://docs.gitlab.com/ee/api/README.html#namespaced-path-encoding
const projectGitlabResponse = await fetch(
new URL(
`${this.integration.config.apiBaseUrl}/projects/${encodeURIComponent(
full_name,
repoFullName,
)}`,
).toString(),
getGitLabRequestOptions(this.integration.config),
@@ -150,7 +162,7 @@ export class GitlabUrlReader implements UrlReader {
const commitsGitlabResponse = await fetch(
new URL(
`${this.integration.config.apiBaseUrl}/projects/${encodeURIComponent(
full_name,
repoFullName,
)}/repository/commits?${commitsReqParams.toString()}`,
).toString(),
{
@@ -181,7 +193,7 @@ export class GitlabUrlReader implements UrlReader {
// https://docs.gitlab.com/ee/api/repositories.html#get-file-archive
const archiveGitLabResponse = await fetch(
`${this.integration.config.apiBaseUrl}/projects/${encodeURIComponent(
full_name,
repoFullName,
)}/repository/archive?sha=${branch}`,
{
...getGitLabRequestOptions(this.integration.config),
+10
View File
@@ -0,0 +1,10 @@
# example-backend-next
## 0.0.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-catalog-backend@1.3.0-next.3
- @backstage/plugin-scaffolder-backend@1.4.0-next.3
- @backstage/backend-app-api@0.1.0-next.0
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "example-backend-next",
"version": "0.0.0",
"version": "0.0.1-next.0",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -25,12 +25,12 @@
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/backend-app-api": "^0.0.0",
"@backstage/plugin-catalog-backend": "^1.2.1-next.2",
"@backstage/plugin-scaffolder-backend": "^1.4.0-next.2"
"@backstage/backend-app-api": "^0.1.0-next.0",
"@backstage/plugin-catalog-backend": "^1.3.0-next.3",
"@backstage/plugin-scaffolder-backend": "^1.4.0-next.3"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2"
"@backstage/cli": "^0.18.0-next.3"
},
"files": [
"dist"
+15
View File
@@ -0,0 +1,15 @@
# @backstage/backend-plugin-api
## 0.1.0-next.0
### Minor Changes
- 91c1d12123: Introduced new package for creating backend plugins using the new alpha backend plugin framework.
This package is still considered **EXPERIMENTAL** and things will change without warning. Do not use this for production.
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.14.1-next.3
- @backstage/plugin-permission-common@0.6.3-next.1
- @backstage/backend-tasks@0.3.3-next.3
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-plugin-api",
"description": "Core API used by Backstage backend plugins",
"version": "0.0.0",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -35,16 +35,16 @@
},
"dependencies": {
"@backstage/config": "^1.0.1",
"@backstage/backend-common": "^0.14.1-next.2",
"@backstage/plugin-permission-common": "^0.6.3-next.0",
"@backstage/backend-tasks": "^0.3.3-next.2",
"@backstage/backend-common": "^0.14.1-next.3",
"@backstage/plugin-permission-common": "^0.6.3-next.1",
"@backstage/backend-tasks": "^0.3.3-next.3",
"@types/express": "^4.17.6",
"express": "^4.17.1",
"winston": "^3.2.1",
"winston-transport": "^4.5.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2"
"@backstage/cli": "^0.18.0-next.3"
},
"files": [
"dist",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/backend-tasks
## 0.3.3-next.3
### Patch Changes
- 4e9a90e307: Updated dependency `luxon` to `^3.0.0`.
- Updated dependencies
- @backstage/backend-common@0.14.1-next.3
## 0.3.3-next.2
### Patch Changes
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-tasks",
"description": "Common distributed task management library for Backstage backends",
"version": "0.3.3-next.2",
"version": "0.3.3-next.3",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -33,7 +33,7 @@
"start": "backstage-cli package start"
},
"dependencies": {
"@backstage/backend-common": "^0.14.1-next.2",
"@backstage/backend-common": "^0.14.1-next.3",
"@backstage/config": "^1.0.1",
"@backstage/errors": "^1.1.0-next.0",
"@backstage/types": "^1.0.0",
@@ -41,15 +41,15 @@
"cron": "^2.0.0",
"knex": "^2.0.0",
"lodash": "^4.17.21",
"luxon": "^2.0.2",
"luxon": "^3.0.0",
"node-abort-controller": "^3.0.1",
"uuid": "^8.0.0",
"winston": "^3.2.1",
"zod": "^3.9.5"
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.26-next.2",
"@backstage/cli": "^0.18.0-next.2",
"@backstage/backend-test-utils": "^0.1.26-next.3",
"@backstage/cli": "^0.18.0-next.3",
"@types/cron": "^2.0.0",
"wait-for-expect": "^3.0.2"
},
+9
View File
@@ -1,5 +1,14 @@
# @backstage/backend-test-utils
## 0.1.26-next.3
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- Updated dependencies
- @backstage/backend-common@0.14.1-next.3
- @backstage/cli@0.18.0-next.3
## 0.1.26-next.2
### Patch Changes
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-test-utils",
"description": "Test helpers library for Backstage backends",
"version": "0.1.26-next.2",
"version": "0.1.26-next.3",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -34,19 +34,19 @@
"start": "backstage-cli package start"
},
"dependencies": {
"@backstage/backend-common": "^0.14.1-next.2",
"@backstage/cli": "^0.18.0-next.2",
"@backstage/backend-common": "^0.14.1-next.3",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/config": "^1.0.1",
"better-sqlite3": "^7.5.0",
"knex": "^2.0.0",
"msw": "^0.43.0",
"msw": "^0.44.0",
"mysql2": "^2.2.5",
"pg": "^8.3.0",
"testcontainers": "^8.1.2",
"uuid": "^8.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2"
"@backstage/cli": "^0.18.0-next.3"
},
"files": [
"dist"
+35
View File
@@ -1,5 +1,40 @@
# example-backend
## 0.2.73-next.3
### Patch Changes
- Updated dependencies
- @backstage/plugin-code-coverage-backend@0.2.0-next.3
- @backstage/plugin-catalog-backend@1.3.0-next.3
- @backstage/plugin-kubernetes-backend@0.7.0-next.3
- @backstage/plugin-proxy-backend@0.2.28-next.1
- @backstage/backend-common@0.14.1-next.3
- @backstage/plugin-scaffolder-backend@1.4.0-next.3
- @backstage/catalog-client@1.0.4-next.2
- @backstage/integration@1.2.2-next.3
- @backstage/plugin-app-backend@0.3.34-next.3
- @backstage/plugin-auth-backend@0.15.0-next.3
- @backstage/plugin-auth-node@0.2.3-next.2
- @backstage/plugin-azure-devops-backend@0.3.13-next.1
- @backstage/plugin-graphql-backend@0.1.24-next.1
- @backstage/plugin-jenkins-backend@0.1.24-next.3
- @backstage/plugin-permission-backend@0.5.9-next.2
- @backstage/plugin-permission-common@0.6.3-next.1
- @backstage/plugin-permission-node@0.6.3-next.2
- @backstage/plugin-rollbar-backend@0.1.31-next.1
- @backstage/plugin-techdocs-backend@1.2.0-next.3
- @backstage/plugin-todo-backend@0.1.31-next.2
- @backstage/backend-tasks@0.3.3-next.3
- @backstage/plugin-tech-insights-backend-module-jsonfc@0.1.18-next.2
- @backstage/plugin-tech-insights-backend@0.5.0-next.3
- @backstage/plugin-tech-insights-node@0.3.2-next.1
- @backstage/catalog-model@1.1.0-next.3
- @backstage/plugin-search-backend-module-elasticsearch@0.2.0-next.2
- @backstage/plugin-search-backend-node@0.6.3-next.2
- @backstage/plugin-search-backend@0.5.4-next.2
- example-app@0.2.73-next.3
## 0.2.73-next.2
### Patch Changes
+32 -32
View File
@@ -1,6 +1,6 @@
{
"name": "example-backend",
"version": "0.2.73-next.2",
"version": "0.2.73-next.3",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -26,41 +26,41 @@
"build-image": "docker build ../.. -f Dockerfile --tag example-backend"
},
"dependencies": {
"@backstage/backend-common": "^0.14.1-next.2",
"@backstage/backend-tasks": "^0.3.3-next.2",
"@backstage/catalog-client": "^1.0.4-next.1",
"@backstage/catalog-model": "^1.1.0-next.2",
"@backstage/backend-common": "^0.14.1-next.3",
"@backstage/backend-tasks": "^0.3.3-next.3",
"@backstage/catalog-client": "^1.0.4-next.2",
"@backstage/catalog-model": "^1.1.0-next.3",
"@backstage/config": "^1.0.1",
"@backstage/integration": "^1.2.2-next.2",
"@backstage/plugin-app-backend": "^0.3.34-next.2",
"@backstage/plugin-auth-backend": "^0.15.0-next.2",
"@backstage/plugin-auth-node": "^0.2.3-next.1",
"@backstage/plugin-azure-devops-backend": "^0.3.13-next.0",
"@backstage/integration": "^1.2.2-next.3",
"@backstage/plugin-app-backend": "^0.3.34-next.3",
"@backstage/plugin-auth-backend": "^0.15.0-next.3",
"@backstage/plugin-auth-node": "^0.2.3-next.2",
"@backstage/plugin-azure-devops-backend": "^0.3.13-next.1",
"@backstage/plugin-badges-backend": "^0.1.28-next.2",
"@backstage/plugin-catalog-backend": "^1.2.1-next.2",
"@backstage/plugin-code-coverage-backend": "^0.1.32-next.2",
"@backstage/plugin-graphql-backend": "^0.1.24-next.0",
"@backstage/plugin-jenkins-backend": "^0.1.24-next.2",
"@backstage/plugin-kubernetes-backend": "^0.7.0-next.2",
"@backstage/plugin-catalog-backend": "^1.3.0-next.3",
"@backstage/plugin-code-coverage-backend": "^0.2.0-next.3",
"@backstage/plugin-graphql-backend": "^0.1.24-next.1",
"@backstage/plugin-jenkins-backend": "^0.1.24-next.3",
"@backstage/plugin-kubernetes-backend": "^0.7.0-next.3",
"@backstage/plugin-kafka-backend": "^0.2.27-next.2",
"@backstage/plugin-permission-backend": "^0.5.9-next.1",
"@backstage/plugin-permission-common": "^0.6.3-next.0",
"@backstage/plugin-permission-node": "^0.6.3-next.1",
"@backstage/plugin-proxy-backend": "^0.2.28-next.0",
"@backstage/plugin-rollbar-backend": "^0.1.31-next.0",
"@backstage/plugin-scaffolder-backend": "^1.4.0-next.2",
"@backstage/plugin-permission-backend": "^0.5.9-next.2",
"@backstage/plugin-permission-common": "^0.6.3-next.1",
"@backstage/plugin-permission-node": "^0.6.3-next.2",
"@backstage/plugin-proxy-backend": "^0.2.28-next.1",
"@backstage/plugin-rollbar-backend": "^0.1.31-next.1",
"@backstage/plugin-scaffolder-backend": "^1.4.0-next.3",
"@backstage/plugin-scaffolder-backend-module-rails": "^0.4.2-next.1",
"@backstage/plugin-search-backend": "^0.5.4-next.1",
"@backstage/plugin-search-backend-node": "^0.6.3-next.1",
"@backstage/plugin-search-backend-module-elasticsearch": "^0.2.0-next.1",
"@backstage/plugin-search-backend": "^0.5.4-next.2",
"@backstage/plugin-search-backend-node": "^0.6.3-next.2",
"@backstage/plugin-search-backend-module-elasticsearch": "^0.2.0-next.2",
"@backstage/plugin-search-backend-module-pg": "^0.3.5-next.2",
"@backstage/plugin-techdocs-backend": "^1.2.0-next.2",
"@backstage/plugin-tech-insights-backend": "^0.5.0-next.2",
"@backstage/plugin-tech-insights-node": "^0.3.2-next.0",
"@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.18-next.1",
"@backstage/plugin-todo-backend": "^0.1.31-next.1",
"@backstage/plugin-techdocs-backend": "^1.2.0-next.3",
"@backstage/plugin-tech-insights-backend": "^0.5.0-next.3",
"@backstage/plugin-tech-insights-node": "^0.3.2-next.1",
"@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.18-next.2",
"@backstage/plugin-todo-backend": "^0.1.31-next.2",
"@gitbeaker/node": "^35.1.0",
"@octokit/rest": "^18.5.3",
"@octokit/rest": "^19.0.3",
"better-sqlite3": "^7.5.0",
"azure-devops-node-api": "^11.0.1",
"dockerode": "^3.3.1",
@@ -68,14 +68,14 @@
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"express-prom-bundle": "^6.3.6",
"luxon": "^2.0.2",
"luxon": "^3.0.0",
"pg": "^8.3.0",
"pg-connection-string": "^2.3.0",
"prom-client": "^14.0.1",
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/cli": "^0.18.0-next.3",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/catalog-client
## 1.0.4-next.2
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- Updated dependencies
- @backstage/catalog-model@1.1.0-next.3
## 1.0.4-next.1
### Patch Changes
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/catalog-client",
"description": "An isomorphic client for the catalog backend",
"version": "1.0.4-next.1",
"version": "1.0.4-next.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -33,14 +33,14 @@
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/catalog-model": "^1.1.0-next.1",
"@backstage/catalog-model": "^1.1.0-next.3",
"@backstage/errors": "^1.1.0-next.0",
"cross-fetch": "^3.1.5"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@types/jest": "^26.0.7",
"msw": "^0.43.0"
"msw": "^0.44.0"
},
"files": [
"dist"
+6
View File
@@ -1,5 +1,11 @@
# @backstage/catalog-model
## 1.1.0-next.3
### Patch Changes
- 72622d9143: Updated dependency `yaml` to `^2.0.0`.
## 1.1.0-next.2
### Minor Changes
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/catalog-model",
"description": "Types and validators that help describe the model of a Backstage Catalog",
"version": "1.1.0-next.2",
"version": "1.1.0-next.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -43,7 +43,7 @@
"uuid": "^8.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/cli": "^0.18.0-next.3",
"@types/jest": "^26.0.7",
"@types/json-schema": "^7.0.5",
"@types/lodash": "^4.14.151",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/cli
## 0.18.0-next.3
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- 72622d9143: Updated dependency `yaml` to `^2.0.0`.
- e662b573cf: Updated dependency `@octokit/request` to `^6.0.0`.
- Updated dependencies
- @backstage/config-loader@1.1.3-next.1
- @backstage/release-manifests@0.0.5-next.0
## 0.18.0-next.2
### Patch Changes
+13 -13
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/cli",
"description": "CLI for developing Backstage plugins and apps",
"version": "0.18.0-next.2",
"version": "0.18.0-next.3",
"private": false,
"publishConfig": {
"access": "public"
@@ -33,9 +33,9 @@
"dependencies": {
"@backstage/cli-common": "^0.1.9",
"@backstage/config": "^1.0.1",
"@backstage/config-loader": "^1.1.3-next.0",
"@backstage/config-loader": "^1.1.3-next.1",
"@backstage/errors": "^1.1.0-next.0",
"@backstage/release-manifests": "^0.0.4",
"@backstage/release-manifests": "^0.0.5-next.0",
"@backstage/types": "^1.0.0",
"@hot-loader/react-dom-v16": "npm:@hot-loader/react-dom@^16.0.2",
"@hot-loader/react-dom-v17": "npm:@hot-loader/react-dom@^17.0.2",
@@ -45,9 +45,9 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-yaml": "^3.1.0",
"@spotify/eslint-config-base": "^13.0.0",
"@spotify/eslint-config-react": "^13.0.0",
"@spotify/eslint-config-typescript": "^13.0.0",
"@spotify/eslint-config-base": "^14.0.0",
"@spotify/eslint-config-react": "^14.0.0",
"@spotify/eslint-config-typescript": "^14.0.0",
"@sucrase/jest-plugin": "^2.1.1",
"@sucrase/webpack-loader": "^2.0.0",
"@svgr/plugin-jsx": "6.2.x",
@@ -126,13 +126,13 @@
"zod": "^3.11.6"
},
"devDependencies": {
"@backstage/backend-common": "^0.14.1-next.2",
"@backstage/backend-common": "^0.14.1-next.3",
"@backstage/config": "^1.0.1",
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/core-components": "^0.10.0-next.2",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/dev-utils": "^1.0.4-next.2",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/core-components": "^0.10.0-next.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/dev-utils": "^1.0.4-next.3",
"@backstage/test-utils": "^1.1.2-next.2",
"@backstage/theme": "^0.2.16-next.1",
"@types/diff": "^5.0.0",
"@types/express": "^4.17.6",
@@ -152,7 +152,7 @@
"@types/yarnpkg__lockfile": "^1.1.4",
"del": "^6.0.0",
"mock-fs": "^5.1.0",
"msw": "^0.43.0",
"msw": "^0.44.0",
"nodemon": "^2.0.2",
"ts-node": "^10.0.0"
},
@@ -41,7 +41,7 @@
"@backstage/cli": "{{versionQuery '@backstage/cli'}}",
"@types/supertest": "{{versionQuery '@types/supertest' '2.0.8'}}",
"supertest": "{{versionQuery 'supertest' '4.0.2'}}",
"msw": "{{versionQuery 'msw' '0.43.0'}}"
"msw": "{{versionQuery 'msw' '0.44.0'}}"
},
"files": [
"dist"
@@ -49,7 +49,7 @@
"@testing-library/user-event": "{{versionQuery '@testing-library/user-event' '14.0.0'}}",
"@types/jest": "{{versionQuery '@types/jest' '26.0.7'}}",
"@types/node": "{{versionQuery '@types/node' '16.11.26'}}",
"msw": "{{versionQuery 'msw' '0.43.0'}}",
"msw": "{{versionQuery 'msw' '0.44.0'}}",
"cross-fetch": "{{versionQuery 'cross-fetch' '3.1.5'}}"
},
"files": [
+8
View File
@@ -1,5 +1,13 @@
# @backstage/config-loader
## 1.1.3-next.1
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- 72622d9143: Updated dependency `yaml` to `^2.0.0`.
- a3acec8819: Updated dependency `typescript-json-schema` to `^0.54.0`.
## 1.1.3-next.0
### Patch Changes
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/config-loader",
"description": "Config loading functionality used by Backstage backend, and CLI",
"version": "1.1.3-next.0",
"version": "1.1.3-next.1",
"private": false,
"publishConfig": {
"access": "public",
@@ -57,7 +57,7 @@
"@types/node": "^16.11.26",
"@types/yup": "^0.29.13",
"mock-fs": "^5.1.0",
"msw": "^0.43.0"
"msw": "^0.44.0"
},
"files": [
"dist"
+9
View File
@@ -1,5 +1,14 @@
# @backstage/core-app-api
## 1.0.4-next.1
### Patch Changes
- 881fc75a75: Internal tweak removing usage of explicit type parameters for the `BackstagePlugin` type.
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- Updated dependencies
- @backstage/core-plugin-api@1.0.4-next.0
## 1.0.4-next.0
### Patch Changes
+3 -3
View File
@@ -155,7 +155,7 @@ export type AppConfigLoader = () => Promise<AppConfig[]>;
// @public
export type AppContext = {
getPlugins(): BackstagePlugin<any, any>[];
getPlugins(): BackstagePlugin[];
getSystemIcon(key: string): IconComponent | undefined;
getComponents(): AppComponents;
};
@@ -193,7 +193,7 @@ export type AppOptions = {
[key in string]: IconComponent;
};
plugins?: Array<
BackstagePlugin<any, any> & {
BackstagePlugin & {
output?(): Array<
| {
type: 'feature-flag';
@@ -254,7 +254,7 @@ export type AuthApiCreateOptions = {
// @public
export type BackstageApp = {
getPlugins(): BackstagePlugin<any, any>[];
getPlugins(): BackstagePlugin[];
getSystemIcon(key: string): IconComponent | undefined;
getProvider(): ComponentType<{}>;
getRouter(): ComponentType<{}>;
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-app-api",
"description": "Core app API used by Backstage apps",
"version": "1.0.4-next.0",
"version": "1.0.4-next.1",
"private": false,
"publishConfig": {
"access": "public",
@@ -34,7 +34,7 @@
},
"dependencies": {
"@backstage/config": "^1.0.1",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/types": "^1.0.0",
"@backstage/version-bridge": "^1.0.1",
"@types/prop-types": "^15.7.3",
@@ -49,8 +49,8 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.1",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/test-utils": "^1.1.2-next.2",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
@@ -59,7 +59,7 @@
"@types/node": "^16.11.26",
"@types/zen-observable": "^0.8.0",
"cross-fetch": "^3.1.5",
"msw": "^0.43.0"
"msw": "^0.44.0"
},
"files": [
"dist",
+6 -6
View File
@@ -82,8 +82,8 @@ import { resolveRouteBindings } from './resolveRouteBindings';
import { BackstageRouteObject } from '../routing/types';
type CompatiblePlugin =
| BackstagePlugin<any, any>
| (Omit<BackstagePlugin<any, any>, 'getFeatureFlags'> & {
| BackstagePlugin
| (Omit<BackstagePlugin, 'getFeatureFlags'> & {
output(): Array<{ type: 'feature-flag'; name: string }>;
});
@@ -145,7 +145,7 @@ function useConfigLoader(
class AppContextImpl implements AppContext {
constructor(private readonly app: AppManager) {}
getPlugins(): BackstagePlugin<any, any>[] {
getPlugins(): BackstagePlugin[] {
return this.app.getPlugins();
}
@@ -186,8 +186,8 @@ export class AppManager implements BackstageApp {
this.apiFactoryRegistry = new ApiFactoryRegistry();
}
getPlugins(): BackstagePlugin<any, any>[] {
return Array.from(this.plugins) as BackstagePlugin<any, any>[];
getPlugins(): BackstagePlugin[] {
return Array.from(this.plugins) as BackstagePlugin[];
}
getSystemIcon(key: string): IconComponent | undefined {
@@ -241,7 +241,7 @@ export class AppManager implements BackstageApp {
validateRouteParameters(routing.paths, routing.parents);
validateRouteBindings(
routeBindings,
this.plugins as Iterable<BackstagePlugin<any, any>>,
this.plugins as Iterable<BackstagePlugin>,
);
}
+3 -3
View File
@@ -206,7 +206,7 @@ export type AppOptions = {
* A list of all plugins to include in the app.
*/
plugins?: Array<
BackstagePlugin<any, any> & {
BackstagePlugin & {
output?(): Array<
{ type: 'feature-flag'; name: string } | { type: string }
>; // support for old plugins
@@ -291,7 +291,7 @@ export type BackstageApp = {
/**
* Returns all plugins registered for the app.
*/
getPlugins(): BackstagePlugin<any, any>[];
getPlugins(): BackstagePlugin[];
/**
* Get a common or custom icon for this app.
@@ -321,7 +321,7 @@ export type AppContext = {
/**
* Get a list of all plugins that are installed in the app.
*/
getPlugins(): BackstagePlugin<any, any>[];
getPlugins(): BackstagePlugin[];
/**
* Get a common or custom icon for this app.
@@ -18,12 +18,9 @@ import { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';
import { createCollector } from '../extensions/traversal';
export const pluginCollector = createCollector(
() => new Set<BackstagePlugin<any, any>>(),
() => new Set<BackstagePlugin>(),
(acc, node) => {
const plugin = getComponentData<BackstagePlugin<any, any>>(
node,
'core.plugin',
);
const plugin = getComponentData<BackstagePlugin>(node, 'core.plugin');
if (plugin) {
acc.add(plugin);
}
+10
View File
@@ -1,5 +1,15 @@
# @backstage/core-components
## 0.10.0-next.3
### Patch Changes
- 7f5e79961d: Fix relative `sub-paths` by concatenating the app's base path with them.
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- 693990d4fe: Updated dependency `@react-hookz/web` to `^15.0.0`.
- Updated dependencies
- @backstage/core-plugin-api@1.0.4-next.0
## 0.10.0-next.2
### Minor Changes
+1
View File
@@ -190,6 +190,7 @@ export function CopyTextButton(props: CopyTextButtonProps): JSX.Element;
// @public
export interface CopyTextButtonProps {
'aria-label'?: string;
text: string;
tooltipDelay?: number;
tooltipText?: string;
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-components",
"description": "Core components used by Backstage plugins and apps",
"version": "0.10.0-next.2",
"version": "0.10.0-next.3",
"private": false,
"publishConfig": {
"access": "public",
@@ -34,7 +34,7 @@
},
"dependencies": {
"@backstage/config": "^1.0.1",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/errors": "^1.1.0-next.0",
"@backstage/theme": "^0.2.16-next.1",
"@backstage/version-bridge": "^1.0.1",
@@ -79,9 +79,9 @@
"react-dom": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/cli": "^0.18.0-next.2",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/test-utils": "^1.1.2-next.2",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
@@ -101,7 +101,7 @@
"@types/react-window": "^1.8.5",
"@types/zen-observable": "^0.8.0",
"cross-fetch": "^3.1.5",
"msw": "^0.43.0"
"msw": "^0.44.0"
},
"files": [
"dist"
@@ -40,3 +40,10 @@ export const LongerTooltipDelay = () => (
tooltipDelay={3000}
/>
);
export const WithAriaLabel = () => (
<CopyTextButton
text="The text to copy to clipboard"
aria-label="This is an aria label"
/>
);
@@ -55,13 +55,14 @@ const apis = [[errorApiRef, mockErrorApi] as const] as const;
describe('<CopyTextButton />', () => {
it('renders without exploding', async () => {
const { getByTitle, queryByText } = await renderInTestApp(
const { getByTitle, queryByText, getByLabelText } = await renderInTestApp(
<TestApiProvider apis={apis}>
<CopyTextButton {...props} />
</TestApiProvider>,
);
expect(getByTitle('mockTooltip')).toBeInTheDocument();
expect(queryByText('mockTooltip')).not.toBeInTheDocument();
expect(getByLabelText('Copy text')).toBeInTheDocument();
});
it('displays tooltip and copy the text on click', async () => {
@@ -99,4 +100,13 @@ describe('<CopyTextButton />', () => {
);
expect(mockErrorApi.post).toHaveBeenCalledWith(error);
});
it('aria-label', async () => {
const { getByLabelText } = await renderInTestApp(
<TestApiProvider apis={apis}>
<CopyTextButton {...props} aria-label="text for aria-label" />
</TestApiProvider>,
);
expect(getByLabelText('text for aria-label')).toBeInTheDocument();
});
});
@@ -47,6 +47,15 @@ export interface CopyTextButtonProps {
* Default: "Text copied to clipboard"
*/
tooltipText?: string;
/**
* Text to use as aria-label prop on the button
*
* @remarks
*
* Default: "Copy text"
*/
'aria-label'?: string;
}
/**
@@ -62,13 +71,18 @@ export interface CopyTextButtonProps {
*
* @example
*
* `<CopyTextButton text="My text that I want to be copied to the clipboard" />`
* ```
* <CopyTextButton
* text="My text that I want to be copied to the clipboard"
* arial-label="Accessible label for this button" />
* ```
*/
export function CopyTextButton(props: CopyTextButtonProps) {
const {
text,
tooltipDelay = 1000,
tooltipText = 'Text copied to clipboard',
'aria-label': ariaLabel = 'Copy text',
} = props;
const errorApi = useApi(errorApiRef);
const [open, setOpen] = useState(false);
@@ -96,7 +110,7 @@ export function CopyTextButton(props: CopyTextButtonProps) {
onClose={() => setOpen(false)}
open={open}
>
<IconButton onClick={handleCopyClick}>
<IconButton onClick={handleCopyClick} aria-label={ariaLabel}>
<CopyIcon />
</IconButton>
</Tooltip>
+8
View File
@@ -1,5 +1,13 @@
# @backstage/core-plugin-api
## 1.0.4-next.0
### Patch Changes
- 881fc75a75: Internal tweak removing usage of explicit type parameters for the `BackstagePlugin` type.
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- 2990fff4e5: Enabled the `@backstage/core-plugin-api/alpha` entry point.
## 1.0.3
### Patch Changes
+11 -11
View File
@@ -31,26 +31,26 @@ export type AlertMessage = {
severity?: 'success' | 'info' | 'warning' | 'error';
};
// @alpha
// @public
export type AnalyticsApi = {
captureEvent(event: AnalyticsEvent): void;
};
// @alpha
// @public
export const analyticsApiRef: ApiRef<AnalyticsApi>;
// @alpha
// @public
export const AnalyticsContext: (options: {
attributes: Partial<AnalyticsContextValue>;
children: ReactNode;
}) => JSX.Element;
// @alpha
// @public
export type AnalyticsContextValue = CommonAnalyticsContext & {
[param in string]: string | boolean | number | undefined;
};
// @alpha
// @public
export type AnalyticsEvent = {
action: string;
subject: string;
@@ -59,12 +59,12 @@ export type AnalyticsEvent = {
context: AnalyticsContextValue;
};
// @alpha
// @public
export type AnalyticsEventAttributes = {
[attribute in string]: string | boolean | number;
};
// @alpha
// @public
export type AnalyticsTracker = {
captureEvent: (
action: string,
@@ -147,7 +147,7 @@ export type AppComponents = {
// @public
export type AppContext = {
getPlugins(): BackstagePlugin_2<any, any>[];
getPlugins(): BackstagePlugin_2[];
getSystemIcon(key: string): IconComponent_2 | undefined;
getComponents(): AppComponents;
};
@@ -241,7 +241,7 @@ export type BootErrorPageProps = {
error: Error;
};
// @alpha
// @public
export type CommonAnalyticsContext = {
pluginId: string;
routeRef: string;
@@ -401,7 +401,7 @@ export type ErrorBoundaryFallbackProps = {
// @public
export type Extension<T> = {
expose(plugin: BackstagePlugin<any, any>): T;
expose(plugin: BackstagePlugin): T;
};
// @public
@@ -715,7 +715,7 @@ export type TypesToApiRefs<T> = {
[key in keyof T]: ApiRef<T[key]>;
};
// @alpha
// @public
export function useAnalytics(): AnalyticsTracker;
// @public
+10 -8
View File
@@ -1,12 +1,13 @@
{
"name": "@backstage/core-plugin-api",
"description": "Core API used by Backstage plugins",
"version": "1.0.3",
"version": "1.0.4-next.0",
"private": false,
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
"types": "dist/index.d.ts",
"alphaTypes": "dist/index.alpha.d.ts"
},
"backstage": {
"role": "web-library"
@@ -24,7 +25,7 @@
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"build": "backstage-cli package build",
"build": "backstage-cli package build --experimental-type-build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
@@ -46,9 +47,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.1",
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/test-utils": "^1.1.2-next.2",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
@@ -58,9 +59,10 @@
"@types/prop-types": "^15.7.3",
"@types/zen-observable": "^0.8.0",
"cross-fetch": "^3.1.5",
"msw": "^0.43.0"
"msw": "^0.44.0"
},
"files": [
"dist"
"dist",
"alpha"
]
}
@@ -61,7 +61,7 @@ export const useAnalyticsContext = (): AnalyticsContextValue => {
* Analytics contexts are additive, meaning the context ultimately emitted with
* an event is the combination of all contexts in the parent tree.
*
* @alpha
* @public
*/
export const AnalyticsContext = (options: {
attributes: Partial<AnalyticsContextValue>;
@@ -17,7 +17,7 @@
/**
* Common analytics context attributes.
*
* @alpha
* @public
*/
export type CommonAnalyticsContext = {
/**
@@ -39,7 +39,7 @@ export type CommonAnalyticsContext = {
/**
* Analytics context envelope.
*
* @alpha
* @public
*/
export type AnalyticsContextValue = CommonAnalyticsContext & {
[param in string]: string | boolean | number | undefined;
@@ -35,7 +35,7 @@ function useAnalyticsApi(): AnalyticsApi {
/**
* Gets a pre-configured analytics tracker.
*
* @alpha
* @public
*/
export function useAnalytics(): AnalyticsTracker {
const trackerRef = useRef<Tracker | null>(null);
@@ -21,7 +21,7 @@ import { AnalyticsContextValue } from '../../analytics/types';
* Represents an event worth tracking in an analytics system that could inform
* how users of a Backstage instance are using its features.
*
* @alpha
* @public
*/
export type AnalyticsEvent = {
/**
@@ -79,7 +79,7 @@ export type AnalyticsEvent = {
* A structure allowing other arbitrary metadata to be provided by analytics
* event emitters.
*
* @alpha
* @public
*/
export type AnalyticsEventAttributes = {
[attribute in string]: string | boolean | number;
@@ -89,7 +89,7 @@ export type AnalyticsEventAttributes = {
* Represents a tracker with methods that can be called to track events in a
* configured analytics service.
*
* @alpha
* @public
*/
export type AnalyticsTracker = {
captureEvent: (
@@ -103,8 +103,6 @@ export type AnalyticsTracker = {
};
/**
* **EXPERIMENTAL**
*
* The Analytics API is used to track user behavior in a Backstage instance.
*
* @remarks
@@ -113,7 +111,7 @@ export type AnalyticsTracker = {
* useAnalytics() hook. This will return a pre-configured AnalyticsTracker
* with relevant methods for instrumentation.
*
* @alpha
* @public
*/
export type AnalyticsApi = {
/**
@@ -124,11 +122,9 @@ export type AnalyticsApi = {
};
/**
* **EXPERIMENTAL**
*
* The {@link ApiRef} of {@link AnalyticsApi}.
*
* @alpha
* @public
*/
export const analyticsApiRef: ApiRef<AnalyticsApi> = createApiRef({
id: 'core.analytics',
@@ -225,7 +225,7 @@ export function createReactExtension<
'Component';
return {
expose(plugin: BackstagePlugin<any, any>) {
expose(plugin: BackstagePlugin) {
const Result: any = (props: any) => {
const app = useApp();
const { Progress } = app.getComponents();
+1 -1
View File
@@ -27,7 +27,7 @@ import { AnyApiFactory } from '../apis/system';
* @public
*/
export type Extension<T> = {
expose(plugin: BackstagePlugin<any, any>): T;
expose(plugin: BackstagePlugin): T;
};
/**
+6
View File
@@ -1,5 +1,11 @@
# @backstage/create-app
## 0.4.29-next.3
### Patch Changes
- Bumped create-app version.
## 0.4.29-next.2
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/create-app",
"description": "A CLI that helps you create your own Backstage app",
"version": "0.4.29-next.2",
"version": "0.4.29-next.3",
"private": false,
"publishConfig": {
"access": "public"
+14
View File
@@ -1,5 +1,19 @@
# @backstage/dev-utils
## 1.0.4-next.3
### Patch Changes
- Updated dependencies
- @backstage/app-defaults@1.0.4-next.3
- @backstage/core-app-api@1.0.4-next.1
- @backstage/core-plugin-api@1.0.4-next.0
- @backstage/core-components@0.10.0-next.3
- @backstage/integration-react@1.1.2-next.3
- @backstage/test-utils@1.1.2-next.2
- @backstage/catalog-model@1.1.0-next.3
- @backstage/plugin-catalog-react@1.1.2-next.3
## 1.0.4-next.2
### Patch Changes
+10 -10
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/dev-utils",
"description": "Utilities for developing Backstage plugins.",
"version": "1.0.4-next.2",
"version": "1.0.4-next.3",
"private": false,
"publishConfig": {
"access": "public",
@@ -33,14 +33,14 @@
"start": "backstage-cli package start"
},
"dependencies": {
"@backstage/app-defaults": "^1.0.4-next.2",
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/core-components": "^0.10.0-next.2",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/catalog-model": "^1.1.0-next.2",
"@backstage/integration-react": "^1.1.2-next.2",
"@backstage/plugin-catalog-react": "^1.1.2-next.2",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/app-defaults": "^1.0.4-next.3",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/core-components": "^0.10.0-next.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/catalog-model": "^1.1.0-next.3",
"@backstage/integration-react": "^1.1.2-next.3",
"@backstage/plugin-catalog-react": "^1.1.2-next.3",
"@backstage/test-utils": "^1.1.2-next.2",
"@backstage/theme": "^0.2.16-next.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -59,7 +59,7 @@
"react-dom": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/cli": "^0.18.0-next.3",
"@types/jest": "^26.0.7",
"@types/node": "^16.0.0"
},
+10
View File
@@ -1,5 +1,15 @@
# @backstage/integration-react
## 1.1.2-next.3
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- Updated dependencies
- @backstage/core-plugin-api@1.0.4-next.0
- @backstage/core-components@0.10.0-next.3
- @backstage/integration@1.2.2-next.3
## 1.1.2-next.2
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/integration-react",
"description": "Frontend package for managing integrations towards external systems",
"version": "1.1.2-next.2",
"version": "1.1.2-next.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -25,9 +25,9 @@
},
"dependencies": {
"@backstage/config": "^1.0.1",
"@backstage/core-components": "^0.10.0-next.2",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/integration": "^1.2.2-next.2",
"@backstage/core-components": "^0.10.0-next.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/integration": "^1.2.2-next.3",
"@backstage/theme": "^0.2.16-next.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -38,15 +38,15 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/dev-utils": "^1.0.4-next.2",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/dev-utils": "^1.0.4-next.3",
"@backstage/test-utils": "^1.1.2-next.2",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/jest": "^26.0.7",
"@types/node": "^16.11.26",
"msw": "^0.43.0",
"msw": "^0.44.0",
"cross-fetch": "^3.1.5"
},
"files": [
+9
View File
@@ -1,5 +1,14 @@
# @backstage/integration
## 1.2.2-next.3
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- 4e9a90e307: Updated dependency `luxon` to `^3.0.0`.
- 1f29047bad: Updated dependency `@octokit/auth-app` to `^4.0.0`.
- 4df3390795: Avoid double encoding of the file path in `getBitbucketServerDownloadUrl`
## 1.2.2-next.2
### Patch Changes
+5
View File
@@ -342,6 +342,11 @@ export function getGitLabFileFetchUrl(
config: GitLabIntegrationConfig,
): Promise<string>;
// @public
export function getGitLabIntegrationRelativePath(
config: GitLabIntegrationConfig,
): string;
// @public
export function getGitLabRequestOptions(config: GitLabIntegrationConfig): {
headers: Record<string, string>;
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/integration",
"description": "Helpers for managing integrations towards external systems",
"version": "1.2.2-next.2",
"version": "1.2.2-next.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -37,18 +37,18 @@
"@backstage/errors": "^1.1.0-next.0",
"cross-fetch": "^3.1.5",
"git-url-parse": "^12.0.0",
"@octokit/rest": "^18.5.3",
"@octokit/rest": "^19.0.3",
"@octokit/auth-app": "^4.0.0",
"luxon": "^2.0.2",
"luxon": "^3.0.0",
"lodash": "^4.17.21"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/config-loader": "^1.1.3-next.0",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/config-loader": "^1.1.3-next.1",
"@backstage/test-utils": "^1.1.2-next.2",
"@types/jest": "^26.0.7",
"@types/luxon": "^2.0.4",
"msw": "^0.43.0"
"msw": "^0.44.0"
},
"files": [
"dist",
@@ -119,7 +119,7 @@ class GithubAppManager {
const repos = await installationClient.paginate(
installationClient.apps.listReposAccessibleToInstallation,
);
const hasRepo = repos.some(repository => {
const hasRepo = repos.repositories.some(repository => {
return repository.name === repo;
});
if (!hasRepo) {
+17 -1
View File
@@ -69,7 +69,6 @@ export function readGitLabIntegrationConfig(
let apiBaseUrl = config.getOptionalString('apiBaseUrl');
const token = config.getOptionalString('token');
let baseUrl = config.getOptionalString('baseUrl');
if (apiBaseUrl) {
apiBaseUrl = trimEnd(apiBaseUrl, '/');
} else if (host === GITLAB_HOST) {
@@ -124,3 +123,20 @@ export function readGitLabIntegrationConfigs(
return result;
}
/**
* Reads a GitLab integration config, and returns
* relative path.
*
* @param config - GitLabIntegrationConfig object
* @public
*/
export function getGitLabIntegrationRelativePath(
config: GitLabIntegrationConfig,
): string {
let relativePath = '';
if (config.host !== GITLAB_HOST) {
relativePath = new URL(config.baseUrl).pathname;
}
return trimEnd(relativePath, '/');
}
+66 -2
View File
@@ -35,18 +35,32 @@ describe('gitlab core', () => {
});
const configWithToken: GitLabIntegrationConfig = {
host: 'g.com',
host: 'gitlab.com',
token: '0123456789',
apiBaseUrl: '<ignored>',
baseUrl: '<ignored>',
};
const configWithNoToken: GitLabIntegrationConfig = {
host: 'g.com',
host: 'gitlab.com',
apiBaseUrl: '<ignored>',
baseUrl: '<ignored>',
};
const configSelfHosteWithRelativePath: GitLabIntegrationConfig = {
host: 'gitlab.mycompany.com',
token: '0123456789',
apiBaseUrl: '<ignored>',
baseUrl: 'https://gitlab.mycompany.com/gitlab',
};
const configSelfHostedWithoutRelativePath: GitLabIntegrationConfig = {
host: 'gitlab.mycompany.com',
token: '0123456789',
apiBaseUrl: '<ignored>',
baseUrl: 'https://gitlab.mycompany.com',
};
describe('getGitLabFileFetchUrl with .yaml extension', () => {
it.each([
// Project URLs
@@ -56,6 +70,18 @@ describe('gitlab core', () => {
result:
'https://gitlab.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yaml/raw?ref=branch',
},
{
config: configSelfHosteWithRelativePath,
url: 'https://gitlab.mycompany.com/gitlab/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file.yaml',
result:
'https://gitlab.mycompany.com/gitlab/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yaml/raw?ref=branch',
},
{
config: configSelfHostedWithoutRelativePath,
url: 'https://gitlab.mycompany.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file.yaml',
result:
'https://gitlab.mycompany.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yaml/raw?ref=branch',
},
{
config: configWithNoToken,
// Works with non URI encoded link
@@ -63,6 +89,18 @@ describe('gitlab core', () => {
result:
'https://gitlab.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yaml/raw?ref=branch',
},
{
config: configSelfHosteWithRelativePath,
url: 'https://gitlab.mycompany.com/gitlab/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file with spaces.yaml',
result:
'https://gitlab.mycompany.com/gitlab/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yaml/raw?ref=branch',
},
{
config: configSelfHostedWithoutRelativePath,
url: 'https://gitlab.mycompany.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file with spaces.yaml',
result:
'https://gitlab.mycompany.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yaml/raw?ref=branch',
},
{
config: configWithNoToken,
url: 'https://gitlab.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path%20with%20spaces/to/file.yaml',
@@ -121,6 +159,18 @@ describe('gitlab core', () => {
result:
'https://gitlab.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yml/raw?ref=branch',
},
{
config: configSelfHosteWithRelativePath,
url: 'https://gitlab.mycompany.com/gitlab/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file.yml',
result:
'https://gitlab.mycompany.com/gitlab/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yml/raw?ref=branch',
},
{
config: configSelfHostedWithoutRelativePath,
url: 'https://gitlab.mycompany.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file.yml',
result:
'https://gitlab.mycompany.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yml/raw?ref=branch',
},
{
config: configWithNoToken,
// Works with non URI encoded link
@@ -128,6 +178,20 @@ describe('gitlab core', () => {
result:
'https://gitlab.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yml/raw?ref=branch',
},
{
config: configSelfHosteWithRelativePath,
// Works with non URI encoded link
url: 'https://gitlab.mycompany.com/gitlab/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file with spaces.yml',
result:
'https://gitlab.mycompany.com/gitlab/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yml/raw?ref=branch',
},
{
config: configSelfHostedWithoutRelativePath,
// Works with non URI encoded link
url: 'https://gitlab.mycompany.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file with spaces.yml',
result:
'https://gitlab.mycompany.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yml/raw?ref=branch',
},
{
config: configWithNoToken,
url: 'https://gitlab.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path%20with%20spaces/to/file.yml',
+27 -6
View File
@@ -14,7 +14,10 @@
* limitations under the License.
*/
import { GitLabIntegrationConfig } from './config';
import {
getGitLabIntegrationRelativePath,
GitLabIntegrationConfig,
} from './config';
import fetch from 'cross-fetch';
import { InputError } from '@backstage/errors';
@@ -42,9 +45,10 @@ export async function getGitLabFileFetchUrl(
// TODO(Rugvip): From the old GitlabReaderProcessor; used
// the existence of /-/blob/ to switch the logic. Don't know if this
// makes sense and it might require some more work.
if (url.includes('/-/blob/')) {
const projectID = await getProjectId(url, config);
return buildProjectUrl(url, projectID).toString();
return buildProjectUrl(url, projectID, config).toString();
}
return buildRawUrl(url).toString();
}
@@ -101,20 +105,27 @@ export function buildRawUrl(target: string): URL {
// Converts
// from: https://gitlab.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/filepath
// to: https://gitlab.com/api/v4/projects/projectId/repository/files/filepath?ref=branch
export function buildProjectUrl(target: string, projectID: Number): URL {
export function buildProjectUrl(
target: string,
projectID: Number,
config: GitLabIntegrationConfig,
): URL {
try {
const url = new URL(target);
const branchAndFilePath = url.pathname.split('/-/blob/')[1];
const [branch, ...filePath] = branchAndFilePath.split('/');
const relativePath = getGitLabIntegrationRelativePath(config);
url.pathname = [
'/api/v4/projects',
...(relativePath ? [relativePath] : []),
'api/v4/projects',
projectID,
'repository/files',
encodeURIComponent(decodeURIComponent(filePath.join('/'))),
'raw',
].join('/');
url.search = `?ref=${branch}`;
return url;
@@ -137,19 +148,29 @@ export async function getProjectId(
}
try {
const repo = url.pathname.split('/-/blob/')[0];
let repo = url.pathname.split('/-/blob/')[0];
// Get gitlab relative path
const relativePath = getGitLabIntegrationRelativePath(config);
// Check relative path exist and replace it if it's the case.
if (relativePath) {
repo = repo.replace(relativePath, '');
}
// Convert
// to: https://gitlab.com/api/v4/projects/groupA%2Fteams%2FsubgroupA%2FteamA%2Frepo
const repoIDLookup = new URL(
`${url.origin}/api/v4/projects/${encodeURIComponent(
`${url.origin}${relativePath}/api/v4/projects/${encodeURIComponent(
repo.replace(/^\//, ''),
)}`,
);
const response = await fetch(
repoIDLookup.toString(),
getGitLabRequestOptions(config),
);
const data = await response.json();
if (!response.ok) {
+1
View File
@@ -17,6 +17,7 @@
export {
readGitLabIntegrationConfig,
readGitLabIntegrationConfigs,
getGitLabIntegrationRelativePath,
} from './config';
export type { GitLabIntegrationConfig } from './config';
export { getGitLabFileFetchUrl, getGitLabRequestOptions } from './core';
+6
View File
@@ -1,5 +1,11 @@
# @backstage/release-manifests
## 0.0.5-next.0
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
## 0.0.4
### Patch Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/release-manifests",
"description": "Helper library for receiving release manifests",
"version": "0.0.4",
"version": "0.0.5-next.0",
"private": false,
"main": "src/index.ts",
"types": "src/index.ts",
@@ -36,8 +36,8 @@
"cross-fetch": "^3.1.5"
},
"devDependencies": {
"@backstage/test-utils": "^1.1.2-next.0",
"msw": "^0.43.0",
"@backstage/test-utils": "^1.1.2-next.2",
"msw": "^0.44.0",
"@types/jest": "^26.0.7",
"@types/node": "^16.0.0"
},
@@ -1,5 +1,22 @@
# techdocs-cli-embedded-app
## 0.2.72-next.3
### Patch Changes
- Updated dependencies
- @backstage/app-defaults@1.0.4-next.3
- @backstage/core-app-api@1.0.4-next.1
- @backstage/core-plugin-api@1.0.4-next.0
- @backstage/core-components@0.10.0-next.3
- @backstage/cli@0.18.0-next.3
- @backstage/integration-react@1.1.2-next.3
- @backstage/test-utils@1.1.2-next.2
- @backstage/plugin-techdocs@1.2.1-next.3
- @backstage/catalog-model@1.1.0-next.3
- @backstage/plugin-catalog@1.4.0-next.3
- @backstage/plugin-techdocs-react@1.0.2-next.2
## 0.2.72-next.2
### Patch Changes
+13 -13
View File
@@ -1,24 +1,24 @@
{
"name": "techdocs-cli-embedded-app",
"version": "0.2.72-next.2",
"version": "0.2.72-next.3",
"private": true,
"backstage": {
"role": "frontend"
},
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^1.0.4-next.2",
"@backstage/catalog-model": "^1.1.0-next.2",
"@backstage/cli": "^0.18.0-next.2",
"@backstage/app-defaults": "^1.0.4-next.3",
"@backstage/catalog-model": "^1.1.0-next.3",
"@backstage/cli": "^0.18.0-next.3",
"@backstage/config": "^1.0.1",
"@backstage/core-app-api": "^1.0.4-next.0",
"@backstage/core-components": "^0.10.0-next.2",
"@backstage/core-plugin-api": "^1.0.3",
"@backstage/integration-react": "^1.1.2-next.2",
"@backstage/plugin-catalog": "^1.4.0-next.2",
"@backstage/plugin-techdocs": "^1.2.1-next.2",
"@backstage/plugin-techdocs-react": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.2-next.1",
"@backstage/core-app-api": "^1.0.4-next.1",
"@backstage/core-components": "^0.10.0-next.3",
"@backstage/core-plugin-api": "^1.0.4-next.0",
"@backstage/integration-react": "^1.1.2-next.3",
"@backstage/plugin-catalog": "^1.4.0-next.3",
"@backstage/plugin-techdocs": "^1.2.1-next.3",
"@backstage/plugin-techdocs-react": "^1.0.2-next.2",
"@backstage/test-utils": "^1.1.2-next.2",
"@backstage/theme": "^0.2.16-next.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
@@ -30,7 +30,7 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.18.0-next.2",
"@backstage/cli": "^0.18.0-next.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/test-utils
## 1.1.2-next.2
### Patch Changes
- a70869e775: Updated dependency `msw` to `^0.43.0`.
- Updated dependencies
- @backstage/core-app-api@1.0.4-next.1
- @backstage/core-plugin-api@1.0.4-next.0
- @backstage/plugin-permission-common@0.6.3-next.1
- @backstage/plugin-permission-react@0.4.3-next.1
## 1.1.2-next.1
### Patch Changes

Some files were not shown because too many files have changed in this diff Show More