From cb6742c15ef9edb9af670cc9f2bd5ff8f0d933ba Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Tue, 23 Jun 2020 17:51:48 +0200 Subject: [PATCH 01/53] feat(mkdocs): WIP extensions for markdown --- plugins/techdocs/mkdocs/container/Dockerfile | 4 +- .../container/techdocs-core/src/core.py | 64 ++++++++++++++++--- .../techdocs/mkdocs/mock-docs/docs/index.md | 3 + plugins/techdocs/mkdocs/mock-docs/mkdocs.yml | 3 +- 4 files changed, 62 insertions(+), 12 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/Dockerfile b/plugins/techdocs/mkdocs/container/Dockerfile index 1ae66589b6..05c129033f 100644 --- a/plugins/techdocs/mkdocs/container/Dockerfile +++ b/plugins/techdocs/mkdocs/container/Dockerfile @@ -15,8 +15,8 @@ FROM python:3.7.7-alpine3.12 -RUN apk update && apk --no-cache add gcc musl-dev -RUN pip install mkdocs==1.1.2 mkdocs-material==5.3.2 +RUN apk update && apk --no-cache add gcc musl-dev graphviz +RUN pip install --upgrade pip && pip install mkdocs==1.1.2 mkdocs-material==5.3.2 pymdown-extensions==7.1 markdown_inline_graphviz_extension==1.1 plantuml-markdown==3.2.2 markdown-katex==202006.1021 ADD ./techdocs-core /techdocs-core RUN pip install --no-index /techdocs-core diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py index e42a60d28b..d9c33b2167 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py @@ -21,15 +21,63 @@ from mkdocs.contrib.search import SearchPlugin class TechDocsCore(BasePlugin): def on_config(self, config): - # Theme - config['theme'] = Theme(name="material") + # Theme + config['theme'] = Theme(name="material") - # Plugins - del config['plugins']['techdocs-core'] + # Plugins + del config['plugins']['techdocs-core'] - search_plugin = SearchPlugin() - search_plugin.load_config({}) - config['plugins']['search'] = search_plugin + search_plugin = SearchPlugin() + search_plugin.load_config({}) + config['plugins']['search'] = search_plugin - return config + # Markdown Extensions + print(config) + config['markdown_extensions'].append('admonition') + config['markdown_extensions'].append('abbr') + config['markdown_extensions'].append('attr_list') + config['markdown_extensions'].append('def_list') + config['markdown_extensions'].append('codehilite') + config['mdx_configs']['codehilite'] = { + 'linenums': True, + 'guess_lang': False, + 'pygments_style': 'friendly', + } + config['markdown_extensions'].append('toc') + config['mdx_configs']['toc'] = { + 'permalink': True, + } + config['markdown_extensions'].append('footnotes') + config['markdown_extensions'].append('markdown.extensions.tables') + config['markdown_extensions'].append('markdown_inline_graphviz') + config['markdown_extensions'].append('plantuml_markdown') + config['markdown_extensions'].append('markdown_katex') + config['mdx_configs']['markdown_katex'] = { + 'no_inline_svg': True, + 'insert_fonts_css': True, + } + config['markdown_extensions'].append('pymdownx.betterem') + config['mdx_configs']['pymdownx.betterem'] = { + 'smart_enable': 'all', + } + config['markdown_extensions'].append('pymdownx.caret') + config['markdown_extensions'].append('pymdownx.critic') + config['markdown_extensions'].append('pymdownx.details') + config['markdown_extensions'].append('pymdownx.emoji') + config['mdx_configs']['pymdownx.emoji'] = { + 'emoji_generator': '!!python/name:pymdownx.emoji.to_svg', + } + config['markdown_extensions'].append('pymdownx.inlinehilite') + config['markdown_extensions'].append('pymdownx.magiclink') + config['markdown_extensions'].append('pymdownx.mark') + config['markdown_extensions'].append('pymdownx.smartsymbols') + config['markdown_extensions'].append('pymdownx.superfences') + config['markdown_extensions'].append('pymdownx.tasklist') + config['mdx_configs']['pymdownx.tasklist'] = { + 'custom_checkbox': True, + } + config['markdown_extensions'].append('pymdownx.tilde') + print(config) + + return config diff --git a/plugins/techdocs/mkdocs/mock-docs/docs/index.md b/plugins/techdocs/mkdocs/mock-docs/docs/index.md index bc437e6180..72f7a776a8 100644 --- a/plugins/techdocs/mkdocs/mock-docs/docs/index.md +++ b/plugins/techdocs/mkdocs/mock-docs/docs/index.md @@ -1 +1,4 @@ ## hello mock docs + +!!! test +Testing somethin diff --git a/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml b/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml index b14d82c4de..2ecc719875 100644 --- a/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml +++ b/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml @@ -4,5 +4,4 @@ nav: - Home: index.md plugins: - - techdocs-core - + - techdocs-core \ No newline at end of file From cddfe9bd58aa668f7cfe65fa42a8c51f446c4e4c Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:11:16 +0200 Subject: [PATCH 02/53] feat(techdocs-core): add python formatter --- .../mkdocs/container/techdocs-core/requirements.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt b/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt index b3667f94ec..2a13d1a9da 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt +++ b/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt @@ -1 +1,9 @@ +# The "base" version of the Mkdocs project. +# Note: if you update this, also update `install_requires` in setup.py +# https://github.com/mkdocs/mkdocs mkdocs==1.1.2 + +# The linter using for Python +# Note: This requires Python 3.6+ to run, but can format Python 2 code too. +# https://github.com/psf/black +black==19.10b0 From 3f79513fdd359b68c0b8687a00f9d7780907e87b Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:16:36 +0200 Subject: [PATCH 03/53] chore(techdocs-core): lower indentation of notice --- plugins/techdocs/mkdocs/container/Dockerfile | 20 +++++++------- .../mkdocs/container/techdocs-core/setup.py | 26 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/Dockerfile b/plugins/techdocs/mkdocs/container/Dockerfile index 1ae66589b6..ce54f53983 100644 --- a/plugins/techdocs/mkdocs/container/Dockerfile +++ b/plugins/techdocs/mkdocs/container/Dockerfile @@ -1,17 +1,17 @@ -# Copyright 2020 Spotify AB +# Copyright 2020 Spotify AB # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. FROM python:3.7.7-alpine3.12 diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/setup.py b/plugins/techdocs/mkdocs/container/techdocs-core/setup.py index faa8b8c46e..a259ae0615 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/setup.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/setup.py @@ -1,17 +1,17 @@ """ - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +Copyright 2020 Spotify AB + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ from setuptools import setup, find_packages From 8f91501b07aaba6eab12c5b1352d0edcb159c785 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:14:09 +0200 Subject: [PATCH 04/53] chore(mkdocs/container): remove initial newline --- plugins/techdocs/mkdocs/container/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/techdocs/mkdocs/container/Dockerfile b/plugins/techdocs/mkdocs/container/Dockerfile index ce54f53983..8df86eadb0 100644 --- a/plugins/techdocs/mkdocs/container/Dockerfile +++ b/plugins/techdocs/mkdocs/container/Dockerfile @@ -1,4 +1,3 @@ - # Copyright 2020 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); From 97e9e325e54c800c1a8f4f18972c88bd400cb32a Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:31:07 +0200 Subject: [PATCH 05/53] docs(techdocs-core): add README --- .../mkdocs/container/techdocs-core/README.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 plugins/techdocs/mkdocs/container/techdocs-core/README.md diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/README.md b/plugins/techdocs/mkdocs/container/techdocs-core/README.md new file mode 100644 index 0000000000..04606088d4 --- /dev/null +++ b/plugins/techdocs/mkdocs/container/techdocs-core/README.md @@ -0,0 +1,47 @@ +# techdocs-core + +This is the base [Mkdocs](https://mkdocs.org) plugin used when using Mkdocs with Spotify's TechDocs. It is written in Python and packages all of our Mkdocs defaults, such as theming, plugins, etc in a single plugin. + +## Usage + +**Installation instructions TBD.** We haven't published it to a Python registry yet. + +Once you have installed the `mkdocs-techdocs-core` plugin, you'll need to add it to your `mkdocs.yml`. + +```yaml +site_name: Backstage Docs + +nav: + - Home: index.md + - Developing a Plugin: developing-a-plugin.md + +plugins: + - techdocs-core +``` + +## Running Locally + +You can install this package locally using `pip` and the `--editable` flag used for making developing Python packages. + +```bash +pip install --editable . +``` + +You'll then have the `techdocs-core` package available to use in Mkdocs and `pip` will point the dependency to this folder. + +## Running with Docker + +In the parent `Dockerfile` we add this folder to the build and install the package locally in the container. In the future, we'll probably move away from this approach and have it download directly from a Python registry (and this folder will publish to one). + +See the `README.md` located in the `mkdocs/` folder for more details on how to build and run the Docker container. + +## Linting and Tests + +To run the tests, you'll need `tox` installed: + +```bash +pip install tox +tox +``` + +This will invoke our linter and tests. You can configure this by editing the `tox.ini` folder located in this folder. From 4c6ea359602be1223aa7320c5f3574cd0c8c7c07 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:32:23 +0200 Subject: [PATCH 06/53] chore(techdocs-core): added gitignore --- plugins/techdocs/mkdocs/container/techdocs-core/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 plugins/techdocs/mkdocs/container/techdocs-core/.gitignore diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/.gitignore b/plugins/techdocs/mkdocs/container/techdocs-core/.gitignore new file mode 100644 index 0000000000..cd5c4a44f3 --- /dev/null +++ b/plugins/techdocs/mkdocs/container/techdocs-core/.gitignore @@ -0,0 +1,2 @@ +.tox +*.egg-info From d6cf8892fe19fe009cc7698c7c0ce0b7ff5bac27 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:33:29 +0200 Subject: [PATCH 07/53] docs(techdocs-core): added dependency install command --- plugins/techdocs/mkdocs/container/techdocs-core/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/README.md b/plugins/techdocs/mkdocs/container/techdocs-core/README.md index 04606088d4..b4a32a57cb 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/README.md +++ b/plugins/techdocs/mkdocs/container/techdocs-core/README.md @@ -37,10 +37,11 @@ See the `README.md` located in the `mkdocs/` folder for more details on how to b ## Linting and Tests -To run the tests, you'll need `tox` installed: +To run the tests, you'll need `tox` installed with our dependencies installed: ```bash pip install tox +pip install -r requirements.txt tox ``` From f9ee9991a05a98535fea4680328edb274abbfaa6 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:45:22 +0200 Subject: [PATCH 08/53] docs(techdocs-core): added linting section --- .../techdocs/mkdocs/container/techdocs-core/README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/README.md b/plugins/techdocs/mkdocs/container/techdocs-core/README.md index b4a32a57cb..143acf3c3b 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/README.md +++ b/plugins/techdocs/mkdocs/container/techdocs-core/README.md @@ -35,14 +35,11 @@ In the parent `Dockerfile` we add this folder to the build and install the packa See the `README.md` located in the `mkdocs/` folder for more details on how to build and run the Docker container. -## Linting and Tests - -To run the tests, you'll need `tox` installed with our dependencies installed: +## Linting ```bash -pip install tox pip install -r requirements.txt -tox +python -m black src/ ``` -This will invoke our linter and tests. You can configure this by editing the `tox.ini` folder located in this folder. +**Note:** This will write to all Python files in `src/` with the formatted code. If you would like to only check to see if it passes, simply append the `--check` flag. From f432c9deb6a41b7e8ff82113cbee8747b4a56ace Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:45:39 +0200 Subject: [PATCH 09/53] chore(techdocs-core): formatted all files in src/ --- .../mkdocs/container/techdocs-core/src/core.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py index e42a60d28b..7fce7d6dac 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py @@ -19,17 +19,17 @@ from mkdocs.theme import Theme from mkdocs.contrib.search import SearchPlugin + class TechDocsCore(BasePlugin): def on_config(self, config): - # Theme - config['theme'] = Theme(name="material") + # Theme + config["theme"] = Theme(name="material") - # Plugins - del config['plugins']['techdocs-core'] + # Plugins + del config["plugins"]["techdocs-core"] - search_plugin = SearchPlugin() - search_plugin.load_config({}) - config['plugins']['search'] = search_plugin - - return config + search_plugin = SearchPlugin() + search_plugin.load_config({}) + config["plugins"]["search"] = search_plugin + return config From 464e07d067052c34fd94e85d2c6701414bb7991c Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:51:22 +0200 Subject: [PATCH 10/53] docs(mkdocs): lower indentation for container setup commands --- plugins/techdocs/mkdocs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/techdocs/mkdocs/README.md b/plugins/techdocs/mkdocs/README.md index 4d1c11d7b0..8cf1717cf1 100644 --- a/plugins/techdocs/mkdocs/README.md +++ b/plugins/techdocs/mkdocs/README.md @@ -6,8 +6,8 @@ Welcome to MkDocs. This is the TechDocs implementation of MkDocs. ## Getting started -``` - docker build ./container -t mkdocs-container +```bash +docker build ./container -t mkdocs-container - docker run -w /content -v $(pwd)/mock-docs:/content -p 8000:8000 -it mkdocs-container serve -a 0.0.0.0:8000 +docker run -w /content -v $(pwd)/mock-docs:/content -p 8000:8000 -it mkdocs-container serve -a 0.0.0.0:8000 ``` From b53ecbff3ed45efe9be5a639ca5edb66e91bc55a Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Tue, 23 Jun 2020 20:52:04 +0200 Subject: [PATCH 11/53] docs(mkdocs): added open up localhost:3000 to readme --- plugins/techdocs/mkdocs/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/techdocs/mkdocs/README.md b/plugins/techdocs/mkdocs/README.md index 8cf1717cf1..5c2a7725aa 100644 --- a/plugins/techdocs/mkdocs/README.md +++ b/plugins/techdocs/mkdocs/README.md @@ -11,3 +11,5 @@ docker build ./container -t mkdocs-container docker run -w /content -v $(pwd)/mock-docs:/content -p 8000:8000 -it mkdocs-container serve -a 0.0.0.0:8000 ``` + +Then open up `http://localhost:8000` on your local machine. From eee3a5563309375c55edfae5b7b9cd4adc52a3f0 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 24 Jun 2020 10:57:04 +0200 Subject: [PATCH 12/53] fix(mkdocs): update sample md file --- .../container/techdocs-core/src/core.py | 12 ++++---- .../techdocs/mkdocs/mock-docs/docs/index.md | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py index d9c33b2167..fddee3bfd1 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py @@ -32,7 +32,6 @@ class TechDocsCore(BasePlugin): config['plugins']['search'] = search_plugin # Markdown Extensions - print(config) config['markdown_extensions'].append('admonition') config['markdown_extensions'].append('abbr') config['markdown_extensions'].append('attr_list') @@ -51,11 +50,11 @@ class TechDocsCore(BasePlugin): config['markdown_extensions'].append('markdown.extensions.tables') config['markdown_extensions'].append('markdown_inline_graphviz') config['markdown_extensions'].append('plantuml_markdown') - config['markdown_extensions'].append('markdown_katex') - config['mdx_configs']['markdown_katex'] = { - 'no_inline_svg': True, - 'insert_fonts_css': True, - } + #config['markdown_extensions'].append('markdown_katex') + #config['mdx_configs']['markdown_katex'] = { + # 'no_inline_svg': True, + # 'insert_fonts_css': True, + #} config['markdown_extensions'].append('pymdownx.betterem') config['mdx_configs']['pymdownx.betterem'] = { 'smart_enable': 'all', @@ -77,7 +76,6 @@ class TechDocsCore(BasePlugin): 'custom_checkbox': True, } config['markdown_extensions'].append('pymdownx.tilde') - print(config) return config diff --git a/plugins/techdocs/mkdocs/mock-docs/docs/index.md b/plugins/techdocs/mkdocs/mock-docs/docs/index.md index 72f7a776a8..e8ba4e2d6d 100644 --- a/plugins/techdocs/mkdocs/mock-docs/docs/index.md +++ b/plugins/techdocs/mkdocs/mock-docs/docs/index.md @@ -2,3 +2,31 @@ !!! test Testing somethin + +Some text about MOCDOC + +\*[MOCDOC]: Mock Documentation + +This is a paragraph. +{: #test_id .test_class } + +Apple +: Pomaceous fruit of plants of the genus Malus in +the family Rosaceae. + +```javascript +import { test } from 'something'; + +const addThingToThing = (a, b) a + b; +``` + +- [abc](#abc) +- [xyz](#xyz) + +## abc + +This is a b c. + +## xyz + +This is x y z. From 106c4d6763029b38061aaaebe9408aa0bc0da4d8 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 24 Jun 2020 10:58:24 +0200 Subject: [PATCH 13/53] Added blank line --- plugins/techdocs/mkdocs/mock-docs/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml b/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml index 2ecc719875..0c7cf84955 100644 --- a/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml +++ b/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml @@ -4,4 +4,4 @@ nav: - Home: index.md plugins: - - techdocs-core \ No newline at end of file + - techdocs-core From 45c518272c3a962cccd0d9a890385d5c63379d28 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 11:00:53 +0200 Subject: [PATCH 14/53] core-api: move session state tracking to auth session managers --- .../implementations/auth/github/GithubAuth.ts | 17 ++--------- .../implementations/auth/google/GoogleAuth.ts | 23 +++----------- .../AuthSessionStore.test.ts | 8 +++++ .../AuthSessionManager/AuthSessionStore.ts | 4 +++ .../RefreshingAuthSessionManager.test.ts | 30 +++++++++++++++++-- .../RefreshingAuthSessionManager.ts | 12 ++++++-- .../AuthSessionManager/SessionStateTracker.ts | 16 +++++++--- .../StaticAuthSessionManager.ts | 8 +++++ .../src/lib/AuthSessionManager/types.ts | 5 ++++ 9 files changed, 80 insertions(+), 43 deletions(-) diff --git a/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts b/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts index 4641dd7b50..ddf03034dc 100644 --- a/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts +++ b/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts @@ -29,7 +29,6 @@ import { OAuthRequestApi, AuthProvider } from '../../../definitions'; import { SessionManager } from '../../../../lib/AuthSessionManager/types'; import { StaticAuthSessionManager } from '../../../../lib/AuthSessionManager'; import { Observable } from '../../../../types'; -import { SessionStateTracker } from '../../../../lib/AuthSessionManager/SessionStateTracker'; type CreateOptions = { // TODO(Rugvip): These two should be grabbed from global config when available, they're not unique to GithubAuth @@ -95,44 +94,34 @@ class GithubAuth implements OAuthApi, SessionStateApi { return new GithubAuth(sessionManager); } - private readonly sessionStateTracker = new SessionStateTracker(); - sessionState$(): Observable { - return this.sessionStateTracker.observable; + return this.sessionManager.sessionState$(); } constructor(private readonly sessionManager: SessionManager) {} async getAccessToken(scope?: string, options?: AuthRequestOptions) { - const normalizedScopes = GithubAuth.normalizeScope(scope); const session = await this.sessionManager.getSession({ ...options, - scopes: normalizedScopes, + scopes: GithubAuth.normalizeScope(scope), }); - this.sessionStateTracker.setIsSignedId(!!session); - if (session) { - return session.providerInfo.accessToken; - } - return ''; + return session?.providerInfo.accessToken ?? ''; } async getBackstageIdentity( options: AuthRequestOptions = {}, ): Promise { const session = await this.sessionManager.getSession(options); - this.sessionStateTracker.setIsSignedId(!!session); return session?.backstageIdentity; } async getProfile(options: AuthRequestOptions = {}) { const session = await this.sessionManager.getSession(options); - this.sessionStateTracker.setIsSignedId(!!session); return session?.profile; } async logout() { await this.sessionManager.removeSession(); - this.sessionStateTracker.setIsSignedId(false); } static normalizeScope(scope?: string): Set { diff --git a/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts b/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts index db26d2d9a4..594116fc1a 100644 --- a/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts +++ b/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts @@ -32,7 +32,6 @@ import { OAuthRequestApi, AuthProvider } from '../../../definitions'; import { SessionManager } from '../../../../lib/AuthSessionManager/types'; import { RefreshingAuthSessionManager } from '../../../../lib/AuthSessionManager'; import { Observable } from '../../../../types'; -import { SessionStateTracker } from '../../../../lib/AuthSessionManager/SessionStateTracker'; type CreateOptions = { // TODO(Rugvip): These two should be grabbed from global config when available, they're not unique to GoogleAuth @@ -117,10 +116,8 @@ class GoogleAuth return new GoogleAuth(sessionManager); } - private readonly sessionStateTracker = new SessionStateTracker(); - sessionState$(): Observable { - return this.sessionStateTracker.observable; + return this.sessionManager.sessionState$(); } constructor(private readonly sessionManager: SessionManager) {} @@ -129,43 +126,31 @@ class GoogleAuth scope?: string | string[], options?: AuthRequestOptions, ) { - const normalizedScopes = GoogleAuth.normalizeScopes(scope); const session = await this.sessionManager.getSession({ ...options, - scopes: normalizedScopes, + scopes: GoogleAuth.normalizeScopes(scope), }); - this.sessionStateTracker.setIsSignedId(!!session); - if (session) { - return session.providerInfo.accessToken; - } - return ''; + return session?.providerInfo.accessToken ?? ''; } async getIdToken(options: AuthRequestOptions = {}) { const session = await this.sessionManager.getSession(options); - this.sessionStateTracker.setIsSignedId(!!session); - if (session) { - return session.providerInfo.idToken; - } - return ''; + return session?.providerInfo.idToken ?? ''; } async logout() { await this.sessionManager.removeSession(); - this.sessionStateTracker.setIsSignedId(false); } async getBackstageIdentity( options: AuthRequestOptions = {}, ): Promise { const session = await this.sessionManager.getSession(options); - this.sessionStateTracker.setIsSignedId(!!session); return session?.backstageIdentity; } async getProfile(options: AuthRequestOptions = {}) { const session = await this.sessionManager.getSession(options); - this.sessionStateTracker.setIsSignedId(!!session); return session?.profile; } diff --git a/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.test.ts b/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.test.ts index 91e55c3a48..4572b923dd 100644 --- a/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.test.ts +++ b/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.test.ts @@ -38,6 +38,7 @@ class LocalStorage { class MockManager implements SessionManager { getSession = jest.fn(); removeSession = jest.fn(); + sessionState$ = jest.fn(); } describe('GheAuth AuthSessionStore', () => { @@ -119,4 +120,11 @@ describe('GheAuth AuthSessionStore', () => { expect(localStorage.getItem('my-key')).toBe(null); }); + + it('should forward sessionState calls', () => { + const manager = new MockManager(); + const store = new AuthSessionStore({ manager, ...defaultOptions }); + store.sessionState$(); + expect(manager.sessionState$).toHaveBeenCalled(); + }); }); diff --git a/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.ts b/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.ts index 8d318f5bff..3e3a40d02a 100644 --- a/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.ts +++ b/packages/core-api/src/lib/AuthSessionManager/AuthSessionStore.ts @@ -82,6 +82,10 @@ export class AuthSessionStore implements SessionManager { await this.manager.removeSession(); } + sessionState$() { + return this.manager.sessionState$(); + } + private loadSession(): T | undefined { try { const sessionJson = localStorage.getItem(this.storageKey); diff --git a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts index 793c6f1708..12e7c0a978 100644 --- a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts +++ b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts @@ -15,6 +15,7 @@ */ import { RefreshingAuthSessionManager } from './RefreshingAuthSessionManager'; +import { SessionState } from '../../apis'; const defaultOptions = { sessionScopes: (session: { scopes: Set }) => session.scopes, @@ -22,21 +23,44 @@ const defaultOptions = { }; describe('RefreshingAuthSessionManager', () => { - it('should save result form createSession', async () => { + it('should save result from createSession', async () => { const createSession = jest.fn().mockResolvedValue({ expired: false }); const refreshSession = jest.fn().mockRejectedValue(new Error('NOPE')); + const removeSession = jest.fn(); const manager = new RefreshingAuthSessionManager({ - connector: { createSession, refreshSession }, + connector: { createSession, refreshSession, removeSession }, ...defaultOptions, } as any); + const stateSubscriber = jest.fn(); + manager.sessionState$().subscribe(stateSubscriber); + await Promise.resolve(); // Wait a tick for observer to post a value + + expect(stateSubscriber.mock.calls).toEqual([[SessionState.SignedOut]]); await manager.getSession({}); expect(createSession).toBeCalledTimes(1); + expect(stateSubscriber.mock.calls).toEqual([ + [SessionState.SignedOut], + [SessionState.SignedIn], + ]); await manager.getSession({}); expect(createSession).toBeCalledTimes(1); expect(refreshSession).toBeCalledTimes(1); + expect(stateSubscriber.mock.calls).toEqual([ + [SessionState.SignedOut], + [SessionState.SignedIn], + ]); + + expect(removeSession).toHaveBeenCalledTimes(0); + await manager.removeSession(); + expect(removeSession).toHaveBeenCalledTimes(1); + expect(stateSubscriber.mock.calls).toEqual([ + [SessionState.SignedOut], + [SessionState.SignedIn], + [SessionState.SignedOut], + ]); }); it('should ask consent only if scopes have changed', async () => { @@ -130,7 +154,7 @@ describe('RefreshingAuthSessionManager', () => { expect(refreshSession).toBeCalledTimes(1); }); - it('should remove session and reload', async () => { + it('should remove session straight away', async () => { const removeSession = jest.fn(); const manager = new RefreshingAuthSessionManager({ connector: { removeSession }, diff --git a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts index f7d5bcf7ca..e46c505c12 100644 --- a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts +++ b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts @@ -22,6 +22,7 @@ import { } from './types'; import { AuthConnector } from '../AuthConnector'; import { SessionScopeHelper, hasScopes } from './common'; +import { SessionStateTracker } from './SessionStateTracker'; type Options = { /** The connector used for acting on the auth session */ @@ -43,6 +44,7 @@ export class RefreshingAuthSessionManager implements SessionManager { private readonly helper: SessionScopeHelper; private readonly sessionScopesFunc: SessionScopesFunc; private readonly sessionShouldRefreshFunc: SessionShouldRefreshFunc; + private readonly stateTracker = new SessionStateTracker(); private refreshPromise?: Promise; private currentSession: T | undefined; @@ -109,16 +111,18 @@ export class RefreshingAuthSessionManager implements SessionManager { ...options, scopes: this.helper.getExtendedScope(this.currentSession, options.scopes), }); + this.stateTracker.setIsSignedIn(true); return this.currentSession; } async removeSession() { this.currentSession = undefined; await this.connector.removeSession(); + this.stateTracker.setIsSignedIn(false); } - async getCurrentSession() { - return this.currentSession; + sessionState$() { + return this.stateTracker.sessionState$(); } private async collapsedSessionRefresh(): Promise { @@ -129,7 +133,9 @@ export class RefreshingAuthSessionManager implements SessionManager { this.refreshPromise = this.connector.refreshSession(); try { - return await this.refreshPromise; + const session = await this.refreshPromise; + this.stateTracker.setIsSignedIn(true); + return session; } finally { delete this.refreshPromise; } diff --git a/packages/core-api/src/lib/AuthSessionManager/SessionStateTracker.ts b/packages/core-api/src/lib/AuthSessionManager/SessionStateTracker.ts index de308acb0c..c4260bb31d 100644 --- a/packages/core-api/src/lib/AuthSessionManager/SessionStateTracker.ts +++ b/packages/core-api/src/lib/AuthSessionManager/SessionStateTracker.ts @@ -16,17 +16,25 @@ import { BehaviorSubject } from '..'; import { SessionState } from '../../apis'; +import { Observable } from '../../types'; export class SessionStateTracker { - private signedIn: boolean = false; - observable = new BehaviorSubject(SessionState.SignedOut); + private readonly subject = new BehaviorSubject( + SessionState.SignedOut, + ); - setIsSignedId(isSignedIn: boolean) { + private signedIn: boolean = false; + + setIsSignedIn(isSignedIn: boolean) { if (this.signedIn !== isSignedIn) { this.signedIn = isSignedIn; - this.observable.next( + this.subject.next( this.signedIn ? SessionState.SignedIn : SessionState.SignedOut, ); } } + + sessionState$(): Observable { + return this.subject; + } } diff --git a/packages/core-api/src/lib/AuthSessionManager/StaticAuthSessionManager.ts b/packages/core-api/src/lib/AuthSessionManager/StaticAuthSessionManager.ts index 5ecbbc0c4e..e59c11421c 100644 --- a/packages/core-api/src/lib/AuthSessionManager/StaticAuthSessionManager.ts +++ b/packages/core-api/src/lib/AuthSessionManager/StaticAuthSessionManager.ts @@ -17,6 +17,7 @@ import { SessionManager, GetSessionOptions } from './types'; import { AuthConnector } from '../AuthConnector'; import { SessionScopeHelper } from './common'; +import { SessionStateTracker } from './SessionStateTracker'; type Options = { /** The connector used for acting on the auth session */ @@ -33,6 +34,7 @@ type Options = { export class StaticAuthSessionManager implements SessionManager { private readonly connector: AuthConnector; private readonly helper: SessionScopeHelper; + private readonly stateTracker = new SessionStateTracker(); private currentSession: T | undefined; @@ -60,11 +62,17 @@ export class StaticAuthSessionManager implements SessionManager { ...options, scopes: this.helper.getExtendedScope(this.currentSession, options.scopes), }); + this.stateTracker.setIsSignedIn(true); return this.currentSession; } async removeSession() { this.currentSession = undefined; await this.connector.removeSession(); + this.stateTracker.setIsSignedIn(false); + } + + sessionState$() { + return this.stateTracker.sessionState$(); } } diff --git a/packages/core-api/src/lib/AuthSessionManager/types.ts b/packages/core-api/src/lib/AuthSessionManager/types.ts index d28a751fbf..804c7121e1 100644 --- a/packages/core-api/src/lib/AuthSessionManager/types.ts +++ b/packages/core-api/src/lib/AuthSessionManager/types.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { Observable } from '../../types'; +import { SessionState } from '../../apis'; + export type GetSessionOptions = { optional?: boolean; instantPopup?: boolean; @@ -29,6 +32,8 @@ export type SessionManager = { getSession(options: GetSessionOptions): Promise; removeSession(): Promise; + + sessionState$(): Observable; }; /** From cc0e6b0d30b4db91214088a45a11609404263a72 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 11:30:27 +0200 Subject: [PATCH 15/53] auth-backend: leave it to the providers to figure out the backstage identity --- .../core-api/src/apis/definitions/auth.ts | 2 +- .../layout/Sidebar/Settings/UserProfile.tsx | 6 ++- .../src/lib/OAuthProvider.test.ts | 13 +++--- plugins/auth-backend/src/lib/OAuthProvider.ts | 40 ++++++++++--------- .../src/lib/PassportStrategyHelper.ts | 4 -- .../src/providers/github/provider.ts | 8 ++-- .../src/providers/google/provider.ts | 25 +++++++++--- plugins/auth-backend/src/providers/types.ts | 21 +++++----- 8 files changed, 67 insertions(+), 52 deletions(-) diff --git a/packages/core-api/src/apis/definitions/auth.ts b/packages/core-api/src/apis/definitions/auth.ts index ccd40e66ce..d5c0e9c0a4 100644 --- a/packages/core-api/src/apis/definitions/auth.ts +++ b/packages/core-api/src/apis/definitions/auth.ts @@ -173,7 +173,7 @@ export type ProfileInfo = { /** * Email ID. */ - email: string; + email?: string; /** * Display name that can be presented to the user. diff --git a/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx b/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx index 101ae7010b..3b854801c9 100644 --- a/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx +++ b/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx @@ -34,14 +34,16 @@ export const UserProfile: FC<{ open: boolean; setOpen: Function }> = ({ }) => { const ref = useRef(); // for scrolling down when collapse item opens const classes = useStyles(); - const profile = useApi(identityApiRef).getProfile(); + const identityApi = useApi(identityApiRef); const handleClick = () => { setOpen(!open); setTimeout(() => ref.current?.scrollIntoView({ behavior: 'smooth' }), 300); }; - const displayName = profile.displayName ?? profile.email; + const userId = identityApi.getUserId(); + const profile = identityApi.getProfile(); + const displayName = profile.displayName ?? userId; const SignInAvatar = () => ( {displayName[0]} diff --git a/plugins/auth-backend/src/lib/OAuthProvider.test.ts b/plugins/auth-backend/src/lib/OAuthProvider.test.ts index f92875fd48..f67a91dfcd 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.test.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.test.ts @@ -23,13 +23,9 @@ import { verifyNonce, OAuthProvider, } from './OAuthProvider'; -import { - WebMessageResponse, - OAuthProviderHandlers, - OAuthResponse, -} from '../providers/types'; +import { WebMessageResponse, OAuthProviderHandlers } from '../providers/types'; -const mockResponseData: OAuthResponse = { +const mockResponseData = { providerInfo: { accessToken: 'ACCESS_TOKEN', idToken: 'ID_TOKEN', @@ -39,6 +35,9 @@ const mockResponseData: OAuthResponse = { profile: { email: 'foo@bar.com', }, + backstageIdentity: { + id: 'foo', + }, }; describe('OAuthProvider Utils', () => { @@ -350,7 +349,7 @@ describe('OAuthProvider', () => { expect(mockResponse.send).toHaveBeenCalledWith({ ...mockResponseData, backstageIdentity: { - id: mockResponseData.profile.email, + id: mockResponseData.backstageIdentity.id, idToken: 'my-id-token', }, }); diff --git a/plugins/auth-backend/src/lib/OAuthProvider.ts b/plugins/auth-backend/src/lib/OAuthProvider.ts index dac31af451..b7179659f9 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.ts @@ -18,10 +18,10 @@ import express from 'express'; import crypto from 'crypto'; import { URL } from 'url'; import { - AuthResponse, AuthProviderRouteHandlers, OAuthProviderHandlers, WebMessageResponse, + BackstageIdentity, } from '../providers/types'; import { InputError } from '@backstage/backend-common'; import { TokenIssuer } from '../identity'; @@ -147,19 +147,12 @@ export class OAuthProvider implements AuthProviderRouteHandlers { this.setRefreshTokenCookie(res, refreshToken); } - const id = response.profile.email; - const idToken = await this.options.tokenIssuer.issueToken({ - claims: { sub: id }, - }); - const fullResponse: AuthResponse = { - ...response, - backstageIdentity: { id, idToken }, - }; + await this.populateIdentity(response.backstageIdentity); // post message back to popup if successful return postMessageResponse(res, this.options.appOrigin, { type: 'authorization_response', - response: fullResponse, + response, }); } catch (error) { // post error message back to popup if failure @@ -213,21 +206,30 @@ export class OAuthProvider implements AuthProviderRouteHandlers { // get new access_token const response = await this.providerHandlers.refresh(refreshToken, scope); - const id = response.profile.email; - const idToken = await this.options.tokenIssuer.issueToken({ - claims: { sub: id }, - }); - const fullResponse: AuthResponse = { - ...response, - backstageIdentity: { id, idToken }, - }; + await this.populateIdentity(response.backstageIdentity); - res.send(fullResponse); + res.send(response); } catch (error) { res.status(401).send(`${error.message}`); } } + /** + * If the response from the OAuth provider includes a Backstage identity, we + * make sure it's populated with all the information we can derive from the user ID. + */ + private async populateIdentity(identity?: BackstageIdentity) { + if (!identity) { + return; + } + + if (!identity.idToken) { + identity.idToken = await this.options.tokenIssuer.issueToken({ + claims: { sub: identity.id }, + }); + } + } + private setNonceCookie = (res: express.Response, nonce: string) => { res.cookie(`${this.options.providerId}-nonce`, nonce, { maxAge: TEN_MINUTES_MS, diff --git a/plugins/auth-backend/src/lib/PassportStrategyHelper.ts b/plugins/auth-backend/src/lib/PassportStrategyHelper.ts index 46a386f419..1167946560 100644 --- a/plugins/auth-backend/src/lib/PassportStrategyHelper.ts +++ b/plugins/auth-backend/src/lib/PassportStrategyHelper.ts @@ -57,10 +57,6 @@ export const makeProfileInfo = ( } } - if (!email) { - throw new Error('No email received in profile info'); - } - return { email, picture, diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index 3ae9858bb1..01652a6d7e 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -72,15 +72,13 @@ export class GithubAuthProvider implements OAuthProviderHandlers { return await executeRedirectStrategy(req, this._strategy, options); } - async handler(req: express.Request): Promise<{ response: OAuthResponse }> { - const result = await executeFrameHandlerStrategy( + async handler(req: express.Request) { + const { response } = await executeFrameHandlerStrategy( req, this._strategy, ); - return { - response: result.response, - }; + return { response }; } } diff --git a/plugins/auth-backend/src/providers/google/provider.ts b/plugins/auth-backend/src/providers/google/provider.ts index f12b248021..04705b66c1 100644 --- a/plugins/auth-backend/src/providers/google/provider.ts +++ b/plugins/auth-backend/src/providers/google/provider.ts @@ -97,14 +97,14 @@ export class GoogleAuthProvider implements OAuthProviderHandlers { async handler( req: express.Request, ): Promise<{ response: OAuthResponse; refreshToken: string }> { - const result = await executeFrameHandlerStrategy< + const { response, privateInfo } = await executeFrameHandlerStrategy< OAuthResponse, PrivateInfo >(req, this._strategy); return { - response: result.response, - refreshToken: result.privateInfo.refreshToken, + response: await this.populateIdentity(response), + refreshToken: privateInfo.refreshToken, }; } @@ -121,7 +121,7 @@ export class GoogleAuthProvider implements OAuthProviderHandlers { params.id_token, ); - return { + return this.populateIdentity({ providerInfo: { accessToken, idToken: params.id_token, @@ -129,7 +129,22 @@ export class GoogleAuthProvider implements OAuthProviderHandlers { scope: params.scope, }, profile, - }; + }); + } + + private async populateIdentity( + response: OAuthResponse, + ): Promise { + const { profile } = response; + + if (!profile.email) { + throw new Error('Google profile contained no email'); + } + + // TODO(Rugvip): Hardcoded to the local part of the email for now + const id = profile.email.split('@')[0]; + + return { ...response, backstageIdentity: { id } }; } } diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index 81773bf9dc..56d4db79fa 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -100,14 +100,20 @@ export interface OAuthProviderHandlers { */ handler( req: express.Request, - ): Promise<{ response: OAuthResponse; refreshToken?: string }>; + ): Promise<{ + response: AuthResponse; + refreshToken?: string; + }>; /** * (Optional) Given a refresh token and scope fetches a new access token from the auth provider. * @param {string} refreshToken * @param {string} scope */ - refresh?(refreshToken: string, scope: string): Promise; + refresh?( + refreshToken: string, + scope: string, + ): Promise>; /** * (Optional) Sign out of the auth provider. @@ -192,13 +198,10 @@ export type AuthProviderFactory = ( export type AuthResponse = { providerInfo: ProviderInfo; profile: ProfileInfo; - backstageIdentity: BackstageIdentity; + backstageIdentity?: BackstageIdentity; }; -export type OAuthResponse = Omit< - AuthResponse, - 'backstageIdentity' ->; +export type OAuthResponse = AuthResponse; export type BackstageIdentity = { /** @@ -209,7 +212,7 @@ export type BackstageIdentity = { /** * An ID token that can be used to authenticate the user within Backstage. */ - idToken: string; + idToken?: string; }; export type OAuthProviderInfo = { @@ -279,7 +282,7 @@ export type ProfileInfo = { /** * Email ID of the signed in user. */ - email: string; + email?: string; /** * Display name that can be presented to the signed in user. */ From e3a1c1944b20fbd7c8575f7e365108cdeb6d8e3a Mon Sep 17 00:00:00 2001 From: Emma Indal Date: Tue, 23 Jun 2020 16:57:16 +0200 Subject: [PATCH 16/53] feat(mkdocs) add mkdocs monorepo plugin to techdocs core plugin --- plugins/techdocs/mkdocs/container/Dockerfile | 2 +- .../mkdocs/container/techdocs-core/src/core.py | 18 ++++++++++++++---- plugins/techdocs/mkdocs/mock-docs/mkdocs.yml | 1 + .../mkdocs/mock-docs/sub-docs/docs/index.md | 1 + .../mkdocs/mock-docs/sub-docs/mkdocs.yml | 4 ++++ 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md create mode 100644 plugins/techdocs/mkdocs/mock-docs/sub-docs/mkdocs.yml diff --git a/plugins/techdocs/mkdocs/container/Dockerfile b/plugins/techdocs/mkdocs/container/Dockerfile index 8df86eadb0..aefabb5c5b 100644 --- a/plugins/techdocs/mkdocs/container/Dockerfile +++ b/plugins/techdocs/mkdocs/container/Dockerfile @@ -15,7 +15,7 @@ FROM python:3.7.7-alpine3.12 RUN apk update && apk --no-cache add gcc musl-dev -RUN pip install mkdocs==1.1.2 mkdocs-material==5.3.2 +RUN pip install mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 ADD ./techdocs-core /techdocs-core RUN pip install --no-index /techdocs-core diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py index 7fce7d6dac..7fc35a1529 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py @@ -19,14 +19,24 @@ from mkdocs.theme import Theme from mkdocs.contrib.search import SearchPlugin +from mkdocs_monorepo_plugin.plugin import MonorepoPlugin class TechDocsCore(BasePlugin): def on_config(self, config): - # Theme - config["theme"] = Theme(name="material") + # Theme + config['theme'] = Theme(name="material") - # Plugins - del config["plugins"]["techdocs-core"] + # Plugins + del config['plugins']['techdocs-core'] + + search_plugin = SearchPlugin() + search_plugin.load_config({}) + + monorepo_plugin = MonorepoPlugin() + monorepo_plugin.load_config({}) + + config['plugins']['search'] = search_plugin + config['plugins']['monorepo'] = monorepo_plugin search_plugin = SearchPlugin() search_plugin.load_config({}) diff --git a/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml b/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml index b14d82c4de..3da0280f2b 100644 --- a/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml +++ b/plugins/techdocs/mkdocs/mock-docs/mkdocs.yml @@ -2,6 +2,7 @@ site_name: 'mock-docs' nav: - Home: index.md + - SubDocs: '!include ./sub-docs/mkdocs.yml' plugins: - techdocs-core diff --git a/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md b/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md new file mode 100644 index 0000000000..9cb6199605 --- /dev/null +++ b/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md @@ -0,0 +1 @@ +### This is a md file in another docs folder using the [MkDocs Monorepo Plugin](https://github.com/spotify/mkdocs-monorepo-plugin) diff --git a/plugins/techdocs/mkdocs/mock-docs/sub-docs/mkdocs.yml b/plugins/techdocs/mkdocs/mock-docs/sub-docs/mkdocs.yml new file mode 100644 index 0000000000..09504c1b31 --- /dev/null +++ b/plugins/techdocs/mkdocs/mock-docs/sub-docs/mkdocs.yml @@ -0,0 +1,4 @@ +site_name: subdocs + +nav: + - Home 2: "index.md" From 3b936faf7e36a2688775eb5f3448f60d4d603b5d Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 24 Jun 2020 11:42:15 +0200 Subject: [PATCH 17/53] fix(mkdocs): remove some markdown plugins --- plugins/techdocs/mkdocs/container/Dockerfile | 4 ++-- .../techdocs/mkdocs/container/techdocs-core/src/core.py | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/Dockerfile b/plugins/techdocs/mkdocs/container/Dockerfile index 05c129033f..9080277a30 100644 --- a/plugins/techdocs/mkdocs/container/Dockerfile +++ b/plugins/techdocs/mkdocs/container/Dockerfile @@ -15,8 +15,8 @@ FROM python:3.7.7-alpine3.12 -RUN apk update && apk --no-cache add gcc musl-dev graphviz -RUN pip install --upgrade pip && pip install mkdocs==1.1.2 mkdocs-material==5.3.2 pymdown-extensions==7.1 markdown_inline_graphviz_extension==1.1 plantuml-markdown==3.2.2 markdown-katex==202006.1021 +RUN apk update && apk --no-cache add gcc musl-dev graphviz git +RUN pip install --upgrade pip && pip install mkdocs==1.1.2 mkdocs-material==5.3.2 pymdown-extensions==7.1 ADD ./techdocs-core /techdocs-core RUN pip install --no-index /techdocs-core diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py index fddee3bfd1..a9b5a91e07 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py @@ -48,13 +48,6 @@ class TechDocsCore(BasePlugin): } config['markdown_extensions'].append('footnotes') config['markdown_extensions'].append('markdown.extensions.tables') - config['markdown_extensions'].append('markdown_inline_graphviz') - config['markdown_extensions'].append('plantuml_markdown') - #config['markdown_extensions'].append('markdown_katex') - #config['mdx_configs']['markdown_katex'] = { - # 'no_inline_svg': True, - # 'insert_fonts_css': True, - #} config['markdown_extensions'].append('pymdownx.betterem') config['mdx_configs']['pymdownx.betterem'] = { 'smart_enable': 'all', From 91022ff1eca0b93e06b808a8d3ae90c2c8a65ec2 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 11:45:48 +0200 Subject: [PATCH 18/53] catalog-model: let the guest take care of some services --- packages/catalog-model/examples/artist-lookup-component.yaml | 2 +- packages/catalog-model/examples/playback-order-component.yaml | 2 +- packages/catalog-model/examples/podcast-api-component.yaml | 2 +- packages/catalog-model/examples/searcher-component.yaml | 2 +- packages/catalog-model/examples/shuffle-api-component.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/catalog-model/examples/artist-lookup-component.yaml b/packages/catalog-model/examples/artist-lookup-component.yaml index bb7d8d5767..448dd13fa3 100644 --- a/packages/catalog-model/examples/artist-lookup-component.yaml +++ b/packages/catalog-model/examples/artist-lookup-component.yaml @@ -6,4 +6,4 @@ metadata: spec: type: service lifecycle: experimental - owner: tools@example.com + owner: artists@example.com diff --git a/packages/catalog-model/examples/playback-order-component.yaml b/packages/catalog-model/examples/playback-order-component.yaml index fa9f68e77a..4f93b65edf 100644 --- a/packages/catalog-model/examples/playback-order-component.yaml +++ b/packages/catalog-model/examples/playback-order-component.yaml @@ -6,4 +6,4 @@ metadata: spec: type: service lifecycle: production - owner: tools@example.com + owner: guest diff --git a/packages/catalog-model/examples/podcast-api-component.yaml b/packages/catalog-model/examples/podcast-api-component.yaml index 2a27a0a2c5..19f9a3d4de 100644 --- a/packages/catalog-model/examples/podcast-api-component.yaml +++ b/packages/catalog-model/examples/podcast-api-component.yaml @@ -6,4 +6,4 @@ metadata: spec: type: service lifecycle: experimental - owner: tools@example.com + owner: players@example.com diff --git a/packages/catalog-model/examples/searcher-component.yaml b/packages/catalog-model/examples/searcher-component.yaml index d82f6e42c7..33d765117c 100644 --- a/packages/catalog-model/examples/searcher-component.yaml +++ b/packages/catalog-model/examples/searcher-component.yaml @@ -6,4 +6,4 @@ metadata: spec: type: service lifecycle: production - owner: tools@example.com + owner: guest diff --git a/packages/catalog-model/examples/shuffle-api-component.yaml b/packages/catalog-model/examples/shuffle-api-component.yaml index ed0517835c..275c48d6ba 100644 --- a/packages/catalog-model/examples/shuffle-api-component.yaml +++ b/packages/catalog-model/examples/shuffle-api-component.yaml @@ -6,4 +6,4 @@ metadata: spec: type: service lifecycle: production - owner: tools@example.com + owner: guest From f518a47bb27307dc679d7a9aa3b589eaf37cd400 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 24 Jun 2020 11:45:57 +0200 Subject: [PATCH 19/53] fix(mkdocs): removed unused packages from container --- plugins/techdocs/mkdocs/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/techdocs/mkdocs/container/Dockerfile b/plugins/techdocs/mkdocs/container/Dockerfile index 9080277a30..f96498df14 100644 --- a/plugins/techdocs/mkdocs/container/Dockerfile +++ b/plugins/techdocs/mkdocs/container/Dockerfile @@ -15,7 +15,7 @@ FROM python:3.7.7-alpine3.12 -RUN apk update && apk --no-cache add gcc musl-dev graphviz git +RUN apk update && apk --no-cache add gcc musl-dev RUN pip install --upgrade pip && pip install mkdocs==1.1.2 mkdocs-material==5.3.2 pymdown-extensions==7.1 ADD ./techdocs-core /techdocs-core From 50c5489422420ee57d663783ed6e81e68f43ac1f Mon Sep 17 00:00:00 2001 From: Emma Indal Date: Wed, 24 Jun 2020 12:00:24 +0200 Subject: [PATCH 20/53] fix(techdocs-core): formatting --- .../container/techdocs-core/src/core.py | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py index 7fc35a1529..37d271d261 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py +++ b/plugins/techdocs/mkdocs/container/techdocs-core/src/core.py @@ -21,22 +21,23 @@ from mkdocs.contrib.search import SearchPlugin from mkdocs_monorepo_plugin.plugin import MonorepoPlugin + class TechDocsCore(BasePlugin): def on_config(self, config): - # Theme - config['theme'] = Theme(name="material") + # Theme + config["theme"] = Theme(name="material") - # Plugins - del config['plugins']['techdocs-core'] - - search_plugin = SearchPlugin() - search_plugin.load_config({}) + # Plugins + del config["plugins"]["techdocs-core"] - monorepo_plugin = MonorepoPlugin() - monorepo_plugin.load_config({}) - - config['plugins']['search'] = search_plugin - config['plugins']['monorepo'] = monorepo_plugin + search_plugin = SearchPlugin() + search_plugin.load_config({}) + + monorepo_plugin = MonorepoPlugin() + monorepo_plugin.load_config({}) + + config["plugins"]["search"] = search_plugin + config["plugins"]["monorepo"] = monorepo_plugin search_plugin = SearchPlugin() search_plugin.load_config({}) From 72fed2555df5eb42eafae08251c972ead574cea8 Mon Sep 17 00:00:00 2001 From: Emma Indal Date: Wed, 24 Jun 2020 12:02:09 +0200 Subject: [PATCH 21/53] docs(sub-docs): typo --- plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md b/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md index 9cb6199605..65c6644ef8 100644 --- a/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md +++ b/plugins/techdocs/mkdocs/mock-docs/sub-docs/docs/index.md @@ -1 +1 @@ -### This is a md file in another docs folder using the [MkDocs Monorepo Plugin](https://github.com/spotify/mkdocs-monorepo-plugin) +### This is an md file in another docs folder using the [MkDocs Monorepo Plugin](https://github.com/spotify/mkdocs-monorepo-plugin) From f419ac130a6f1e362874005551a0638d30acba6f Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 11:10:15 +0200 Subject: [PATCH 22/53] feat(.github/workflows): added python lint to CI --- .github/workflows/techdocs.yml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/techdocs.yml diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml new file mode 100644 index 0000000000..2915cb7277 --- /dev/null +++ b/.github/workflows/techdocs.yml @@ -0,0 +1,46 @@ +name: TechDocs + +on: + pull_request: + paths: + - '.github/workflows/techdocs.yml' + - 'packages/techdocs-cli/**' + - 'plugins/techdocs/**' + +jobs: + build-container: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container + + name: Python ${{ matrix.node-version }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: verify docker build + uses: docker/build-push-action@v1 + with: + repository: spotify/techdocs + push: false + + lint: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.7] + + defaults: + run: + working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container/techdocs-core + + name: Python ${{ matrix.node-version }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: lint mkdocs-core package + working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container/techdocs-core + run: | + pip install -r requirements.txt + python -m black --check src/ From ba040202288c95957dda019014a1b9df9fc0dc71 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:38:53 +0200 Subject: [PATCH 23/53] fixup --- .github/workflows/techdocs.yml | 36 +++++++++++++--------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 2915cb7277..0ab01b584f 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -8,23 +8,7 @@ on: - 'plugins/techdocs/**' jobs: - build-container: - runs-on: ubuntu-latest - - defaults: - run: - working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container - - name: Python ${{ matrix.node-version }} on ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - name: verify docker build - uses: docker/build-push-action@v1 - with: - repository: spotify/techdocs - push: false - - lint: + build: runs-on: ${{ matrix.os }} strategy: @@ -32,14 +16,22 @@ jobs: os: [ubuntu-latest] python-version: [3.7] - defaults: - run: - working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container/techdocs-core - name: Python ${{ matrix.node-version }} on ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: lint mkdocs-core package + + # Validate Docker Container + - name: prepare docker build + working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container + run: '' + - name: verify docker build + uses: docker/build-push-action@v1 + with: + repository: spotify/techdocs + push: false + + # Lint Python code for techdocs-core package + - name: lint techdocs-core package working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container/techdocs-core run: | pip install -r requirements.txt From c6220fff50d65d4f00900fe622cb2a915995c45b Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:41:42 +0200 Subject: [PATCH 24/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 0ab01b584f..f09ad12484 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -23,7 +23,7 @@ jobs: # Validate Docker Container - name: prepare docker build working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container - run: '' + run: ls - name: verify docker build uses: docker/build-push-action@v1 with: From 48076c862ef81579ca89ca15f391eea7b54708de Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:42:48 +0200 Subject: [PATCH 25/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index f09ad12484..b004fa717a 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -22,7 +22,7 @@ jobs: # Validate Docker Container - name: prepare docker build - working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container + working-directory: ${{ runner.temp }} run: ls - name: verify docker build uses: docker/build-push-action@v1 From 8273fc0405c7b97eafe2c445753cc36c4d82fe10 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:45:04 +0200 Subject: [PATCH 26/53] fixup --- .github/workflows/techdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index b004fa717a..cd79526327 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -22,7 +22,7 @@ jobs: # Validate Docker Container - name: prepare docker build - working-directory: ${{ runner.temp }} + working-directory: /plugins/techdocs/mkdocs/container run: ls - name: verify docker build uses: docker/build-push-action@v1 @@ -32,7 +32,7 @@ jobs: # Lint Python code for techdocs-core package - name: lint techdocs-core package - working-directory: ${{ runner.temp }}/plugins/techdocs/mkdocs/container/techdocs-core + working-directory: /plugins/techdocs/mkdocs/container/techdocs-core run: | pip install -r requirements.txt python -m black --check src/ From a4c01ea76118e0ae92dd13b09011df06eb250a1c Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:47:39 +0200 Subject: [PATCH 27/53] fixup --- .github/workflows/techdocs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index cd79526327..183678429c 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -10,6 +10,8 @@ on: jobs: build: runs-on: ${{ matrix.os }} + env: + TECHDOCS_CONTAINER_PATH: /plugins/techdocs/mkdocs/container strategy: matrix: @@ -22,7 +24,7 @@ jobs: # Validate Docker Container - name: prepare docker build - working-directory: /plugins/techdocs/mkdocs/container + working-directory: ${{env:TECHDOCS_CONTAINER_PATH}} run: ls - name: verify docker build uses: docker/build-push-action@v1 @@ -32,7 +34,7 @@ jobs: # Lint Python code for techdocs-core package - name: lint techdocs-core package - working-directory: /plugins/techdocs/mkdocs/container/techdocs-core + working-directory: ${{env:TECHDOCS_CONTAINER_PATH}}/techdocs-core run: | pip install -r requirements.txt python -m black --check src/ From fb19ad583996ca244a569edb05837207a80da60b Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:49:52 +0200 Subject: [PATCH 28/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 183678429c..af844ebc6b 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ${{ matrix.os }} env: - TECHDOCS_CONTAINER_PATH: /plugins/techdocs/mkdocs/container + TECHDOCS_CONTAINER_PATH: plugins/techdocs/mkdocs/container strategy: matrix: From 45f5fb08fe079fc6c729238d394fbed6dff4ab58 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 13:56:51 +0200 Subject: [PATCH 29/53] fixup --- .github/workflows/techdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index af844ebc6b..d734ac6d88 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,7 +24,7 @@ jobs: # Validate Docker Container - name: prepare docker build - working-directory: ${{env:TECHDOCS_CONTAINER_PATH}} + working-directory: ${env:TECHDOCS_CONTAINER_PATH} run: ls - name: verify docker build uses: docker/build-push-action@v1 @@ -34,7 +34,7 @@ jobs: # Lint Python code for techdocs-core package - name: lint techdocs-core package - working-directory: ${{env:TECHDOCS_CONTAINER_PATH}}/techdocs-core + working-directory: ${env:TECHDOCS_CONTAINER_PATH}/techdocs-core run: | pip install -r requirements.txt python -m black --check src/ From d581284890a653c1fbb7247cecd4effefff224e6 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 24 Jun 2020 14:01:13 +0200 Subject: [PATCH 30/53] chore(scaffolder): fixing the type deps --- plugins/scaffolder-backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 061f6ca814..c8c40d7b67 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -25,6 +25,7 @@ "@backstage/catalog-model": "^0.1.1-alpha.12", "@backstage/config": "^0.1.1-alpha.12", "@types/express": "^4.17.6", + "@types/dockerode": "^2.5.32", "compression": "^1.7.4", "cors": "^2.8.5", "dockerode": "^3.2.0", @@ -40,7 +41,6 @@ }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", - "@types/dockerode": "^2.5.32", "@types/fs-extra": "^9.0.1", "@types/git-url-parse": "^9.0.0", "@types/nodegit": "0.26.5", From cc8c3a9e7ddd41a4d2b7955c40c5b15dc920626c Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:06:51 +0200 Subject: [PATCH 31/53] fixup --- .github/workflows/techdocs.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index d734ac6d88..60d1da186a 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -10,8 +10,6 @@ on: jobs: build: runs-on: ${{ matrix.os }} - env: - TECHDOCS_CONTAINER_PATH: plugins/techdocs/mkdocs/container strategy: matrix: @@ -22,19 +20,9 @@ jobs: steps: - uses: actions/checkout@v2 - # Validate Docker Container - - name: prepare docker build - working-directory: ${env:TECHDOCS_CONTAINER_PATH} - run: ls - - name: verify docker build - uses: docker/build-push-action@v1 - with: - repository: spotify/techdocs - push: false - # Lint Python code for techdocs-core package - name: lint techdocs-core package - working-directory: ${env:TECHDOCS_CONTAINER_PATH}/techdocs-core + working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | pip install -r requirements.txt python -m black --check src/ From 56e1b0adec327f9006ca0a7079fdbd9e61ab1c54 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:09:07 +0200 Subject: [PATCH 32/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 60d1da186a..ccc9178724 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,5 +24,5 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - pip install -r requirements.txt + pip install --registry https://pypi.org/simple/ -r requirements.txt python -m black --check src/ From aca7a44817d1faa9b9d17fc2d1143015d84455f0 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:09:45 +0200 Subject: [PATCH 33/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index ccc9178724..d0c57f6fd6 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,5 +24,5 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - pip install --registry https://pypi.org/simple/ -r requirements.txt + pip install --index-url https://pypi.org/simple/ -r requirements.txt python -m black --check src/ From c1a6add47d396886589dfb89bcbf2e5d5a0aca52 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:11:52 +0200 Subject: [PATCH 34/53] fixup --- .github/workflows/techdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index d0c57f6fd6..1b7552dd60 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,5 +24,6 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | + pip install --upgrade pip install --index-url https://pypi.org/simple/ -r requirements.txt python -m black --check src/ From 931058601b36ab8253574d15d38fe90237eca421 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:12:31 +0200 Subject: [PATCH 35/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 1b7552dd60..cbfc770696 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,6 +24,6 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - pip install --upgrade + pip install --upgrade pip pip install --index-url https://pypi.org/simple/ -r requirements.txt python -m black --check src/ From f3302ef46b7ed9562df5e9aaffab3cbef81cae25 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:14:13 +0200 Subject: [PATCH 36/53] fixup --- .github/workflows/techdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index cbfc770696..c687552838 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,6 +24,6 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - pip install --upgrade pip + python -m pip install --upgrade pip pip install --index-url https://pypi.org/simple/ -r requirements.txt python -m black --check src/ From 691f28a83c2a09e60d962ad4050d95aa4aa1ed26 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:15:56 +0200 Subject: [PATCH 37/53] fixup --- .github/workflows/techdocs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index c687552838..c59ec0eed5 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,6 +24,6 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - python -m pip install --upgrade pip - pip install --index-url https://pypi.org/simple/ -r requirements.txt - python -m black --check src/ + python3 -m pip3 install --upgrade pip + python3 -m pip3 install --index-url https://pypi.org/simple/ -r requirements.txt + python3 -m black --check src/ From ceaba974e84fb925953179bb696bc3125ce155f6 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:16:36 +0200 Subject: [PATCH 38/53] fixup --- .github/workflows/techdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index c59ec0eed5..52b6d6bcfc 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -24,6 +24,6 @@ jobs: - name: lint techdocs-core package working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - python3 -m pip3 install --upgrade pip - python3 -m pip3 install --index-url https://pypi.org/simple/ -r requirements.txt + python3 -m pip install --upgrade pip + python3 -m pip install --index-url https://pypi.org/simple/ -r requirements.txt python3 -m black --check src/ From b9568cf0ce70ba1daa066e360399b24d7564ca71 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:19:42 +0200 Subject: [PATCH 39/53] fixup --- .../techdocs/mkdocs/container/techdocs-core/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt b/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt index 2a13d1a9da..70b28e00bd 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt +++ b/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt @@ -1,3 +1,6 @@ +# Fixes an error related to using Setuptools. +setuptools==47.3.1 + # The "base" version of the Mkdocs project. # Note: if you update this, also update `install_requires` in setup.py # https://github.com/mkdocs/mkdocs From 945594f2eb59506a6a51b8730186e9fb4e8a9dad Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:22:25 +0200 Subject: [PATCH 40/53] fixup --- .github/workflows/techdocs.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 52b6d6bcfc..b8e14087b9 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -21,9 +21,12 @@ jobs: - uses: actions/checkout@v2 # Lint Python code for techdocs-core package - - name: lint techdocs-core package - working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core + - name: prepare python environment run: | + python3 -m pip install --index-url https://pypi.org/simple/ setuptools python3 -m pip install --upgrade pip python3 -m pip install --index-url https://pypi.org/simple/ -r requirements.txt - python3 -m black --check src/ + + - name: lint techdocs-core package + run: | + python3 -m black --check ./plugins/techdocs/mkdocs/container/techdocs-core/src/ From d92ebf4908a46e04ab06c63c4e745165077ba2aa Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:22:36 +0200 Subject: [PATCH 41/53] fixup --- .../techdocs/mkdocs/container/techdocs-core/requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt b/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt index 70b28e00bd..2a13d1a9da 100644 --- a/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt +++ b/plugins/techdocs/mkdocs/container/techdocs-core/requirements.txt @@ -1,6 +1,3 @@ -# Fixes an error related to using Setuptools. -setuptools==47.3.1 - # The "base" version of the Mkdocs project. # Note: if you update this, also update `install_requires` in setup.py # https://github.com/mkdocs/mkdocs From 9ebd5e0960fa7759041667ff1656b418d62197e0 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:24:19 +0200 Subject: [PATCH 42/53] fixup --- .github/workflows/techdocs.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index b8e14087b9..9265bc9fdc 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -16,6 +16,9 @@ jobs: os: [ubuntu-latest] python-version: [3.7] + env: + TECHDOCS_CORE_PATH: ./plugins/techdocs/mkdocs/container/techdocs-core + name: Python ${{ matrix.node-version }} on ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -25,8 +28,9 @@ jobs: run: | python3 -m pip install --index-url https://pypi.org/simple/ setuptools python3 -m pip install --upgrade pip - python3 -m pip install --index-url https://pypi.org/simple/ -r requirements.txt + python3 -m pip install --index-url https://pypi.org/simple/ -r ${env:TECHDOCS_CORE_PATH}/requirements.txt - name: lint techdocs-core package + working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | - python3 -m black --check ./plugins/techdocs/mkdocs/container/techdocs-core/src/ + python3 -m black --check ${env:TECHDOCS_CORE_PATH}/src From 0c3ec164282a71baa935d4d5b564782bde602a44 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:24:30 +0200 Subject: [PATCH 43/53] fixup --- .github/workflows/techdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index 9265bc9fdc..bb0ded61cf 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -31,6 +31,5 @@ jobs: python3 -m pip install --index-url https://pypi.org/simple/ -r ${env:TECHDOCS_CORE_PATH}/requirements.txt - name: lint techdocs-core package - working-directory: ./plugins/techdocs/mkdocs/container/techdocs-core run: | python3 -m black --check ${env:TECHDOCS_CORE_PATH}/src From cbdc656aa75db0247b4e0c17b9bd326b71fea732 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Wed, 24 Jun 2020 14:27:10 +0200 Subject: [PATCH 44/53] fixup --- .github/workflows/techdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/techdocs.yml b/.github/workflows/techdocs.yml index bb0ded61cf..6d6a6e904e 100644 --- a/.github/workflows/techdocs.yml +++ b/.github/workflows/techdocs.yml @@ -28,8 +28,8 @@ jobs: run: | python3 -m pip install --index-url https://pypi.org/simple/ setuptools python3 -m pip install --upgrade pip - python3 -m pip install --index-url https://pypi.org/simple/ -r ${env:TECHDOCS_CORE_PATH}/requirements.txt + python3 -m pip install --index-url https://pypi.org/simple/ -r $TECHDOCS_CORE_PATH/requirements.txt - name: lint techdocs-core package run: | - python3 -m black --check ${env:TECHDOCS_CORE_PATH}/src + python3 -m black --check $TECHDOCS_CORE_PATH/src From 6ff00f26f5162d2792d0bd21f38873ff1585e5c5 Mon Sep 17 00:00:00 2001 From: Rob Tirserio Date: Wed, 24 Jun 2020 11:06:17 -0400 Subject: [PATCH 45/53] update plugin template to not trigger the notice header warning --- .../default-plugin/src/plugin.ts.hbs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/cli/templates/default-plugin/src/plugin.ts.hbs b/packages/cli/templates/default-plugin/src/plugin.ts.hbs index 01df20a06a..52cce54002 100644 --- a/packages/cli/templates/default-plugin/src/plugin.ts.hbs +++ b/packages/cli/templates/default-plugin/src/plugin.ts.hbs @@ -1,18 +1,18 @@ /* -* Copyright 2020 Spotify AB -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import { createPlugin, createRouteRef } from '@backstage/core'; import ExampleComponent from './components/ExampleComponent'; From e7fdca9f3b26c01da85fcc30c208dbe68811fb28 Mon Sep 17 00:00:00 2001 From: Rob Tirserio Date: Wed, 24 Jun 2020 11:45:09 -0400 Subject: [PATCH 46/53] fixes build errors --- packages/app/package.json | 1 + yarn.lock | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/packages/app/package.json b/packages/app/package.json index 6ccf48584f..7d8efb5bec 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -38,6 +38,7 @@ "@types/jest": "^25.2.2", "@types/jquery": "^3.3.34", "@types/node": "^12.0.0", + "@types/testing-library__react": "^10.2.0", "@types/zen-observable": "^0.8.0", "cross-env": "^7.0.0", "cypress": "^4.2.0", diff --git a/yarn.lock b/yarn.lock index 6d6063714d..98aae0f4c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -876,6 +876,14 @@ core-js "^2.6.5" regenerator-runtime "^0.13.4" +"@babel/runtime-corejs3@^7.10.2": + version "7.10.3" + resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.3.tgz#931ed6941d3954924a7aa967ee440e60c507b91a" + integrity sha512-HA7RPj5xvJxQl429r5Cxr2trJwOfPjKiqhCXcdQPSqO2G0RHPZpXu4fkYmBaTKCp2c/jRaMK9GB/lN+7zvvFPw== + dependencies: + core-js-pure "^3.0.0" + regenerator-runtime "^0.13.4" + "@babel/runtime-corejs3@^7.7.4", "@babel/runtime-corejs3@^7.8.3": version "7.9.2" resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz#26fe4aa77e9f1ecef9b776559bbb8e84d34284b7" @@ -891,6 +899,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3": + version "7.10.3" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.3.tgz#670d002655a7c366540c67f6fd3342cd09500364" + integrity sha512-RzGO0RLSdokm9Ipe/YD+7ww8X2Ro79qiXZF3HU9ljrM+qnJmH1Vqth+hbiQZy761LnMJTMitHDuKVYTk3k4dLw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.3.3", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -3197,6 +3212,16 @@ dom-accessibility-api "^0.4.2" pretty-format "^25.1.0" +"@testing-library/dom@^7.17.1": + version "7.17.2" + resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-7.17.2.tgz#d062e41336b885107bca8ffc7022eaf37cccaee1" + integrity sha512-TQAoIzoI9g64oNVJ+13i4cCh/DQp/n7fJOyMqlFB1oQVusPtSgiPImyb52CwtvPO7J0Im0+/4YcmxU9a+cVxxw== + dependencies: + "@babel/runtime" "^7.10.3" + aria-query "^4.2.2" + dom-accessibility-api "^0.4.5" + pretty-format "^25.5.0" + "@testing-library/jest-dom@^5.7.0": version "5.9.0" resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.9.0.tgz#86464c66cbe75e632b8adb636f539bfd0efc2c9c" @@ -3220,6 +3245,14 @@ "@babel/runtime" "^7.5.4" "@types/testing-library__react-hooks" "^3.0.0" +"@testing-library/react@*": + version "10.4.1" + resolved "https://registry.npmjs.org/@testing-library/react/-/react-10.4.1.tgz#d38dee4abab172c06f6cf8894c51190e6c503f61" + integrity sha512-QX31fRDGLnOdBYoQ95VEOYgRahaPfsI+toOaYhlvuGNFQrcagZv/KLWCIctRGB0h1PTsQt3JpLBbbLGM63yy5Q== + dependencies: + "@babel/runtime" "^7.10.3" + "@testing-library/dom" "^7.17.1" + "@testing-library/react@^9.3.2": version "9.5.0" resolved "https://registry.npmjs.org/@testing-library/react/-/react-9.5.0.tgz#71531655a7890b61e77a1b39452fbedf0472ca5e" @@ -4037,6 +4070,13 @@ "@types/react" "*" "@types/react-test-renderer" "*" +"@types/testing-library__react@^10.2.0": + version "10.2.0" + resolved "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-10.2.0.tgz#8234be1248ce6728b33922507cfe1224886ede8e" + integrity sha512-KbU7qVfEwml8G5KFxM+xEfentAAVj/SOQSjW0+HqzjPE0cXpt0IpSamfX4jGYCImznDHgQcfXBPajS7HjLZduw== + dependencies: + "@testing-library/react" "*" + "@types/testing-library__react@^9.1.2": version "9.1.3" resolved "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-9.1.3.tgz#35eca61cc6ea923543796f16034882a1603d7302" @@ -4730,6 +4770,14 @@ aria-query@^4.0.2: "@babel/runtime" "^7.7.4" "@babel/runtime-corejs3" "^7.7.4" +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== + dependencies: + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -7653,6 +7701,11 @@ dom-accessibility-api@^0.4.2: resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.3.tgz#93ca9002eb222fd5a343b6e5e6b9cf5929411c4c" integrity sha512-JZ8iPuEHDQzq6q0k7PKMGbrIdsgBB7TRrtVOUm4nSMCExlg5qQG4KXWTH2k90yggjM4tTumRGwTKJSldMzKyLA== +dom-accessibility-api@^0.4.5: + version "0.4.5" + resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.5.tgz#d9c1cefa89f509d8cf132ab5d250004d755e76e3" + integrity sha512-HcPDilI95nKztbVikaN2vzwvmv0sE8Y2ZJFODy/m15n7mGXLeOKGiys9qWVbFbh+aq/KYj2lqMLybBOkYAEXqg== + dom-converter@^0.2: version "0.2.0" resolved "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" From da60f9e50498bde5449759d7c626e7e30eb227ef Mon Sep 17 00:00:00 2001 From: Rob Tirserio Date: Wed, 24 Jun 2020 11:51:17 -0400 Subject: [PATCH 47/53] rollback package install --- packages/app/package.json | 1 - yarn.lock | 53 --------------------------------------- 2 files changed, 54 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 7d8efb5bec..6ccf48584f 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -38,7 +38,6 @@ "@types/jest": "^25.2.2", "@types/jquery": "^3.3.34", "@types/node": "^12.0.0", - "@types/testing-library__react": "^10.2.0", "@types/zen-observable": "^0.8.0", "cross-env": "^7.0.0", "cypress": "^4.2.0", diff --git a/yarn.lock b/yarn.lock index 98aae0f4c5..6d6063714d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -876,14 +876,6 @@ core-js "^2.6.5" regenerator-runtime "^0.13.4" -"@babel/runtime-corejs3@^7.10.2": - version "7.10.3" - resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.3.tgz#931ed6941d3954924a7aa967ee440e60c507b91a" - integrity sha512-HA7RPj5xvJxQl429r5Cxr2trJwOfPjKiqhCXcdQPSqO2G0RHPZpXu4fkYmBaTKCp2c/jRaMK9GB/lN+7zvvFPw== - dependencies: - core-js-pure "^3.0.0" - regenerator-runtime "^0.13.4" - "@babel/runtime-corejs3@^7.7.4", "@babel/runtime-corejs3@^7.8.3": version "7.9.2" resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz#26fe4aa77e9f1ecef9b776559bbb8e84d34284b7" @@ -899,13 +891,6 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3": - version "7.10.3" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.3.tgz#670d002655a7c366540c67f6fd3342cd09500364" - integrity sha512-RzGO0RLSdokm9Ipe/YD+7ww8X2Ro79qiXZF3HU9ljrM+qnJmH1Vqth+hbiQZy761LnMJTMitHDuKVYTk3k4dLw== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.3.3", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -3212,16 +3197,6 @@ dom-accessibility-api "^0.4.2" pretty-format "^25.1.0" -"@testing-library/dom@^7.17.1": - version "7.17.2" - resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-7.17.2.tgz#d062e41336b885107bca8ffc7022eaf37cccaee1" - integrity sha512-TQAoIzoI9g64oNVJ+13i4cCh/DQp/n7fJOyMqlFB1oQVusPtSgiPImyb52CwtvPO7J0Im0+/4YcmxU9a+cVxxw== - dependencies: - "@babel/runtime" "^7.10.3" - aria-query "^4.2.2" - dom-accessibility-api "^0.4.5" - pretty-format "^25.5.0" - "@testing-library/jest-dom@^5.7.0": version "5.9.0" resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.9.0.tgz#86464c66cbe75e632b8adb636f539bfd0efc2c9c" @@ -3245,14 +3220,6 @@ "@babel/runtime" "^7.5.4" "@types/testing-library__react-hooks" "^3.0.0" -"@testing-library/react@*": - version "10.4.1" - resolved "https://registry.npmjs.org/@testing-library/react/-/react-10.4.1.tgz#d38dee4abab172c06f6cf8894c51190e6c503f61" - integrity sha512-QX31fRDGLnOdBYoQ95VEOYgRahaPfsI+toOaYhlvuGNFQrcagZv/KLWCIctRGB0h1PTsQt3JpLBbbLGM63yy5Q== - dependencies: - "@babel/runtime" "^7.10.3" - "@testing-library/dom" "^7.17.1" - "@testing-library/react@^9.3.2": version "9.5.0" resolved "https://registry.npmjs.org/@testing-library/react/-/react-9.5.0.tgz#71531655a7890b61e77a1b39452fbedf0472ca5e" @@ -4070,13 +4037,6 @@ "@types/react" "*" "@types/react-test-renderer" "*" -"@types/testing-library__react@^10.2.0": - version "10.2.0" - resolved "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-10.2.0.tgz#8234be1248ce6728b33922507cfe1224886ede8e" - integrity sha512-KbU7qVfEwml8G5KFxM+xEfentAAVj/SOQSjW0+HqzjPE0cXpt0IpSamfX4jGYCImznDHgQcfXBPajS7HjLZduw== - dependencies: - "@testing-library/react" "*" - "@types/testing-library__react@^9.1.2": version "9.1.3" resolved "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-9.1.3.tgz#35eca61cc6ea923543796f16034882a1603d7302" @@ -4770,14 +4730,6 @@ aria-query@^4.0.2: "@babel/runtime" "^7.7.4" "@babel/runtime-corejs3" "^7.7.4" -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -7701,11 +7653,6 @@ dom-accessibility-api@^0.4.2: resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.3.tgz#93ca9002eb222fd5a343b6e5e6b9cf5929411c4c" integrity sha512-JZ8iPuEHDQzq6q0k7PKMGbrIdsgBB7TRrtVOUm4nSMCExlg5qQG4KXWTH2k90yggjM4tTumRGwTKJSldMzKyLA== -dom-accessibility-api@^0.4.5: - version "0.4.5" - resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.5.tgz#d9c1cefa89f509d8cf132ab5d250004d755e76e3" - integrity sha512-HcPDilI95nKztbVikaN2vzwvmv0sE8Y2ZJFODy/m15n7mGXLeOKGiys9qWVbFbh+aq/KYj2lqMLybBOkYAEXqg== - dom-converter@^0.2: version "0.2.0" resolved "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" From eb4e894a24f96d44fa112446af9ceba3bbf50784 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 12:05:11 +0200 Subject: [PATCH 48/53] docs/auth: rename overview to README --- docs/auth/{overview.md => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/auth/{overview.md => README.md} (100%) diff --git a/docs/auth/overview.md b/docs/auth/README.md similarity index 100% rename from docs/auth/overview.md rename to docs/auth/README.md From 17adaefc5d43d713e885db877ba5cd0fc1b00165 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 18:50:13 +0200 Subject: [PATCH 49/53] packages: bump @testing-library packages to latest versions --- packages/app/package.json | 6 +- .../default-app/packages/app/package.json.hbs | 7 +- .../plugins/welcome/package.json.hbs | 5 +- .../templates/default-plugin/package.json.hbs | 7 +- packages/core-api/package.json | 6 +- packages/core/package.json | 6 +- packages/dev-utils/package.json | 6 +- packages/test-utils-core/package.json | 4 +- packages/test-utils/package.json | 6 +- plugins/catalog/package.json | 7 +- plugins/circleci/package.json | 7 +- plugins/explore/package.json | 7 +- plugins/gitops-profiles/package.json | 7 +- plugins/graphiql/package.json | 7 +- plugins/lighthouse/package.json | 7 +- plugins/register-component/package.json | 7 +- plugins/scaffolder/package.json | 7 +- plugins/sentry/package.json | 7 +- plugins/tech-radar/package.json | 7 +- plugins/techdocs/package.json | 7 +- plugins/welcome/package.json | 7 +- yarn.lock | 142 +++++++----------- 22 files changed, 114 insertions(+), 165 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 6ccf48584f..475c804361 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -32,9 +32,9 @@ }, "devDependencies": { "@testing-library/cypress": "^6.0.0", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/jquery": "^3.3.34", "@types/node": "^12.0.0", diff --git a/packages/cli/templates/default-app/packages/app/package.json.hbs b/packages/cli/templates/default-app/packages/app/package.json.hbs index 79120e0d7e..c7ef1756fd 100644 --- a/packages/cli/templates/default-app/packages/app/package.json.hbs +++ b/packages/cli/templates/default-app/packages/app/package.json.hbs @@ -18,12 +18,11 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "cross-env": "^7.0.0", "cypress": "^4.2.0", "eslint-plugin-cypress": "^2.10.3", diff --git a/packages/cli/templates/default-app/plugins/welcome/package.json.hbs b/packages/cli/templates/default-app/plugins/welcome/package.json.hbs index 904186ac60..b686abab9a 100644 --- a/packages/cli/templates/default-app/plugins/welcome/package.json.hbs +++ b/packages/cli/templates/default-app/plugins/welcome/package.json.hbs @@ -31,9 +31,8 @@ "devDependencies": { "@backstage/cli": "^{{version}}", "@backstage/dev-utils": "^{{version}}", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@types/testing-library__jest-dom": "^5.0.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index d5728213e9..da611a13b7 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -33,12 +33,11 @@ "devDependencies": { "@backstage/cli": "^{{version}}", "@backstage/dev-utils": "^{{version}}", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/packages/core-api/package.json b/packages/core-api/package.json index c6b25fc0f7..f9f206daf5 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -43,9 +43,9 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/test-utils-core": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", "@types/zen-observable": "^0.8.0", diff --git a/packages/core/package.json b/packages/core/package.json index 82ea259ba1..10a6c5d045 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -56,9 +56,9 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/test-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/classnames": "^2.2.9", "@types/google-protobuf": "^3.7.2", "@types/jest": "^25.2.2", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 65f92242da..fce1340386 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -35,9 +35,9 @@ "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/react": "^16.9", "react": "^16.12.0", "react-dom": "^16.12.0", diff --git a/packages/test-utils-core/package.json b/packages/test-utils-core/package.json index 60e0a6bdbe..8252d396ff 100644 --- a/packages/test-utils-core/package.json +++ b/packages/test-utils-core/package.json @@ -29,8 +29,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", "@types/react": "^16.9", "react": "^16.12.0", "react-dom": "^16.12.0" diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 51ab99fcb1..501e288754 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -34,9 +34,9 @@ "@backstage/test-utils-core": "^0.1.1-alpha.12", "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/react": "^16.9", "react": "^16.12.0", "react-dom": "^16.12.0", diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index c841b9dc7a..818a8c4bc6 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -41,13 +41,12 @@ "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", "@backstage/test-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", "@testing-library/react-hooks": "^3.3.0", - "@testing-library/user-event": "^10.2.4", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3", "msw": "^0.19.0", "react-test-renderer": "^16.13.1", diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index a938b9728b..8eede54580 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -47,13 +47,12 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", "@types/react-lazylog": "^4.5.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 755f0e50c3..dea3ffe87b 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -35,12 +35,11 @@ "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", "@backstage/test-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index bbf9b9c5d8..bfb0328909 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -34,12 +34,11 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 0277363ad1..af971f9160 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -46,13 +46,12 @@ "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", "@backstage/test-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/codemirror": "^0.0.96", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3", "react-router-dom": "6.0.0-alpha.5" }, diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 67d8bf143e..bb79e57179 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -36,12 +36,11 @@ "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", "@backstage/test-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 5c879ff8a1..738cabea4b 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -38,12 +38,11 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 313242f2c0..65322c31d6 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -34,12 +34,11 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 969445c1ec..2af4badc07 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -36,12 +36,11 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 660ad735bc..a288268670 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -38,14 +38,13 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/color": "^3.0.1", "@types/d3-force": "^1.2.1", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 068eb1ee22..1f83d6290f 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -33,12 +33,11 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index 3fb10b64e3..c4b9b5e5bd 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -34,12 +34,11 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", "@backstage/dev-utils": "^0.1.1-alpha.12", - "@testing-library/jest-dom": "^5.7.0", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^10.2.4", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^10.4.1", + "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", - "@types/testing-library__jest-dom": "^5.0.4", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/yarn.lock b/yarn.lock index 6d6063714d..e6522ed7c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -876,7 +876,15 @@ core-js "^2.6.5" regenerator-runtime "^0.13.4" -"@babel/runtime-corejs3@^7.7.4", "@babel/runtime-corejs3@^7.8.3": +"@babel/runtime-corejs3@^7.10.2": + version "7.10.3" + resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.3.tgz#931ed6941d3954924a7aa967ee440e60c507b91a" + integrity sha512-HA7RPj5xvJxQl429r5Cxr2trJwOfPjKiqhCXcdQPSqO2G0RHPZpXu4fkYmBaTKCp2c/jRaMK9GB/lN+7zvvFPw== + dependencies: + core-js-pure "^3.0.0" + regenerator-runtime "^0.13.4" + +"@babel/runtime-corejs3@^7.8.3": version "7.9.2" resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz#26fe4aa77e9f1ecef9b776559bbb8e84d34284b7" integrity sha512-HHxmgxbIzOfFlZ+tdeRKtaxWOMUoCG5Mu3wKeUmOxjYrwb3AAHgnmtCUbPPK11/raIWLIBK250t8E2BPO0p7jA== @@ -891,6 +899,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3": + version "7.10.3" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.3.tgz#670d002655a7c366540c67f6fd3342cd09500364" + integrity sha512-RzGO0RLSdokm9Ipe/YD+7ww8X2Ro79qiXZF3HU9ljrM+qnJmH1Vqth+hbiQZy761LnMJTMitHDuKVYTk3k4dLw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.3.3", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -2468,11 +2483,6 @@ dependencies: any-observable "^0.3.0" -"@sheerun/mutationobserver-shim@^0.3.2": - version "0.3.3" - resolved "https://registry.npmjs.org/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#5405ee8e444ed212db44e79351f0c70a582aae25" - integrity sha512-DetpxZw1fzPD5xUBrIAoplLChO2VB8DlL5Gg+I1IR9b2wPqYIca2WSUxL5g1vLeR4MsQq1NeWriXAVffV+U1Fw== - "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -3173,37 +3183,23 @@ "@testing-library/dom" "^7.0.2" "@types/testing-library__cypress" "^5.0.3" -"@testing-library/dom@^6.15.0": - version "6.16.0" - resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-6.16.0.tgz#04ada27ed74ad4c0f0d984a1245bb29b1fd90ba9" - integrity sha512-lBD88ssxqEfz0wFL6MeUyyWZfV/2cjEZZV3YRpb2IoJRej/4f1jB0TzqIOznTpfR1r34CNesrubxwIlAQ8zgPA== +"@testing-library/dom@^7.0.2", "@testing-library/dom@^7.17.1": + version "7.17.2" + resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-7.17.2.tgz#d062e41336b885107bca8ffc7022eaf37cccaee1" + integrity sha512-TQAoIzoI9g64oNVJ+13i4cCh/DQp/n7fJOyMqlFB1oQVusPtSgiPImyb52CwtvPO7J0Im0+/4YcmxU9a+cVxxw== dependencies: - "@babel/runtime" "^7.8.4" - "@sheerun/mutationobserver-shim" "^0.3.2" - "@types/testing-library__dom" "^6.12.1" - aria-query "^4.0.2" - dom-accessibility-api "^0.3.0" - pretty-format "^25.1.0" - wait-for-expect "^3.0.2" + "@babel/runtime" "^7.10.3" + aria-query "^4.2.2" + dom-accessibility-api "^0.4.5" + pretty-format "^25.5.0" -"@testing-library/dom@^7.0.2": - version "7.1.2" - resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-7.1.2.tgz#0942e3751beeea9820e14dd4bf685f1f1767353a" - integrity sha512-U0wLMbND1NUMUB65E9VmfuehT1GUSIHnT2zK7rjpDIdFNDbMtjDzbdaZXBYDp5lWzHJwUdPQozMd1GHp3O9gow== +"@testing-library/jest-dom@^5.10.1": + version "5.10.1" + resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.10.1.tgz#6508a9f007bd74e5d3c0b3135b668027ab663989" + integrity sha512-uv9lLAnEFRzwUTN/y9lVVXVXlEzazDkelJtM5u92PsGkEasmdI+sfzhZHxSDzlhZVTrlLfuMh2safMr8YmzXLg== dependencies: "@babel/runtime" "^7.9.2" - "@types/testing-library__dom" "^7.0.0" - aria-query "^4.0.2" - dom-accessibility-api "^0.4.2" - pretty-format "^25.1.0" - -"@testing-library/jest-dom@^5.7.0": - version "5.9.0" - resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.9.0.tgz#86464c66cbe75e632b8adb636f539bfd0efc2c9c" - integrity sha512-uZ68dyILuM2VL13lGz4ehFEAgxzvLKRu8wQxyAZfejWnyMhmipJ60w4eG81NQikJHBfaYXx+Or8EaPQTDwGfPA== - dependencies: - "@babel/runtime" "^7.9.2" - "@types/testing-library__jest-dom" "^5.0.2" + "@types/testing-library__jest-dom" "^5.9.1" chalk "^3.0.0" css "^2.2.4" css.escape "^1.5.1" @@ -3220,19 +3216,20 @@ "@babel/runtime" "^7.5.4" "@types/testing-library__react-hooks" "^3.0.0" -"@testing-library/react@^9.3.2": - version "9.5.0" - resolved "https://registry.npmjs.org/@testing-library/react/-/react-9.5.0.tgz#71531655a7890b61e77a1b39452fbedf0472ca5e" - integrity sha512-di1b+D0p+rfeboHO5W7gTVeZDIK5+maEgstrZbWZSSvxDyfDRkkyBE1AJR5Psd6doNldluXlCWqXriUfqu/9Qg== +"@testing-library/react@^10.4.1": + version "10.4.1" + resolved "https://registry.npmjs.org/@testing-library/react/-/react-10.4.1.tgz#d38dee4abab172c06f6cf8894c51190e6c503f61" + integrity sha512-QX31fRDGLnOdBYoQ95VEOYgRahaPfsI+toOaYhlvuGNFQrcagZv/KLWCIctRGB0h1PTsQt3JpLBbbLGM63yy5Q== dependencies: - "@babel/runtime" "^7.8.4" - "@testing-library/dom" "^6.15.0" - "@types/testing-library__react" "^9.1.2" + "@babel/runtime" "^7.10.3" + "@testing-library/dom" "^7.17.1" -"@testing-library/user-event@^10.2.4": - version "10.3.1" - resolved "https://registry.npmjs.org/@testing-library/user-event/-/user-event-10.3.1.tgz#8ed6fbfa40fbb866fa4666c9a62d7f7ff151f93b" - integrity sha512-HozvWlr/xHmkoJrrDdZBbUOXAC/STAeXGyNU+g5KgEwWBpLJi1RPCHJKbTjwz8hp2jDFsk/jjfD0530eZjcFEg== +"@testing-library/user-event@^12.0.7": + version "12.0.7" + resolved "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.0.7.tgz#6028d8de294ebd1cbf63812bc40f99e61b82f318" + integrity sha512-v/1DS6V6P5zJVq5HCC/NU93CQaqML+exslOOYRmE71ULvtOCS4Fv6A2wgBjIsEEecjZtdS2LF+KlrOK3KvVZBA== + dependencies: + "@babel/runtime" "^7.10.2" "@theme-ui/color-modes@^0.3.1": version "0.3.1" @@ -3815,13 +3812,6 @@ "@types/webpack" "*" "@types/webpack-dev-server" "*" -"@types/react-dom@*": - version "16.9.5" - resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.5.tgz#5de610b04a35d07ffd8f44edad93a71032d9aaa7" - integrity sha512-BX6RQ8s9D+2/gDhxrj8OW+YD4R+8hj7FEM/OJHGNR0KipE1h1mSsf39YeyC81qafkq+N3rU3h3RFbLSwE5VqUg== - dependencies: - "@types/react" "*" - "@types/react-helmet@^5.0.15": version "5.0.15" resolved "https://registry.npmjs.org/@types/react-helmet/-/react-helmet-5.0.15.tgz#af0370617307e9f062c6aee0f1f5588224ce646e" @@ -4008,21 +3998,14 @@ "@types/testing-library__dom" "*" cypress "*" -"@types/testing-library__dom@*", "@types/testing-library__dom@^6.12.1": +"@types/testing-library__dom@*": version "6.14.0" resolved "https://registry.npmjs.org/@types/testing-library__dom/-/testing-library__dom-6.14.0.tgz#1aede831cb4ed4a398448df5a2c54b54a365644e" integrity sha512-sMl7OSv0AvMOqn1UJ6j1unPMIHRXen0Ita1ujnMX912rrOcawe4f7wu0Zt9GIQhBhJvH2BaibqFgQ3lP+Pj2hA== dependencies: pretty-format "^24.3.0" -"@types/testing-library__dom@^7.0.0": - version "7.0.0" - resolved "https://registry.npmjs.org/@types/testing-library__dom/-/testing-library__dom-7.0.0.tgz#c0fb7d1c2495a3d26f19342102142d47500f0319" - integrity sha512-1TEPWyqQ6IQ7R1hCegZmFSA3KrBQjdzJW7yC9ybpRcFst5XuPOqBGNr0mTAKbxwI/TrTyc1skeyLJrpcvAf93w== - dependencies: - pretty-format "^25.1.0" - -"@types/testing-library__jest-dom@^5.0.2", "@types/testing-library__jest-dom@^5.0.4": +"@types/testing-library__jest-dom@^5.9.1": version "5.9.1" resolved "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.9.1.tgz#aba5ee062b7880f69c212ef769389f30752806e5" integrity sha512-yYn5EKHO3MPEMSOrcAb1dLWY+68CG29LiXKsWmmpVHqoP5+ZRiAVLyUHvPNrO2dABDdUGZvavMsaGpWNjM6N2g== @@ -4037,15 +4020,6 @@ "@types/react" "*" "@types/react-test-renderer" "*" -"@types/testing-library__react@^9.1.2": - version "9.1.3" - resolved "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-9.1.3.tgz#35eca61cc6ea923543796f16034882a1603d7302" - integrity sha512-iCdNPKU3IsYwRK9JieSYAiX0+aYDXOGAmrC/3/M7AqqSDKnWWVv07X+Zk1uFSL7cMTUYzv4lQRfohucEocn5/w== - dependencies: - "@types/react-dom" "*" - "@types/testing-library__dom" "*" - pretty-format "^25.1.0" - "@types/through@*": version "0.0.30" resolved "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" @@ -4722,13 +4696,13 @@ aria-query@^3.0.0: ast-types-flow "0.0.7" commander "^2.11.0" -aria-query@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/aria-query/-/aria-query-4.0.2.tgz#250687b4ccde1ab86d127da0432ae3552fc7b145" - integrity sha512-S1G1V790fTaigUSM/Gd0NngzEfiMy9uTUfMyHhKhVyy4cH5O/eTuR01ydhGL0z4Za1PXFTRGH3qL8VhUQuEO5w== +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== dependencies: - "@babel/runtime" "^7.7.4" - "@babel/runtime-corejs3" "^7.7.4" + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" arr-diff@^4.0.0: version "4.0.0" @@ -7643,15 +7617,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.3.0.tgz#511e5993dd673b97c87ea47dba0e3892f7e0c983" - integrity sha512-PzwHEmsRP3IGY4gv/Ug+rMeaTIyTJvadCb+ujYXYeIylbHJezIyNToe8KfEgHTCEYyC+/bUghYOGg8yMGlZ6vA== - -dom-accessibility-api@^0.4.2: - version "0.4.3" - resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.3.tgz#93ca9002eb222fd5a343b6e5e6b9cf5929411c4c" - integrity sha512-JZ8iPuEHDQzq6q0k7PKMGbrIdsgBB7TRrtVOUm4nSMCExlg5qQG4KXWTH2k90yggjM4tTumRGwTKJSldMzKyLA== +dom-accessibility-api@^0.4.5: + version "0.4.5" + resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.5.tgz#d9c1cefa89f509d8cf132ab5d250004d755e76e3" + integrity sha512-HcPDilI95nKztbVikaN2vzwvmv0sE8Y2ZJFODy/m15n7mGXLeOKGiys9qWVbFbh+aq/KYj2lqMLybBOkYAEXqg== dom-converter@^0.2: version "0.2.0" @@ -19022,11 +18991,6 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" -wait-for-expect@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/wait-for-expect/-/wait-for-expect-3.0.2.tgz#d2f14b2f7b778c9b82144109c8fa89ceaadaa463" - integrity sha512-cfS1+DZxuav1aBYbaO/kE06EOS8yRw7qOFoD3XtjTkYvCvh3zUvNST8DXK/nPaeqIzIv3P3kL3lRJn8iwOiSag== - wait-on@4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/wait-on/-/wait-on-4.0.0.tgz#4d7e4485ca759968897fd3b0cc50720c0b4ca959" From dbf66868180d6c42a55da860c138036af4a6f638 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 19:00:45 +0200 Subject: [PATCH 50/53] app,cli/templates: install @types/react-dom in app for @testing-library/react --- packages/app/package.json | 1 + .../templates/default-app/packages/app/package.json.hbs | 1 + yarn.lock | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/packages/app/package.json b/packages/app/package.json index 475c804361..118b4c15ff 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -38,6 +38,7 @@ "@types/jest": "^25.2.2", "@types/jquery": "^3.3.34", "@types/node": "^12.0.0", + "@types/react-dom": "^16.9.8", "@types/zen-observable": "^0.8.0", "cross-env": "^7.0.0", "cypress": "^4.2.0", diff --git a/packages/cli/templates/default-app/packages/app/package.json.hbs b/packages/cli/templates/default-app/packages/app/package.json.hbs index c7ef1756fd..31e6baa63e 100644 --- a/packages/cli/templates/default-app/packages/app/package.json.hbs +++ b/packages/cli/templates/default-app/packages/app/package.json.hbs @@ -23,6 +23,7 @@ "@testing-library/user-event": "^12.0.7", "@types/jest": "^25.2.2", "@types/node": "^12.0.0", + "@types/react-dom": "^16.9.8", "cross-env": "^7.0.0", "cypress": "^4.2.0", "eslint-plugin-cypress": "^2.10.3", diff --git a/yarn.lock b/yarn.lock index e6522ed7c9..dc34848cba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3812,6 +3812,13 @@ "@types/webpack" "*" "@types/webpack-dev-server" "*" +"@types/react-dom@^16.9.8": + version "16.9.8" + resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz#fe4c1e11dfc67155733dfa6aa65108b4971cb423" + integrity sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA== + dependencies: + "@types/react" "*" + "@types/react-helmet@^5.0.15": version "5.0.15" resolved "https://registry.npmjs.org/@types/react-helmet/-/react-helmet-5.0.15.tgz#af0370617307e9f062c6aee0f1f5588224ce646e" From 46dc28c4b02e7f00ed92a6268c3cd3753b084f19 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 19:38:56 +0200 Subject: [PATCH 51/53] plugins/lighthouse: fix CreateAudit test selecting child of button --- plugins/lighthouse/src/components/CreateAudit/index.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lighthouse/src/components/CreateAudit/index.test.tsx b/plugins/lighthouse/src/components/CreateAudit/index.test.tsx index ee0404fc22..aaf376923f 100644 --- a/plugins/lighthouse/src/components/CreateAudit/index.test.tsx +++ b/plugins/lighthouse/src/components/CreateAudit/index.test.tsx @@ -106,7 +106,7 @@ describe('CreateAudit', () => { fireEvent.click(rendered.getByText(/Create Audit/)); expect(rendered.getByLabelText(/URL/)).toBeDisabled(); - expect(rendered.getByText(/Create Audit/)).toBeDisabled(); + expect(rendered.getByText(/Create Audit/).parentElement).toBeDisabled(); }); }); From 0fa04efb971e37ac7cbf1ba8123bf58e3d2c23bc Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 18:03:35 +0200 Subject: [PATCH 52/53] docs/auth: add some more information about Identities --- docs/auth/README.md | 50 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/docs/auth/README.md b/docs/auth/README.md index 2806b2dccf..081d10add6 100644 --- a/docs/auth/README.md +++ b/docs/auth/README.md @@ -28,11 +28,53 @@ The method with which frontend plugins request access to third party services is through [Utility APIs](../getting-started/utility-apis.md) for each service provider. For a full list of providers, see [TODO](#TODO). -### Identity - TODO +### Identity - WIP -This documentation currently only covers the OAuth use-case, as identity -management is not settled yet and part of an -[upcoming milestone](https://github.com/spotify/backstage/milestone/12). +Identity management is still work in progress, but there are already a couple of +pieces in place that can be used. + +#### Identity for Plugin Developers + +As a plugin developer, there are two main touchpoints for identities: the +`IdentityApi` exported by `@backstage/core` via the `identityApiRef`, and a not +yet existing middleware exported by `@backstage/backend-common`. + +The `IdentityApi` gives access to the signed-in user's identity in the frontend. +It provides access to the user's ID, lightweight profile information, and an ID +token used to make authenticated calls within Backstage. + +The middleware that will be provided by `@backstage/backend-common` allows +verification of Backstage ID tokens, and optionally loading additional +information about the user. The progress is tracked in +https://github.com/spotify/backstage/issues/1435. + +#### Identity for App Developers + +If you're setting up your own Backstage app, or want to add a new identity +provider, there are three touchpoints: the frontend auth APIs in +`@backstage/core-api`, the backend auth providers in `auth-backend`, and the +`SignInPage` component configured in the Backstage app via `createApp`. + +The frontend APIs and backend providers are tightly coupled together for each +auth provider, and together they implement an e2e auth flow. Only some auth +providers also act as identity providers though. For example, at the moment of +writing, the Google Auth provider is able to act as a Backstage identity +provider, but the GitHub one can not. For an auth provider to also act as an +identity provider, it needs to implement the `BackstageIdentityApi` in the +frontend, and in the backend it needs to return a `BackstageIdentity` structure. + +It is up to each provider to implement the mapping between a provider identity +and the corresponding Backstage identity. That is currently still work in +progress, and as a stop-gap for example the Google provider returns the local +part of the user's email as the user ID. + +The final piece of the puzzle is the `SignInPage` component that can be +configured as part of the app. Without a sign-in page, Backstage will fall back +to a `guest` identity for all users, without any ID token. To enable sign-in, a +`SignInPage` needs to be configured, which in turn has to supply a user to the +app. The `@backstage/core` package provides a basic sign-in page that allows +both the user and the app developer to choose between a couple of different +sign-in methods. ## Further Reading From 2707b5ebd6382344ea8e5ab30af931133ee65676 Mon Sep 17 00:00:00 2001 From: HamzaBoukraa <15948623+HamzaBoukraa@users.noreply.github.com> Date: Wed, 24 Jun 2020 22:25:48 +0200 Subject: [PATCH 53/53] Updating FAQ.md related to issue #1441 (#1443) Repeated section in the FAQ #1441: Answering the question and replacing the repeated content. --- docs/FAQ.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index 5167139d45..e38fa84e73 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -97,17 +97,10 @@ app and configures which plugins are available to use in the app. ​ The **software engineer** uses the app's functionality and interacts with its plugins. ​ -### What is a "plugin" in Backstage? +### What is the use of a "plugin" in Backstage? + +​ A Backstage Plugin adds functionality to Backstage. ​ -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: -"[Will Spotify's internal plugins be open sourced, too?](https://github.com/spotify/backstage/blob/master/docs/FAQ.md#what-is-a-plugin-in-backstage)" -above) ### Do I have to write plugins in TypeScript?