Merge branch 'master' of github.com:spotify/backstage into shmidt-i/universal-file-github-actions

This commit is contained in:
Ivan Shmidt
2020-10-07 16:48:36 +02:00
980 changed files with 36131 additions and 11244 deletions
+27
View File
@@ -0,0 +1,27 @@
---
'@backstage/cli': minor
'@backstage/plugin-api-docs': minor
'@backstage/plugin-app-backend': minor
'@backstage/plugin-auth-backend': minor
'@backstage/plugin-catalog-graphql': minor
'@backstage/plugin-catalog': minor
'@backstage/plugin-circleci': minor
'@backstage/plugin-explore': minor
'@backstage/plugin-gcp-projects': minor
'@backstage/plugin-github-actions': minor
'@backstage/plugin-gitops-profiles': minor
'@backstage/plugin-graphiql': minor
'@backstage/plugin-jenkins': minor
'@backstage/plugin-kubernetes': minor
'@backstage/plugin-lighthouse': minor
'@backstage/plugin-newrelic': minor
'@backstage/plugin-register-component': minor
'@backstage/plugin-rollbar': minor
'@backstage/plugin-scaffolder': minor
'@backstage/plugin-sentry': minor
'@backstage/plugin-tech-radar': minor
'@backstage/plugin-techdocs': minor
'@backstage/plugin-welcome': minor
---
Create backend plugin through CLI
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/core-api': minor
'@backstage/core': minor
'@backstage/plugin-auth-backend': minor
---
Add SAML login to backstage
![](https://user-images.githubusercontent.com/872486/92251660-bb9e3400-eeff-11ea-86fe-1f2a0262cd31.png)
![](https://user-images.githubusercontent.com/872486/93851658-1a76f200-fce3-11ea-990b-26ca1a327a15.png)
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-cloudbuild': minor
---
Releasing Google Cloud Build Plugin
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-model': minor
---
Add handling and docs for entity references
+14
View File
@@ -0,0 +1,14 @@
---
'@backstage/core': patch
'@backstage/theme': patch
---
Fix banner position and color
This PR closes: #2245
The "fixed" props added to control the position of the banner. When it is set to true the banner will be shown in bottom of that page and the width will be based on the content of the message.
![](https://user-images.githubusercontent.com/15106494/93765685-999df480-fc15-11ea-8fa5-11cac5836cf1.png)
![](https://user-images.githubusercontent.com/15106494/93765697-9e62a880-fc15-11ea-92af-b6a7fee4bb21.png)
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/theme': minor
---
Tweak dark mode colors
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/plugin-scaffolder-backend': minor
---
Add Azure DevOps support to the scaffolder backend
This adds support for Azure DevOps to the scaffolder (preparer & publisher). I thought I should get this in there now since #2426 has been merged. I had a previous PR with only the preparer but I closed that in favor of this one.
I stayed with the 'azure/api' structure but I guess we should try and go the same way as with GitHub here #2501
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/create-app': minor
'@backstage/plugin-auth-backend': minor
'@backstage/plugin-techdocs-backend': minor
---
Change the default backend plugin mount point to /api
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-actions': minor
---
Adds a widget to show recent git workflow runs to the github actions plugin. The default setting is the last 5 runs across all branches but both branch and the number of runs are configurable.
+59
View File
@@ -0,0 +1,59 @@
---
'@backstage/core-api': patch
---
Add initial RouteRefRegistry
Starting out some work to bring routing back and working as part of the work towards finalizing #1536
This is some of the groundwork of an experiment we're working on to enable routing via RouteRefs, while letting the app itself look something like this:
```jsx
const App = () => (
<BackstageRoutes>
<Navigate key="/" to="/catalog" />
<CatalogRoute path="/catalog">
{' '}
// catalogRouteRef
<EntityPage type="service">
<OverviewContent path="/">
<WidgetA />
<WidgetB />
</OverviewContent>
<CICDSwitcher path="/ci-cd" />
<StatusRoute path="/api-status" /> // statusRouteRef
<ApiDocsRoute path="/api" />
<DocsRoute path="/docs" />
</EntityPage>
<EntityPage type="website">
<OverviewContent path="/">
<WidgetA />
<WidgetB />
</OverviewContent>
<CICDSwitcher path="/ci-cd" />
<SentryRoute path="/sentry" /> // sentryRouteRef
<DocsRoute path="/docs" />
</EntityPage>
<EntityPage>
<OverviewContent path="/">
<WidgetA />
<WidgetB />
</OverviewContent>
<DocsRoute path="/docs" />
</EntityPage>
</CatalogRoute>
<DocsRoute path="/docs" />
<TechRadarRoute path="/tech-radar" width={1500} height={800} />
<GraphiQLRoute path="/graphiql" />
<LighthouseRoute path="/lighthouse" />
</BackstageRoutes>
);
```
As part of inverting the composition of the app, route refs and routing in general was somewhat broken, intentionally. Right now it's not really possible to easily route to different parts of the app from a plugin, or even different parts of the plugin that are not within the same router.
The core part of the experiment is to construct a map of ApiRef[] -> path overrides. Each key in the map is the list of route refs to traversed to reach a leaf in the routing tree, and the value is the path override at that point. For example, the above tree would add entries like [techDocsRouteRef] -> '/docs', and [entityRouteRef, apiDocsRouteRef] -> '/api'. By mapping out the entire app in this structure, the idea is that we can navigate to any point in the app using RouteRefs.
The RouteRefRegistry is an implementation of such a map, and the idea is to add it in master to make it a bit easier to experiment and iterate. This is not an exposed API at this point.
We've explored a couple of alternatives for how to enable routing, but it's boiled down to either a solution centred around the route map mentioned above, or treating all routes as static and globally unique, with no room for flexibility, customization or conflicts between different plugins. We're starting out pursuing this options 😁. We also expect that a the app-wide routing table will make things like dynamic loading a lot cleaner, as there would be a much more clear handoff between the main chunk and dynamic chunks.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core': minor
---
Fix dense in Structured Metadata Table
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/catalog-model': minor
'@backstage/plugin-catalog-backend': minor
---
Entirely case insensitive read path of entities
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/catalog-model': minor
---
Add the User & Group entities
A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog.
A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/catalog-model': minor
'@backstage/plugin-catalog-backend': minor
---
Add ApiDefinitionAtLocationProcessor that allows to load a API definition from another location
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/plugin-techdocs': minor
---
Add a message if techdocs takes long time to load
Fixes #2416.
The UI after the change should look like this:
![techdocs-progress-bar](https://user-images.githubusercontent.com/33940798/94189286-296ac980-fec8-11ea-9051-1b3db938d12f.gif)
+19
View File
@@ -0,0 +1,19 @@
---
'@backstage/plugin-techdocs-backend': minor
'@backstage/plugin-proxy-backend': minor
'@backstage/plugin-auth-backend': minor
'@backstage/create-app': minor
'@backstage/backend-common': minor
---
Add service discovery interface and implement for single host deployments
Fixes #1847, #2596
Went with an interface similar to the frontend DiscoveryApi, since it's dead simple but still provides a lot of flexibility in the implementation.
Also ended up with two different methods, one for internal endpoint discovery and one for external. The two use-cases are explained a bit more in the docs, but basically it's service-to-service vs callback URLs.
This did get me thinking about uniqueness and that we're heading towards a global namespace for backend plugin IDs. That's probably fine, but if we're happy with that we should leverage it a bit more to simplify the backend setup. For example we'd have each plugin provide its own ID and not manually mount on paths in the backend.
Draft until we're happy with the implementation, then I can add more docs and changelog entry. Also didn't go on a thorough hunt for places where discovery can be used, but I don't think there are many since it's been pretty awkward to do service-to-service communication.
+8
View File
@@ -0,0 +1,8 @@
---
'@backstage/backend-common': minor
'@backstage/create-app': minor
---
Make CSP configurable to fix app-backend served app not being able to fetch
See discussion [here on discord](https://discordapp.com/channels/687207715902193673/687235481154617364/758721460163575850)
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Move auth provider router creation to router
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Sync scaffolded backend with example
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-circleci': minor
---
Refactor to use DiscoveryApi
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Remove discovery api override
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-jenkins': patch
---
Refactor to use DiscoveryApi
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/plugin-auth-backend': minor
---
Initial implementation of catalog user lookup
This adds a basic catalog client + method for the Google provider to look up users in the catalog. It expects to find a single user entity in the catalog with a google.com/email annotation that matches the email of the Google profile.
Right now it falls back to the old behavior of splitting the email, since I don't wanna break the sign-in flow for existing apps, not yet anyway x).
- Added "@backstage/catalog-model@^0.1.1-alpha.23" as a dependency
- Added "node-fetch@^2.6.1" as a dependency
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': minor
---
Default to using internal scope for new plugins
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': minor
---
Use localhost to fall back to IPv4 if IPv6 isn't available
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/create-app': minor
---
Remove identity-backend
Not used, and we're heading down the route of identities in the catalog
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-catalog': minor
---
Created EntityNotFound component for catalog which displays the 404 page when entity is not found.
Fixes #2266
+17
View File
@@ -0,0 +1,17 @@
---
'@backstage/plugin-scaffolder': patch
---
Make title meaningful after component creation
Fixes #2458.
After the change, the UX should look like this:
### If the component creation was successful:
![successfully-created-component](https://user-images.githubusercontent.com/33940798/94339294-8bd1e000-0016-11eb-885b-7936fcc23b63.gif)
### If the component creation failed:
![failed-to-create-component](https://user-images.githubusercontent.com/33940798/94339296-90969400-0016-11eb-9a74-ce16b3dd8d88.gif)
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/plugin-catalog-backend': patch
---
Add codeowners processor
- Add `codeowners-utils@^1.0.2` as a dependency
- Add `core-js@^3.6.5` as a dependency
- Added new CodeOwnersProcessor
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/cli': patch
---
Add codeowners processor
- Include ESNext.Promise in TypeScript compilation
+22
View File
@@ -0,0 +1,22 @@
---
'@backstage/plugin-catalog-backend': minor
---
This feature works the same as \$secret does in config - it allows programmatic substitution of values into a document.
This is particularly useful e.g. for API type entities where you do not want to repeat your entire API spec document inside the catalog-info.yaml file. For those cases, you can instead do something like
```
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: my-federated-service
spec:
type: graphql
definition:
$text: ./schema.graphql
```
The textual content of that file will be injected as the value of definition, during each refresh loop. Both relative and absolute paths are supported, as well as any HTTP/HTTPS URL pointing to a service that returns the relevant data.
The initial version supports injection of text file data, and structured data from JSON and YAML files. You can add any handler of your own in addition to these.
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/create-app': minor
'@backstage/plugin-catalog-backend': minor
---
Allow node v14 and add to master build matrix
- Upgrade sqlite3@^5.0.0 in @backstage/plugin-catalog-backend
- Add Node 14 to engines in @backstage/create-app
+21
View File
@@ -0,0 +1,21 @@
---
'@backstage/plugin-cost-insights': minor
'@backstage/plugin-explore': minor
---
This PR adds Spotify's Cost Insights Tool. Cost Insights explains costs from cloud services in an understandable way, using software terms familiar to your engineers. This tool helps you and your team make trade-offs between cost optimization efforts and your other priorities.
Cost Insights features:
Daily cost graph by team or billing account
Cost comparison against configurable business metrics
Insights panels for configurable cloud products your company uses
Cost alerts and recommendations
Selectable time periods for month over month, or quarter over quarter cost comparison
Conversion of cost growth into average engineer cost (configurable) to help optimization trade-off decisions
![plugin-cost-insights](https://user-images.githubusercontent.com/3030003/94430416-e166d380-0161-11eb-891c-9ce10187683e.gif)
This PR adds the Cost Insights frontend React plugin with a defined CostInsightsApi. We include an example client with static data in the expected format. This API should talk with a cloud billing backend that aggregates billing data from your cloud provider.
Fixes #688 💵
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': minor
---
Upgrade dependency `esbuild@0.7.7`
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': minor
---
Simplify the read function in processors
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': minor
---
Lookup user in Google Auth Provider
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core': minor
---
Added EmptyState component
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-api-docs': patch
---
Resolve some dark mode styling issues in asyncAPI specs
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core': patch
---
Fixed banner component position in DismissableBanner component
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-catalog-backend': minor
---
Add the ability to import users from GitHub Organization into the catalog.
The token needs to have the scopes `user:email`, `read:user`, and `read:org`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-model': minor
---
Add the ability to import users from GitHub Organization into the catalog.
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/create-app': minor
---
Add the ability to import users from GitHub Organization into the catalog.
The token needs to have the scopes `user:email`, `read:user`, and `read:org`.
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/backend-common': minor
'@backstage/create-app': minor
---
Auto-create plugin databases
Relates to #1598.
This creates databases for plugins before handing off control to plugins.
The list of plugins currently need to be hard-coded depending on the installed plugins. A later PR will properly refactor the code to provide a factory pattern where plugins specify what they need, and Knex instances will be provided based on the input.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Update SSR template to pass CI
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Upgrade dependency rollup-plugin-typescript2 to ^0.27.3
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/plugin-api-docs': minor
---
There were some missing features and markdown was not rendered properly, but this is fixed now.
Details:
- [`asyncapi/asyncapi-react#149`](https://github.com/asyncapi/asyncapi-react/pull/149) - fix: improve markdown rendering of nested fields
- [`asyncapi/asyncapi-react#150`](https://github.com/asyncapi/asyncapi-react/pull/150) - feat: display the description of channels and operations
- [`asyncapi/asyncapi-react#153`](https://github.com/asyncapi/asyncapi-react/pull/153) - fix: let the list of `enums` break into multiple lines
+8
View File
@@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
+58
View File
@@ -0,0 +1,58 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [
[
"example-app",
"@backstage/backend-common",
"example-backend",
"@backstage/catalog-model",
"@backstage/cli-common",
"@backstage/cli",
"@backstage/config-loader",
"@backstage/config",
"@backstage/core-api",
"@backstage/core",
"@backstage/create-app",
"@backstage/dev-utils",
"docgen",
"e2e-test",
"storybook",
"@techdocs/cli",
"@backstage/test-utils-core",
"@backstage/test-utils",
"@backstage/theme",
"@backstage/plugin-api-docs",
"@backstage/plugin-app-backend",
"@backstage/plugin-auth-backend",
"@backstage/plugin-catalog-backend",
"@backstage/plugin-catalog",
"@backstage/plugin-circleci",
"@backstage/plugin-gcp-projects",
"@backstage/plugin-github-actions",
"@backstage/plugin-gitops-profiles",
"@backstage/plugin-graphiql",
"@backstage/plugin-graphql-backend",
"@backstage/plugin-jenkins",
"@backstage/plugin-lighthouse",
"@backstage/plugin-newrelic",
"@backstage/plugin-proxy-backend",
"@backstage/plugin-register-component",
"@backstage/plugin-rollbar-backend",
"@backstage/plugin-rollbar",
"@backstage/plugin-scaffolder-backend",
"@backstage/plugin-scaffolder",
"@backstage/plugin-sentry-backend",
"@backstage/plugin-sentry",
"@backstage/plugin-tech-radar",
"@backstage/plugin-techdocs-backend",
"@backstage/plugin-techdocs",
"@backstage/plugin-welcome"
]
],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
@@ -0,0 +1,6 @@
---
'example-backend': patch
'@backstage/create-app': patch
---
Bump @backstage/catalog-backend and pass the now required UrlReader interface to the plugin
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': minor
---
The default mount point for backend plugins have been changed to /api. These changes are done in the backend package itself, so it is recommended that you sync up existing backend packages with this new pattern.
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/backend-common': patch
---
Added new UrlReader interface for reading opaque data from URLs with different providers.
This new URL reading system is intended as a replacement for the various integrations towards
external systems in the catalog, scaffolder, and techdocs. It is configured via a new top-level
config section called 'integrations'.
Along with the UrlReader interface is a new UrlReaders class, which exposes static factory
methods for instantiating readers that can read from many different integrations simultaneously.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/config-loader': minor
---
Added support for new shorthand when defining secrets, where `$env: ENV` can be used instead of `$secret: { env: ENV }` etc.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': minor
---
The catalog backend UrlReaderProcessor now uses a UrlReader from @backstage/backend-common, which must now be supplied to the constructor.
+12
View File
@@ -6,3 +6,15 @@ coverage:
default:
threshold: 0% # Ref: https://docs.codecov.io/docs/codecovyml-reference#coveragestatus
target: auto
# Since Backstage is a mono repo, flags here help in getting the code coverage of individual packages.
# Documentation: https://docs.codecov.io/docs/flags
flags:
core:
paths:
- packages/core/
carryforward: true
core-api:
paths:
- packages/core-api/
carryforward: true
+2
View File
@@ -6,6 +6,8 @@
* @spotify/backstage-core
/docs/features/techdocs @spotify/techdocs-core
/plugins/cost-insights @spotify/silver-lining
/plugins/cloudbuild @trivago/ebarrios
/plugins/techdocs @spotify/techdocs-core
/plugins/techdocs-backend @spotify/techdocs-core
/packages/techdocs-cli @spotify/techdocs-core
+203
View File
@@ -0,0 +1,203 @@
abc
Apdex
api
Api
apis
args
asciidoc
async
Avro
backrub
Balachandran
Bigtable
Blackbox
bool
boolean
Chai
changeset
changesets
Changesets
changset
chanwit
Chanwit
cisphobia
cissexist
classname
cli
cncf
codeblocks
Codecov
codehilite
Codehilite
codeowners
config
Config
configs
const
cookiecutter
css
dariddler
deadnaming
destructured
dev
devs
discoverability
Discoverability
dls
docgen
Dockerfile
Dockerize
dockerode
Docusaurus
eg
Ek
env
Env
eslint
facto
failover
Figma
Firekube
Fredrik
github
Github
Gitlab
graphql
graphviz
Hackathons
haproxy
heroku
Hostname
http
https
img
incentivised
inlinehilite
interop
javascript
Javascript
jq
js
json
jsx
Kaewkasi
Knex
kubectl
kubernetes
learnings
lerna
Lerna
magiclink
mailto
Malus
md
microsite
middleware
minikube
Minikube
misgendering
mkdocs
Mkdocs
monorepo
Monorepo
monorepos
msw
namespace
Namespaces
neuro
newrelic
nginx
Niklas
nohoist
nonces
npm
nvm
oauth
Oauth
Okta
Oldsberg
onboarding
Onboarding
pagerduty
Patrik
Phoen
plantuml
Pomaceous
postgres
pre
prebaked
preconfigured
Preprarer
Prerequisities
productional
Protobuf
proxying
Proxying
pygments
pymdownx
Raghunandan
rankdir
readme
Readme
Redash
repo
Repo
repos
rerender
rollbar
Rollbar
Rollup
Rosaceae
rst
rsync
ruleset
sam
scaffolded
scaffolder
Scaffolder
semlas
Serverless
Sinon
smartsymobls
sparklines
Spotifiers
spotify
Spotify
squidfunk
src
subkey
superfences
Superfences
talkdesk
Talkdesk
tasklist
techdocs
templated
templater
Templater
templaters
Templaters
Thauer
theres
toc
tolerations
Tolerations
toolsets
touchpoints
ui
upvote
url
utils
validators
Voi
Wealthsimple
Weaveworks
xyz
yaml
Zalando
Zhou
Billett
cloudbuild
Grafana
Iain
Snyk
+19
View File
@@ -0,0 +1,19 @@
name: Changeset
on:
push:
branches:
- master
jobs:
create-release-pr:
name: Create Changeset PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Create Release Pull Request
uses: changesets/action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -26,7 +26,7 @@ jobs:
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
- name: find location of global yarn cache
id: yarn-cache
if: steps.cache-modules.outputs.cache-hit != 'true'
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
node-version: [12.x]
node-version: [12.x, 14.x]
env:
CI: true
@@ -37,7 +37,7 @@ jobs:
path: '**/node_modules'
# We use both yarn.lock and package.json as cache keys to ensure that
# changes to local monorepo packages bust the cache.
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
# If we get a cache hit for node_modules, there's no need to bring in the global
# yarn cache or run yarn install, as all dependencies will be installed already.
+71
View File
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: 'CodeQL'
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 8 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
@@ -0,0 +1,18 @@
name: Check Markdown files quality
on:
pull_request:
branches: [master]
paths:
- '**.md'
jobs:
check-all-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: documentation quality check
uses: errata-ai/vale-action@v1.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+3 -1
View File
@@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
node-version: [12.x]
node-version: [12.x, 14.x]
env:
CI: true
@@ -31,6 +31,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.1
- name: yarn install
run: yarn install --frozen-lockfile
+2 -2
View File
@@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [12.x]
node-version: [12.x, 14.x]
env:
CI: true
@@ -47,7 +47,7 @@ jobs:
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
- name: find location of global yarn cache
id: yarn-cache
if: steps.cache-modules.outputs.cache-hit != 'true'
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
node-version: [12.x]
node-version: [12.x, 14.x]
env:
CI: true
+7 -2
View File
@@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
node-version: [12.x]
node-version: [12.x, 14.x]
env:
CI: true
@@ -30,7 +30,7 @@ jobs:
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
- name: find location of global yarn cache
id: yarn-cache
if: steps.cache-modules.outputs.cache-hit != 'true'
@@ -63,15 +63,20 @@ jobs:
run: |
yarn lerna -- run test -- --coverage
bash <(curl -s https://codecov.io/bash)
# Upload code coverage for some specific flags. Also see .codecov.yml
bash <(curl -s https://codecov.io/bash) -f packages/core/coverage/* -F core
bash <(curl -s https://codecov.io/bash) -f packages/core-api/coverage/* -F core-api
# Publishes current version of packages that are not already present in the registry
- name: publish
if: matrix.node-version == '12.x'
run: yarn lerna -- publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Tags the commit with the version in the core package if the tag doesn't exist
- uses: Klemensas/action-autotag@1.2.3
if: matrix.node-version == '12.x'
with:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
package_root: 'packages/core'
+5 -1
View File
@@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
node-version: [12.x]
node-version: [12.x, 14.x]
env:
CI: true
@@ -33,6 +33,10 @@ jobs:
run: yarn install --frozen-lockfile
working-directory: microsite
- name: prettier
run: yarn prettier:check
working-directory: microsite
- name: build microsite
run: yarn build
working-directory: microsite
+77
View File
@@ -0,0 +1,77 @@
name: Nightly Snapshot Release
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v2
# Beginning of yarn setup, keep in sync between all workflows, see ci.yml
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
- name: cache all node_modules
id: cache-modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
- name: find location of global yarn cache
id: yarn-cache
if: steps.cache-modules.outputs.cache-hit != 'true'
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: cache global yarn cache
uses: actions/cache@v2
if: steps.cache-modules.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
run: yarn install --frozen-lockfile
# End of yarn setup
# No verification done here, only build & publish. If the master branch
# is broken we will see that from those builds, but we still want to push nightly
# builds since upgrading to them is a manual process anyway.
- name: tsc
run: yarn tsc
- name: build
run: yarn build
# Prepares a nightly release version of any package with pending changesets
- name: prepare nightly release
run: yarn changeset version --snapshot nightly
# Publishes the nightly release to NPM, by using tag we make sure the release is
# not flagged as the latest release, which means that people will not get this
# version of the package unless requested explicitly
- name: publish nightly release
run: yarn changeset publish --tag nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Discord notification
if: ${{ failure() }}
uses: Ilshidur/action-discord@0.2.0
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Nightly build failed https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}}'
-33
View File
@@ -1,33 +0,0 @@
name: Scaffolder
on:
pull_request:
paths:
- '.github/workflows/scaffolder.yml'
- './plugins/scaffolder-backend/scripts'
push:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7]
name: Build Container
steps:
- uses: actions/checkout@v2
# Build Docker Image
- name: Build and push Docker images
uses: docker/build-push-action@v1.1.0
with:
path: plugins/scaffolder-backend/scripts
dockerfile: plugins/scaffolder-backend/scripts/Cookiecutter.dockerfile
registry: docker.pkg.github.com
repository: ${{ github.repository }}/cookiecutter
username: ${{ github.actor }}
password: ${{ github.token }}
tag_with_ref: true
push: true
+5
View File
@@ -0,0 +1,5 @@
{
"ignoredFiles": [
"docs/assets/**/*.svg"
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
.yarn
dist
microsite/build
microsite
coverage
*.hbs
templates
+4
View File
@@ -0,0 +1,4 @@
StylesPath = .github/styles
[*.md]
BasedOnStyles = Vale
+30
View File
@@ -8,6 +8,36 @@ If you encounter issues while upgrading to a newer version, don't hesitate to re
> Collect changes for the next release below
## v0.1.1-alpha.24
### Backend (example-backend, or backends created with @backstage/create-app)
- The default mount point for backend plugins have been changed to `/api`. These changes are done in the backend package itself, so it is recommended that you sync up existing backend packages with this new pattern. [#2562](https://github.com/spotify/backstage/pull/2562)
- A service discovery mechanism for backend plugins has been added, and is now a requirement for several backend plugins. See [packages/backend/src/index.ts](./packages/backend/src/index.ts) for how to set it up using `SingleHostDiscovery` from `@backstage/backend-common`. Note that the default base path for plugins is set to `/api` to that change, but it can be set to use the old behavior via the `basePath` option. [#2600](https://github.com/spotify/backstage/pull/2600)
### @backstage/auth-backend
- The default mount path of backend plugins was changed to `/api/:pluginId`, and as part of that it was needed to enable configuration of the base path of the auth backend, so that it can construct redirect URLs correctly. Note that you will also need to reconfigure any allowed redirect URLs to include `/api` if you switch to the new recommended pattern. [#2562](https://github.com/spotify/backstage/pull/2562)
- The auth backend now requires an implementation of `PluginEndpointDiscovery` from `@backstage/backend-common` to be passed in as `discovery`. See the changes to `@backstage/backend`.
### @backstage/proxy-backend
- The proxy backend now requires an implementation of `PluginEndpointDiscovery` from `@backstage/backend-common` to be passed in as `discovery`. See the changes to `@backstage/backend`.
### @backstage/techdocs-backend
- The TechDocs backend now requires an implementation of `PluginEndpointDiscovery` from `@backstage/backend-common` to be passed in as `discovery`. See the changes to `@backstage/backend`.
### @backstage/plugin-identity-backend
- This plugin was removed, remove it from your backend if it's there. [#2616](https://github.com/spotify/backstage/pull/2616)
## v0.1.1-alpha.23
### @backstage/core
- Renamed `SessionStateApi` to `SessionApi` and `logout` to `signOut`. Custom implementations of the `SingInPage` app-component will need to rename their `logout` function. The different auth provider items for the `UserSettingsMenu` have been consolidated into a single `ProviderSettingsItem`, meaning you need to replace existing usages of `OAuthProviderSettings` and `OIDCProviderSettings`. [#2555](https://github.com/spotify/backstage/pull/2555).
## v0.1.1-alpha.22
### @backstage/core
+22 -1
View File
@@ -28,10 +28,14 @@ What kind of plugins should/could be created? Some inspiration from the 120+ plu
## Suggesting a plugin
If you start developing a plugin that you aim to release as open source, we suggest that you create a new [new Issue](https://github.com/spotify/backstage/issues/new?labels=plugin&template=plugin_template.md&title=%5BPlugin%5D+THE+PLUGIN+NAME). This helps the community know what plugins are in development.
If you start developing a plugin that you aim to release as open source, we suggest that you create a [new Issue](https://github.com/spotify/backstage/issues/new?labels=plugin&template=plugin_template.md&title=%5BPlugin%5D+THE+PLUGIN+NAME). This helps the community know what plugins are in development.
You can also use this process if you have an idea for a good plugin but you hope that someone else will pick up the work.
## Adding Non-code Contributions
Since there is such a large landscape of possible development, build, and deployment environments, we welcome community contributions in these areas in the [`/contrib`](https://github.com/spotify/backstage/tree/master/contrib) folder of the project. This is an excellent place to put things that help out the community at large, but which may not fit within the scope of the core product to support natively. Here, you will find Helm charts, alternative Docker images, and much more.
## Write Documentation
The current documentation is very limited. Help us make the `/docs` folder come alive.
@@ -72,6 +76,23 @@ If you're contributing to the backend or CLI tooling, be mindful of cross-platfo
Also be sure to skim through our [ADRs](https://github.com/spotify/backstage/tree/master/docs/architecture-decisions) to see if they cover what you're working on. In particular [ADR006: Avoid React.FC and React.SFC](https://github.com/spotify/backstage/blob/master/docs/architecture-decisions/adr006-avoid-react-fc.md) is one to look out for.
If there are any updates in `markdown` file please make sure to run `yarn run lint:docs`. Though it is checked on `lint-staged`. It is required to install [vale](https://docs.errata.ai/vale/install) separately and make sure it is accessed by global command.
# Creating Changesets
We use [changesets](https://github.com/atlassian/changesets) to help us prepare releases. It helps us make sure that every package affected by a change gets a proper version number and an entry in its `CHANGELOG.md`. To make the process of generating releases easy. it helps when contributors include changesets with their pull requests.
## To create a changeset
1. Run `yarn changeset`
2. Select which packages you want to include a changeset for
3. Select impact of change that you're introducing (minor, major or patch)
4. Add generated changset to Git
5. Push the commit with your changeset to the branch associated with your PR
6. Accept our gratitude for making the release process easier on the maintainer
For more information, checkout [adding a changeset](https://github.com/atlassian/changesets/blob/master/docs/adding-a-changeset.md) documentation in changesets repository.
# Code of Conduct
This project adheres to the [Spotify FOSS Code of Conduct][code-of-conduct]. By participating, you are expected to honor this code.
+1 -1
View File
@@ -4,7 +4,7 @@
Deploying to heroku is relatively easy following these steps.
First, make sure you have the [heroku CLI installed](https://devcenter.heroku.com/articles/heroku-cli) and log into it as well as loging into Heroku's [container registry](https://devcenter.heroku.com/articles/container-registry-and-runtime).
First, make sure you have the [heroku CLI installed](https://devcenter.heroku.com/articles/heroku-cli) and log into it as well as login into Heroku's [container registry](https://devcenter.heroku.com/articles/container-registry-and-runtime).
```bash
$ heroku login
+3 -3
View File
@@ -26,6 +26,8 @@ Out of the box, Backstage includes:
For more information go to [backstage.io](https://backstage.io) or join our [Discord chatroom](https://discord.gg/EBHEGzX).
🎉 Backstage is a CNCF Sandbox project. Read the announcement [here](https://backstage.io/blog/2020/09/23/backstage-cncf-sandbox).
## Project roadmap
A detailed project roadmap, including already delivered milestones, is available [here](https://backstage.io/docs/overview/roadmap).
@@ -51,11 +53,9 @@ Check out [the documentation](https://backstage.io/docs/getting-started) on how
- [Code of Conduct](CODE_OF_CONDUCT.md) - This is how we roll
- [Adopters](ADOPTERS.md) - Companies already using Backstage
- [Blog](https://backstage.io/blog/) - Announcements and updates
- [Newsletter](https://mailchi.mp/spotify/backstage-community)
- [Newsletter](https://mailchi.mp/spotify/backstage-community) - Subscribe to our email newsletter
- Give us a star ⭐️ - If you are using Backstage or think it is an interesting project, we would love a star ❤️
Or, if you are an open source developer and are interested in joining our team, please reach out to [foss-opportunities@spotify.com ](mailto:foss-opportunities@spotify.com)
## License
Copyright 2020 Spotify AB.
+2
View File
@@ -9,3 +9,5 @@ backend:
origin: http://localhost:3000
methods: [GET, POST, PUT, DELETE]
credentials: true
csp:
connect-src: ["'self'", 'http:', 'https:']
+134 -93
View File
@@ -9,32 +9,37 @@ backend:
database:
client: sqlite3
connection: ':memory:'
csp:
connect-src: ["'self'", 'https:']
# See README.md in the proxy-backend plugin for information on the configuration format
proxy:
'/circleci/api':
target: https://circleci.com/api/v1.1
changeOrigin: true
pathRewrite:
'^/proxy/circleci/api/': '/'
headers:
Circle-Token:
$secret:
env: CIRCLECI_AUTH_TOKEN
$env: CIRCLECI_AUTH_TOKEN
'/jenkins/api':
target: http://localhost:8080
headers:
Authorization:
$secret:
env: JENKINS_BASIC_AUTH_HEADER
$env: JENKINS_BASIC_AUTH_HEADER
'/travisci/api':
target: https://api.travis-ci.com
changeOrigin: true
headers:
Authorization:
$env: TRAVISCI_AUTH_TOKEN
travis-api-version: 3
organization:
name: Spotify
techdocs:
storageUrl: http://localhost:7000/techdocs/static/docs
requestUrl: http://localhost:7000/techdocs/docs
storageUrl: http://localhost:7000/api/techdocs/static/docs
requestUrl: http://localhost:7000/api/techdocs
generators:
techdocs: 'docker'
@@ -44,8 +49,7 @@ sentry:
rollbar:
organization: spotify
accountToken:
$secret:
env: ROLLBAR_ACCOUNT_TOKEN
$env: ROLLBAR_ACCOUNT_TOKEN
newrelic:
api:
@@ -55,157 +59,194 @@ newrelic:
lighthouse:
baseUrl: http://localhost:3003
kubernetes:
clusterLocatorMethod: 'configMultiTenant'
clusters: []
integrations:
github:
- host: github.com
token:
$env: GITHUB_PRIVATE_TOKEN
### Example for how to add your GitHub Enterprise instance using the API:
# - host: ghe.example.net
# apiBaseUrl: https://ghe.example.net/api/v3
# token:
# $env: GHE_PRIVATE_TOKEN
### Example for how to add your GitHub Enterprise instance using raw HTTP fetches (token is optional):
# - host: ghe.example.net
# rawBaseUrl: https://ghe.example.net/raw
# token:
# $env: GHE_PRIVATE_TOKEN
gitlab:
- host: gitlab.com
token:
$env: GITLAB_PRIVATE_TOKEN
bitbucket:
- host: bitbucket.org
username:
$env: BITBUCKET_USERNAME
appPassword:
$env: BITBUCKET_APP_PASSWORD
azure:
- host: dev.azure.com
token:
$env: AZURE_PRIVATE_TOKEN
catalog:
rules:
- allow: [Component, API, Group, Template, Location]
- allow: [Component, API, Group, User, Template, Location]
processors:
github:
githubOrg:
providers:
- target: https://github.com
token:
$secret:
env: GITHUB_PRIVATE_TOKEN
$env: GITHUB_PRIVATE_TOKEN
#### Example for how to add your GitHub Enterprise instance using the API:
# - target: https://ghe.example.net
# apiBaseUrl: https://ghe.example.net/api/v3
# token:
# $secret:
# env: GHE_PRIVATE_TOKEN
#### Example for how to add your GitHub Enterprise instance using raw HTTP fetches (token is optional):
# - target: https://ghe.example.net
# rawBaseUrl: https://ghe.example.net/raw
# token:
# $secret:
# env: GHE_PRIVATE_TOKEN
bitbucketApi:
username:
$secret:
env: BITBUCKET_USERNAME
appPassword:
$secret:
env: BITBUCKET_APP_PASSWORD
gitlabApi:
privateToken:
$secret:
env: GITLAB_PRIVATE_TOKEN
azureApi:
privateToken:
$secret:
env: AZURE_PRIVATE_TOKEN
# $env: GHE_PRIVATE_TOKEN
ldapOrg:
### Example for how to add your enterprise LDAP server
# providers:
# - target: ldaps://ds.example.net
# bind:
# dn: uid=ldap-reader-user,ou=people,ou=example,dc=example,dc=net
# secret: { $secret: { env: LDAP_SECRET } }
# users:
# dn: ou=people,ou=example,dc=example,dc=net
# options:
# filter: (uid=*)
# map:
# description: l
# groups:
# dn: ou=access,ou=groups,ou=example,dc=example,dc=net
# options:
# filter: (&(objectClass=some-group-class)(!(groupType=email)))
locations:
# Backstage example components
- type: github
- type: url
target: https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/all-components.yaml
# Example component for github-actions
- type: github
- type: url
target: https://github.com/spotify/backstage/blob/master/plugins/github-actions/examples/sample.yaml
# Example component for techdocs
- type: github
- type: url
target: https://github.com/spotify/backstage/blob/master/plugins/techdocs-backend/examples/documented-component/documented-component.yaml
# Backstage example APIs
- type: github
- type: url
target: https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/all-apis.yaml
# Backstage example templates
- type: github
- type: url
target: https://github.com/spotify/backstage/blob/master/plugins/scaffolder-backend/sample-templates/all-templates.yaml
scaffolder:
github:
token:
$secret:
env: GITHUB_ACCESS_TOKEN
$env: GITHUB_ACCESS_TOKEN
visibility: public # or 'internal' or 'private'
gitlab:
api:
baseUrl: https://gitlab.com
token:
$secret:
env: GITLAB_ACCESS_TOKEN
$env: GITLAB_ACCESS_TOKEN
azure:
baseUrl: https://dev.azure.com/{your-organization}
api:
token:
$env: AZURE_PRIVATE_TOKEN
auth:
providers:
google:
development:
clientId:
$secret:
env: AUTH_GOOGLE_CLIENT_ID
$env: AUTH_GOOGLE_CLIENT_ID
clientSecret:
$secret:
env: AUTH_GOOGLE_CLIENT_SECRET
$env: AUTH_GOOGLE_CLIENT_SECRET
github:
development:
clientId:
$secret:
env: AUTH_GITHUB_CLIENT_ID
$env: AUTH_GITHUB_CLIENT_ID
clientSecret:
$secret:
env: AUTH_GITHUB_CLIENT_SECRET
$env: AUTH_GITHUB_CLIENT_SECRET
enterpriseInstanceUrl:
$secret:
env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL
$env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL
gitlab:
development:
clientId:
$secret:
env: AUTH_GITLAB_CLIENT_ID
$env: AUTH_GITLAB_CLIENT_ID
clientSecret:
$secret:
env: AUTH_GITLAB_CLIENT_SECRET
$env: AUTH_GITLAB_CLIENT_SECRET
audience:
$secret:
env: GITLAB_BASE_URL
$env: GITLAB_BASE_URL
saml:
entryPoint: 'http://localhost:7001/'
issuer: 'passport-saml'
okta:
development:
clientId:
$secret:
env: AUTH_OKTA_CLIENT_ID
$env: AUTH_OKTA_CLIENT_ID
clientSecret:
$secret:
env: AUTH_OKTA_CLIENT_SECRET
$env: AUTH_OKTA_CLIENT_SECRET
audience:
$secret:
env: AUTH_OKTA_AUDIENCE
$env: AUTH_OKTA_AUDIENCE
oauth2:
development:
clientId:
$secret:
env: AUTH_OAUTH2_CLIENT_ID
$env: AUTH_OAUTH2_CLIENT_ID
clientSecret:
$secret:
env: AUTH_OAUTH2_CLIENT_SECRET
$env: AUTH_OAUTH2_CLIENT_SECRET
authorizationUrl:
$secret:
env: AUTH_OAUTH2_AUTH_URL
$env: AUTH_OAUTH2_AUTH_URL
tokenUrl:
$secret:
env: AUTH_OAUTH2_TOKEN_URL
$env: AUTH_OAUTH2_TOKEN_URL
auth0:
development:
clientId:
$secret:
env: AUTH_AUTH0_CLIENT_ID
$env: AUTH_AUTH0_CLIENT_ID
clientSecret:
$secret:
env: AUTH_AUTH0_CLIENT_SECRET
$env: AUTH_AUTH0_CLIENT_SECRET
domain:
$secret:
env: AUTH_AUTH0_DOMAIN
$env: AUTH_AUTH0_DOMAIN
microsoft:
development:
clientId:
$secret:
env: AUTH_MICROSOFT_CLIENT_ID
$env: AUTH_MICROSOFT_CLIENT_ID
clientSecret:
$secret:
env: AUTH_MICROSOFT_CLIENT_SECRET
$env: AUTH_MICROSOFT_CLIENT_SECRET
tenantId:
$secret:
env: AUTH_MICROSOFT_TENANT_ID
$env: AUTH_MICROSOFT_TENANT_ID
costInsights:
engineerCost: 200000
products:
computeEngine:
name: Compute Engine
icon: compute
cloudDataflow:
name: Cloud Dataflow
icon: data
cloudStorage:
name: Cloud Storage
icon: storage
bigQuery:
name: Big Query
icon: search
metrics:
dailyCost:
name: Your Company's Daily Cost
DAU:
name: Cost Per DAU
homepage:
clocks:
- label: UTC
timzone: UTC
- label: NYC
timezone: 'America/New_York'
- label: STO
timezone: 'Europe/Stockholm'
- label: TYO
timezone: 'Asia/Tokyo'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 KiB

@@ -1,4 +1,4 @@
FROM node:12 AS build
FROM node:12-buster AS build
RUN mkdir /app
COPY . /app
@@ -0,0 +1,58 @@
### Source repo: https://github.com/johnson-jesse/simple-backstage-app-plugin
ExampleComponent.tsx reference
```tsx
import React, { FC } from 'react';
import { Typography, Grid } from '@material-ui/core';
import {
InfoCard,
Header,
Page,
pageTheme,
Content,
ContentHeader,
HeaderLabel,
SupportButton,
identityApiRef,
} from '@backstage/core';
import { useApi } from '@backstage/core-api';
import ExampleFetchComponent from '../ExampleFetchComponent';
const ExampleComponent: FC<{}> = () => {
const identityApi = useApi(identityApiRef);
const userId = identityApi.getUserId();
const profile = identityApi.getProfile();
return (
<Page theme={pageTheme.tool}>
<Header
title="Welcome to github-playground!"
subtitle="Optional subtitle"
>
<HeaderLabel label="Owner" value="Team X" />
<HeaderLabel label="Lifecycle" value="Alpha" />
</Header>
<Content>
<ContentHeader title="Plugin title">
<SupportButton>A description of your plugin goes here.</SupportButton>
</ContentHeader>
<Grid container spacing={3} direction="column">
<Grid item>
<InfoCard title={userId}>
<Typography variant="body1">
{`${profile.displayName} | ${profile.email}`}
</Typography>
</InfoCard>
</Grid>
<Grid item>
<ExampleFetchComponent />
</Grid>
</Grid>
</Content>
</Page>
);
};
export default ExampleComponent;
```
@@ -0,0 +1,111 @@
### Source repo: https://github.com/johnson-jesse/simple-backstage-app-plugin
ExampleFetchComponent.tsx reference
```tsx
import React, { FC } from 'react';
import { useAsync } from 'react-use';
import Alert from '@material-ui/lab/Alert';
import {
Table,
TableColumn,
Progress,
githubAuthApiRef,
} from '@backstage/core';
import { useApi } from '@backstage/core-api';
import { graphql } from '@octokit/graphql';
const query = `{
viewer {
repositories(first: 100) {
totalCount
nodes {
name
createdAt
description
diskUsage
isFork
}
pageInfo {
endCursor
hasNextPage
}
}
}
}`;
type Node = {
name: string;
createdAt: string;
description: string;
diskUsage: number;
isFork: boolean;
};
type Viewer = {
repositories: {
totalCount: number;
nodes: Node[];
pageInfo: {
endCursor: string;
hasNextPage: boolean;
};
};
};
type DenseTableProps = {
viewer: Viewer;
};
export const DenseTable: FC<DenseTableProps> = ({ viewer }) => {
const columns: TableColumn[] = [
{ title: 'Name', field: 'name' },
{ title: 'Created', field: 'createdAt' },
{ title: 'Description', field: 'description' },
{ title: 'Disk Usage', field: 'diskUsage' },
{ title: 'Fork', field: 'isFork' },
];
return (
<Table
title="List Of User's Repositories"
options={{ search: false, paging: false }}
columns={columns}
data={viewer.repositories.nodes}
/>
);
};
const ExampleFetchComponent: FC<{}> = () => {
const auth = useApi(githubAuthApiRef);
const { value, loading, error } = useAsync(async (): Promise<any> => {
const token = await auth.getAccessToken();
const gqlEndpoint = graphql.defaults({
// Uncomment baseUrl if using enterprise
// baseUrl: 'https://github.MY-BIZ.com/api',
headers: {
authorization: `token ${token}`,
},
});
const { viewer } = await gqlEndpoint(query);
return viewer;
}, []);
if (loading) return <Progress />;
if (error) return <Alert severity="error">{error.message}</Alert>;
if (value && value.repositories) return <DenseTable viewer={value} />;
return (
<Table
title="List Of User's Repositories"
options={{ search: false, paging: false }}
columns={[]}
data={[]}
/>
);
};
export default ExampleFetchComponent;
```
+9 -10
View File
@@ -86,7 +86,7 @@ well-known tech and a large flora of components.
### What technology does Backstage use?
The code base is a large-scale React application that uses TypeScript. For
The codebase is a large-scale React application that uses TypeScript. For
[Phase 2](https://github.com/spotify/backstage#project-roadmap), we plan to use
Node.js and GraphQL.
@@ -132,20 +132,19 @@ to see if it already exists or is in the works. If no one's thought of it yet,
great! Open a new issue as
[a plugin suggestion](https://github.com/spotify/backstage/issues/new/choose)
and describe what your plugin will do. This will help coordinate our
contributors' efforts and avoid duplicating existing functionality. In the
future, we will create
[a plugin gallery](https://github.com/spotify/backstage/issues/260) where people
can browse and search for all available plugins.
contributors' efforts and avoid duplicating existing functionality.
You can browse and search for all available plugins in the
[Plugin Marketplace](https://backstage.io/plugins).
### Which plugin is used the most at Spotify?
By far, our most-used plugin is our TechDocs plugin, which we use for creating
technical documentation. Our philosophy at Spotify is to treat "docs like code",
where you write documentation using the same workflow as you write your code.
This makes it easier to create, find, and update documentation. We hope to
release
[the open source version](https://github.com/spotify/backstage/issues/687) in
the future. (See also:
This makes it easier to create, find, and update documentation.
[TechDocs is now open source.](https://backstage.io/docs/features/techdocs/techdocs-overview)
(See also:
"[Will Spotify's internal plugins be open sourced, too?](#will-spotifys-internal-plugins-be-open-sourced-too)"
above)
@@ -205,7 +204,7 @@ Please report sensitive security issues via Spotify's
### Does Backstage collect any information that is shared with Spotify?
No. Backstage does not collect any telemetry from any third party using the
platform. Spotify, and the open source community, does have access to
platform. Spotify, and the open source community, do have access to
[GitHub Insights](https://github.com/features/insights), which contains
information such as contributors, commits, traffic, and dependencies. Backstage
is an open platform, but you are in control of your own data. You control who
+4 -4
View File
@@ -97,7 +97,7 @@ app, and the app itself.
### Core APIs
Starting with the Backstage core library, it provides implementation for all of
Starting with the Backstage core library, it provides implementations for all of
the core APIs. The core APIs are the ones exported by `@backstage/core`, such as
the `errorApiRef` and `configApiRef`. You can find a full list of them
[here](../reference/utility-apis/README.md).
@@ -113,7 +113,7 @@ While doing so they should usually also provide default implementations of their
own APIs, for example, the `catalog` plugin exports `catalogApiRef`, and also
supplies a default `ApiFactory` of that API using the `CatalogClient`. There is
one restriction to plugin-provided API Factories: plugins may not supply
factories for core APIs, trying to do so will cause the app to crash.
factories for core APIs, trying to do so will cause the app to refuse to start.
Plugins supply their APIs through the `apis` option of `createPlugin`, for
example:
@@ -248,8 +248,8 @@ directly tied to React.
The indirection provided by Utility APIs also makes it straightforward to test
components that depend on APIs, and to provide a standard common development
environment for plugins. A proper test wrapper with mocked API implementations
is not yet ready, but it will provided as a part of `@backstage/test-utils`. It
will provide mocked variants of APIs, with additional methods for asserting a
is not yet ready, but it will be provided as a part of `@backstage/test-utils`.
It will provide mocked variants of APIs, with additional methods for asserting a
component's interaction with the API.
The common development environment for plugins is included in
@@ -22,7 +22,7 @@ This ADR describes the default format of these descriptor files.
### Inspiration
Internally at Spotify, a home grown software catalog system is used heavily and
Internally at Spotify, a homegrown software catalog system is used heavily and
forms a core part of Backstage and other important pieces of the infrastructure.
The user experience, learnings and certain pieces of metadata from that catalog
are being carried over to the open source effort.
@@ -40,7 +40,7 @@ triggers from the version control system, etc.
Each file describes one or more entities in accordance with the
[Backstage System Model](https://github.com/spotify/backstage/issues/390). All
of these entities have a common stucture and nomenclature, and they are stored
of these entities have a common structure and nomenclature, and they are stored
in the software catalog from which they then can be queried.
Entities have distinct names, and they may reference each other by those names.
@@ -44,7 +44,7 @@ A summary:
name each.
Using named exports helps prevent needing to rename symbols, which has myriad
benefts. A few are:
benefits. A few are:
- IDE tools like "Find All References" and "Go To Definition" function
- Manual codebase searching ("grep", etc) is easier with a unique symbol
@@ -22,8 +22,8 @@ or
We currently do not use any pattern for how to structure exports. There is a mix
of package-level re-exports deep into the directory tree, shallow re-exports for
each directory, exports using `*` and explicit lists of each symbol, etc. The
mix and lack of predictability makes it difficult to reason about the boundaries
of a module, and for example knowing whether is is safe to export a symbol in a
mix and lack of predictability make it difficult to reason about the boundaries
of a module, and for example knowing whether it is safe to export a symbol in a
given file.
## Decision
@@ -13,7 +13,7 @@ with next to no benefits in combination with a few downsides.
The main reasons were:
- **children props** were implicitly added
- **Generic Type** were not supported on children
- **Generic Type** was not supported on children
Read more about the removal in
[this PR](https://github.com/facebook/create-react-app/pull/8177).
@@ -25,7 +25,7 @@ should be avoided in our codebase when adding new code.
Here is an example:
```ts
```typescript
/* Avoid this: */
type BadProps = { text: string };
const BadComponent: FC<BadProps> = ({ text, children }) => (
@@ -11,7 +11,7 @@ tests, unit tests to e2e tests always have their own implementation of mocking
these requests. There's been traction in the outer community towards using this
library to mock network requests by using an express style declaration for
routes. react-testing-library suggests using this library instead of mocking
fetch directly wether this be in a browser or in node.
fetch directly whether this be in a browser or in node.
https://github.com/mswjs/msw
@@ -7,7 +7,7 @@ description: Architecture Decision Record (ADR) log on Default Catalog File Name
## Background
While the spec for the catalog file format is well described in
[ADR002](./adr002-default-catalog-file-format.md), guidance was note provided as
[ADR002](./adr002-default-catalog-file-format.md), guidance was not provided as
to the name of the catalog file.
Following discussion in
@@ -23,4 +23,4 @@ catalog-info.yaml
```
This name is a default, **not a requirement**. The catalog file will work with
Backstage irregardless of its name.
Backstage regardless of its name.
@@ -0,0 +1,69 @@
---
id: adrs-adr009
title: ADR009: Entity References
description: Architecture Decision Record (ADR) log on Entity References
---
## Background
While the spec for the catalog file format is well described in
[ADR002](./adr002-default-catalog-file-format.md), guidance was not provided as
to how one is expected to express references to other entities in the catalog.
There was also some confusion on how to reference entities in URLs in the
Backstage frontend.
Following discussion in
[Issue 1947](https://github.com/spotify/backstage/issues/1947), a decision was
made.
## Entity References in YAML files
The textual format, as written by humans, to reference entities by name is on
the following form, where square brackets denote optionality:
```
[<kind>:][<namespace>/]<name>
```
That is, it is composed of between one and three parts in this specific order,
without any additional encoding, with those exact separator characters.
Optionality of `kind` and `namespace` are contextual, and they may or may not
have default contextual fallback values.
When that format is insufficient or when machine made interchange formats wish
to express such relations in a more expressive form, a nested structure on the
following form can be used:
```yaml
kind: <kind>
namespace: <namespace>
name: <name>
```
Of these, only `name` is always required. Optionality of `kind` and `namespace`
are contextual, and they may or may not have default contextual fallback values.
All other possible key values in this structure are reserved for future use.
A system or user wanting to express a full entity name that is always valid,
shall supply the entire triplet whether using the string form or the compound
form.
A full description of the format can be found
[in the documentation](https://backstage.io/docs/features/software-catalog/references).
## Entity References in URLs
Where entities are referenced by name in the Backstage frontend, the URL
containing the reference shall take the following form:
```
:namespace/:kind/:name
```
All three parts are required under all circumstances. The default value for the
`namespace` in the catalog is the string `"default"`, if the entity does not
specify one explicitly in `metadata.namespace`.
This means that we do not encourage the string form of entity references to be
used as a single URL segment, due to the use of URL-unsafe characters leading to
possible risk, confusion, and uglier URLs.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

After

Width:  |  Height:  |  Size: 201 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 44 KiB

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