Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into orkohunter/techdocs…
Browse files Browse the repository at this point in the history
…-publish-to-cloud-storage
  • Loading branch information
OrkoHunter committed Dec 4, 2020
2 parents 2cbad5c + b6aa734 commit 8ffbbce
Show file tree
Hide file tree
Showing 68 changed files with 2,308 additions and 92 deletions.
23 changes: 23 additions & 0 deletions .changeset/calm-icons-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@backstage/core-api': patch
'@backstage/dev-utils': patch
---

Update ApiFactory type to correctly infer API type and disallow mismatched implementations.

This fixes for example the following code:

```ts
interface MyApi {
myMethod(): void
}

const myApiRef = createApiRef<MyApi>({...});

createApiFactory({
api: myApiRef,
deps: {},
// This should've caused an error, since the empty object does not fully implement MyApi
factory: () => ({}),
})
```
6 changes: 6 additions & 0 deletions .changeset/great-spiders-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog': patch
'@backstage/plugin-pagerduty': patch
---

Added pagerduty plugin to example app
5 changes: 5 additions & 0 deletions .changeset/grumpy-meals-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-import': patch
---

Align plugin ID and fix variable typo
5 changes: 5 additions & 0 deletions .changeset/grumpy-toys-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-import': patch
---

Add register existing component instructions
5 changes: 5 additions & 0 deletions .changeset/perfect-donkeys-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---

Fix config schema for `.app.listen`
5 changes: 5 additions & 0 deletions .changeset/purple-ghosts-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search': patch
---

change default size for pageSize in search result view
8 changes: 8 additions & 0 deletions .changeset/shaggy-camels-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'example-backend': patch
'@backstage/plugin-scaffolder-backend': patch
'@backstage/plugin-techdocs-backend': patch
'@backstage/create-app': patch
---

Unify `dockerode` library and type dependency versions
14 changes: 14 additions & 0 deletions .changeset/unlucky-kiwis-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@backstage/core': minor
---

Introducing a new optional property within `app-config.yaml` called `auth.environment` to have configurable environment value for `auth.providers`

**Default Value:** 'development'

**Optional Values:** 'production' | 'development'

**Migration-steps:**

- To override the default value, one could simply introduce the new property `environment` within the `auth` section of the `config.yaml`
- re-run the build to reflect the changed configs
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Backstage Changelog

This is a best-effort changelog where we manually collect breaking changes. It is not an exhaustive list of all changes or even features added.
This changelog is no longer being updated and will be removed in the future, as each package now has its own changelog instead. It was a best-effort changelog where we manually collected breaking changes during the `v0.1.1-alpha.<n>` releases.

If you encounter issues while upgrading to a newer version, don't hesitate to reach out on [Discord](https://discord.gg/EBHEGzX) or [open an issue](https://github.com/backstage/backstage/issues/new/choose)!

## Next Release

> Collect changes for the next release below
## v0.1.1-alpha.26

### @backstage/cli
Expand Down
9 changes: 9 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ proxy:
X-Api-Key:
$env: NEW_RELIC_REST_API_KEY

'/pagerduty':
target: https://api.pagerduty.com
headers:
Authorization:
$env: PAGERDUTY_TOKEN

'/buildkite/api':
target: https://api.buildkite.com/v2/
headers:
Expand Down Expand Up @@ -194,6 +200,7 @@ scaffolder:
token:
$env: AZURE_TOKEN
auth:
environment: development
### Providing an auth.session.secret will enable session support in the auth-backend
# session:
# secret: custom session secret
Expand Down Expand Up @@ -313,3 +320,5 @@ homepage:
timezone: 'Europe/Stockholm'
- label: TYO
timezone: 'Asia/Tokyo'
pagerduty:
eventsBaseUrl: 'https://events.pagerduty.com/v2'
Binary file modified docs/assets/software-catalog/bsc-register-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@backstage/plugin-kubernetes": "^0.3.1",
"@backstage/plugin-lighthouse": "^0.2.4",
"@backstage/plugin-newrelic": "^0.2.1",
"@backstage/plugin-pagerduty": "0.2.1",
"@backstage/plugin-register-component": "^0.2.3",
"@backstage/plugin-rollbar": "^0.2.5",
"@backstage/plugin-scaffolder": "^0.3.2",
Expand All @@ -36,10 +37,10 @@
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@octokit/rest": "^18.0.0",
"@roadiehq/backstage-plugin-buildkite": "^0.1.3",
"@roadiehq/backstage-plugin-github-insights": "^0.2.16",
"@roadiehq/backstage-plugin-github-pull-requests": "^0.6.3",
"@roadiehq/backstage-plugin-travis-ci": "^0.2.8",
"@roadiehq/backstage-plugin-buildkite": "^0.1.3",
"history": "^5.0.0",
"prop-types": "^15.7.2",
"react": "^16.12.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ import {
PullRequestsStatsCard,
Router as PullRequestsRouter,
} from '@roadiehq/backstage-plugin-github-pull-requests';
import {
isPluginApplicableToEntity as isPagerDutyAvailable,
PagerDutyCard,
} from '@backstage/plugin-pagerduty';
import {
isPluginApplicableToEntity as isTravisCIAvailable,
RecentTravisCIBuildsWidget,
Expand Down Expand Up @@ -142,6 +146,11 @@ const ComponentOverviewContent = ({ entity }: { entity: Entity }) => (
<Grid item md={6}>
<AboutCard entity={entity} variant="gridItem" />
</Grid>
{isPagerDutyAvailable(entity) && (
<Grid item md={6}>
<PagerDutyCard entity={entity} />
</Grid>
)}
<RecentCICDRunsSwitcher entity={entity} />
{isGitHubAvailable(entity) && (
<>
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ export { plugin as CostInsights } from '@backstage/plugin-cost-insights';
export { plugin as GitHubInsights } from '@roadiehq/backstage-plugin-github-insights';
export { plugin as CatalogImport } from '@backstage/plugin-catalog-import';
export { plugin as UserSettings } from '@backstage/plugin-user-settings';
export { plugin as PagerDuty } from '@backstage/plugin-pagerduty';
export { plugin as Buildkite } from '@roadiehq/backstage-plugin-buildkite';
export { plugin as Search } from '@backstage/plugin-search';
1 change: 1 addition & 0 deletions packages/backend-common/src/reading/GithubUrlReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export class GithubUrlReader implements UrlReader {
new URL(
`${protocol}://${resource}/${full_name}/archive/${ref}.tar.gz`,
).toString(),
getRawRequestOptions(this.config),
);
if (!response.ok) {
const message = `Failed to read tree from ${url}, ${response.status} ${response.statusText}`;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@gitbeaker/node": "^25.2.0",
"@octokit/rest": "^18.0.0",
"azure-devops-node-api": "^10.1.1",
"dockerode": "^3.2.0",
"dockerode": "^3.2.1",
"example-app": "^0.2.5",
"express": "^4.17.1",
"express-promise-router": "^3.0.3",
Expand All @@ -46,7 +46,7 @@
},
"devDependencies": {
"@backstage/cli": "^0.4.0",
"@types/dockerode": "^2.5.32",
"@types/dockerode": "^3.2.1",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
"@types/helmet": "^0.0.48"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"description": "Listening configuration for local development",
"properties": {
"host": {
"type": "number",
"type": "string",
"visibility": "frontend",
"description": "The host that the frontend should be bound to. Only used for local development."
},
Expand Down
10 changes: 6 additions & 4 deletions packages/core-api/src/apis/system/ApiFactoryRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export class ApiFactoryRegistry implements ApiFactoryHolder {
* A factory will not be added to the registry if there is already
* an existing factory with the same or higher priority.
*/
register<Api, Deps extends { [name in string]: unknown }>(
register<Api, Impl extends Api, Deps extends { [name in string]: unknown }>(
scope: ApiFactoryScope,
factory: ApiFactory<Api, Deps>,
factory: ApiFactory<Api, Impl, Deps>,
) {
const priority = ScopePriority[scope];
const existing = this.factories.get(factory.api);
Expand All @@ -69,12 +69,14 @@ export class ApiFactoryRegistry implements ApiFactoryHolder {
return true;
}

get<T>(api: ApiRef<T>): ApiFactory<T, { [x: string]: unknown }> | undefined {
get<T>(
api: ApiRef<T>,
): ApiFactory<T, T, { [x: string]: unknown }> | undefined {
const tuple = this.factories.get(api);
if (!tuple) {
return undefined;
}
return tuple.factory as ApiFactory<T, { [x: string]: unknown }>;
return tuple.factory as ApiFactory<T, T, { [x: string]: unknown }>;
}

getAllApis(): Set<AnyApiRef> {
Expand Down
15 changes: 8 additions & 7 deletions packages/core-api/src/apis/system/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ export function createApiFactory<
Api,
Impl extends Api,
Deps extends { [name in string]: unknown }
>(factory: ApiFactory<Api, Deps>): ApiFactory<Api, Deps>;
export function createApiFactory<Api>(
>(factory: ApiFactory<Api, Impl, Deps>): ApiFactory<Api, Impl, Deps>;
export function createApiFactory<Api, Impl extends Api>(
api: ApiRef<Api>,
instance: Api,
): ApiFactory<Api, {}>;
instance: Impl,
): ApiFactory<Api, Impl, {}>;
export function createApiFactory<
Api,
Impl extends Api,
Deps extends { [name in string]: unknown }
>(
factory: ApiFactory<Api, Deps> | ApiRef<Api>,
instance?: Api,
): ApiFactory<Api, Deps> {
factory: ApiFactory<Api, Impl, Deps> | ApiRef<Api>,
instance?: Impl,
): ApiFactory<Api, Impl, Deps> {
if ('id' in factory) {
return {
api: factory,
Expand Down
16 changes: 12 additions & 4 deletions packages/core-api/src/apis/system/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,24 @@ export type ApiHolder = {
get<T>(api: ApiRef<T>): T | undefined;
};

export type ApiFactory<Api, Deps extends { [name in string]: unknown }> = {
export type ApiFactory<
Api,
Impl extends Api,
Deps extends { [name in string]: unknown }
> = {
api: ApiRef<Api>;
deps: TypesToApiRefs<Deps>;
factory(deps: Deps): Api;
factory(deps: Deps): Impl;
};

export type AnyApiFactory = ApiFactory<unknown, { [key in string]: unknown }>;
export type AnyApiFactory = ApiFactory<
unknown,
unknown,
{ [key in string]: unknown }
>;

export type ApiFactoryHolder = {
get<T>(
api: ApiRef<T>,
): ApiFactory<T, { [key in string]: unknown }> | undefined;
): ApiFactory<T, T, { [key in string]: unknown }> | undefined;
};
13 changes: 13 additions & 0 deletions packages/core/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ export interface Config {
timezone: string;
}[];
};

/**
* Configuration that provides information on available authentication providers configured for app
*/
auth?: {
/**
* The 'environment' attribute added as an optional parameter to have configurable environment value for `auth.providers`.
* default value: 'development'
* optional values: 'development' | 'production'
* @visibility frontend
*/
environment?: string;
};
}
Loading

0 comments on commit 8ffbbce

Please sign in to comment.