From 28226e9b046239cccae849b822ba054890b03c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Sat, 7 Mar 2020 22:56:47 +0100 Subject: [PATCH 1/9] Creat PR template --- .github/PULL_REQUEST_TEMPLATE.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..57746da2e8 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +## Hey, I just made a Pull Request! + + + +#### :heavy_check_mark: Checklist + +- [ ] All tests are passing `yarn test` +- [ ] Screenshots attached (for UI changes) +- [ ] Relevant documentation updated +- [ ] Prettier run on changed files +- [ ] Tests added for new functionality +- [ ] Regression tests added for bug fixes From 3e48e34d34c23bd2a7639f2ed942daa767a633f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Sat, 7 Mar 2020 23:00:11 +0100 Subject: [PATCH 2/9] Added CODEOWNERS ref --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 57746da2e8..7cdb05d5d2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,4 +10,5 @@ - [ ] Relevant documentation updated - [ ] Prettier run on changed files - [ ] Tests added for new functionality +- [ ] [CODEOWNERS](./CODEOWNERS) updated (for new stuff) - [ ] Regression tests added for bug fixes From c22106ac1248ba4c74e4c5320de970f80a235b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Sun, 8 Mar 2020 19:51:04 +0100 Subject: [PATCH 3/9] Tweak philosophy statement --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f2ccf8581e..2147c92a31 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Backstage is an open platform for building developer portals. -The philosophy behind Backstage is simple: don't expose your engineers to the full complexity of all your infrastructure tooling and services -- hide it behind a _single_ centralized, consistent user-friendly interface. +The philosophy behind Backstage is simple: Don't expose your engineers to the full complexity of your infrastructure tooling. Engineers should be shipping code — not figuring out a whole new toolset every time they want to implement the basics. ![headline](headline.png) @@ -17,10 +17,10 @@ At Spotify we believe that a better developer experience leads to happier and mo The Backstage platform consists of a number of different components: -- **frontend** Main web application that users interact with. It's built up by a number of different _Plugins_. Plugins all use a common set of platform API's and reusable UI components. Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_. -- **backend** GraphQL aggregation service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph. -- **proxy** Terminates HTTPS and exposes any RESTful API to Plugins. -- **identity** A backend service that holds your organisation's metadata. +- **frontend** - Main web application that users interact with. It's built up by a number of different _Plugins_. Plugins all use a common set of platform API's and reusable UI components. Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_. +- **backend** (not released yet) - GraphQL aggregation service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph. +- **proxy** - Terminates HTTPS and exposes any RESTful API to Plugins. +- **identity** (not released yet) - A backend service that holds your organisation's metadata. ![overview](backstage_overview.png) From e2ed248d4527f06dba46162f3d4c7df28e25ab42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Mon, 9 Mar 2020 09:03:23 +0100 Subject: [PATCH 4/9] Move down backend docs in README --- README.md | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2147c92a31..72decf3653 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,19 @@ The philosophy behind Backstage is simple: Don't expose your engineers to the fu ![headline](headline.png) -At Spotify we believe that a better developer experience leads to happier and more productive engineers. +At Spotify we [strongly believe](https://backstage.io/the-spotify-story) that a better developer experience leads to happier and more productive engineers. ## Overview The Backstage platform consists of a number of different components: -- **frontend** - Main web application that users interact with. It's built up by a number of different _Plugins_. Plugins all use a common set of platform API's and reusable UI components. Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_. -- **backend** (not released yet) - GraphQL aggregation service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph. +- **frontend** - Main web application that users interact with. It's built up by a number of different _Plugins_. +- **plugins** - Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins all use a common set of platform API's and reusable UI components. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_. +- **backend** * - GraphQL aggregation service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph. - **proxy** - Terminates HTTPS and exposes any RESTful API to Plugins. -- **identity** (not released yet) - A backend service that holds your organisation's metadata. +- **identity** * - A backend service that holds your organisation's metadata. + +_* not yet released_ ![overview](backstage_overview.png) @@ -28,23 +31,15 @@ The Backstage platform consists of a number of different components: ### Install Dependencies -To run the frontend, you will need to have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [NodeJS](https://nodejs.org/en/download/), and [yarn](https://classic.yarnpkg.com/en/docs/install#mac-stable) installed. +To run the frontend, you will need to have the following installed: -For running the backend, depending on your OS, you need [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/), [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/), or for Linux, [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/#install-compose-on-linux-systems). +* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +* [NodeJS](https://nodejs.org/en/download/) +* [yarn](https://classic.yarnpkg.com/en/docs/install#mac-stable) -The above dependencies are enough to run and work on the Backstage frontend packages. To develop backend services, there are some more tools to install, see [backend/README.md](backend/README.md). To update protobuf definitions, you will need another set of tools, see [proto/README.md](proto/README.md). +## Running the frontend locally -## Running Locally - -The full local system consists of a collection of backend services, as well as a web application. From the root of the project directory, run the following in a terminal to start up all backend services locally: - -```bash -$ cd backend - -$ docker-compose up --build -``` - -Once the backend services are up and running, open a separate terminal window and start the web app using the following commands from the project root: +Open a terminal window and start the web app using the following commands from the project root: ```bash $ yarn # may take a while @@ -68,8 +63,24 @@ This will prompt you to enter an ID for your plugin, and then create your plugin If you have `yarn start` already running you should be able to see the default page for your new plugin at [localhost:3000/my-plugin](http://localhost:3000/my-plugin), if you called the plugin `"my-plugin"`. +## Running the backend(s) locally + +For running the backend, depending on your OS, you need [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/), [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/), or for Linux, [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/#install-compose-on-linux-systems). + +The full local system consists of a collection of backend services, as well as a web application. From the root of the project directory, run the following in a terminal to start up all backend services locally: + +```bash +$ cd backend + +$ docker-compose up --build +``` + +To develop backend services, there are some more tools to install, see [backend/README.md](backend/README.md). To update protobuf definitions, you will need another set of tools, see [proto/README.md](proto/README.md). + ## Documentation +_TODO: Add links to docs on backstage.io_ + ## License Copyright 2020 Spotify AB. From b24d749d54e4388b738a7a10082ba1c9956bfdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Mon, 9 Mar 2020 09:26:25 +0100 Subject: [PATCH 5/9] Rm mac specific --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72decf3653..3c688e6fcc 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ To run the frontend, you will need to have the following installed: * [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) * [NodeJS](https://nodejs.org/en/download/) -* [yarn](https://classic.yarnpkg.com/en/docs/install#mac-stable) +* [yarn](https://classic.yarnpkg.com/en/docs/install) ## Running the frontend locally From ebf20c38ba1ea08e7866d8c4083be34c6ccabb78 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 9 Mar 2020 09:46:31 +0100 Subject: [PATCH 6/9] cli: forward test coverage flag --- packages/cli/src/commands/plugin/test.ts | 3 +++ packages/cli/src/index.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/cli/src/commands/plugin/test.ts b/packages/cli/src/commands/plugin/test.ts index e0433abb24..24fa502c10 100644 --- a/packages/cli/src/commands/plugin/test.ts +++ b/packages/cli/src/commands/plugin/test.ts @@ -8,6 +8,9 @@ export default async (cmd: Command) => { if (cmd.watch) { args.push('--watch'); } + if (cmd.coverage) { + args.push('--coverage'); + } try { const result = spawnSync('web-scripts', args, { stdio: 'inherit' }); diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index f8277756d9..bb5eb8f65d 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -41,6 +41,7 @@ const main = (argv: string[]) => { program .command('plugin:test') .option('--watch', 'Enable watch mode') + .option('--coverage', 'Report test coverage') .description('Run all tests for a plugin') .action(pluginTest); From e61dd46ceb3e5d9c80c1b49615877a36df79137d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 9 Mar 2020 09:56:45 +0100 Subject: [PATCH 7/9] package: run test and lint without stream or parallel --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b8bc51f039..7df61e65f0 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "scripts": { "start": "yarn build && yarn workspace @spotify-backstage/app start", "build": "lerna run build", - "test": "cross-env CI=true lerna run test --stream --parallel -- --coverage", + "test": "cross-env CI=true lerna run test -- --coverage", "create-plugin": "backstage-cli create-plugin", - "lint": "lerna run lint --stream" + "lint": "lerna run lint" }, "workspaces": { "packages": [ From 4127cdbed36bcc063534095bf27e610af86e64c7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 9 Mar 2020 09:57:03 +0100 Subject: [PATCH 8/9] cli: fix regex in createPlugin tests --- packages/cli/src/commands/createPlugin.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/commands/createPlugin.test.ts b/packages/cli/src/commands/createPlugin.test.ts index a7d6a6c78a..609c5d666b 100644 --- a/packages/cli/src/commands/createPlugin.test.ts +++ b/packages/cli/src/commands/createPlugin.test.ts @@ -97,7 +97,7 @@ describe('createPlugin', () => { createTemporaryPluginFolder(tempDir); movePlugin(tempDir, pluginDir, id); expect(fs.existsSync(pluginDir)).toBe(true); - expect(pluginDir).toMatch(`/packages\/plugins\/${id}`); + expect(pluginDir).toMatch(`/plugins\/${id}`); } finally { del.sync(tempDir, { force: true }); del.sync(rootDir, { force: true }); From d45d072120ca032754d4544ccb76308a6b26b7cf Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 9 Mar 2020 09:57:51 +0100 Subject: [PATCH 9/9] cli/commands/test: rename to testCommand to avoid jest picking it up --- packages/cli/src/commands/plugin/{test.ts => testCommand.ts} | 0 packages/cli/src/index.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/cli/src/commands/plugin/{test.ts => testCommand.ts} (100%) diff --git a/packages/cli/src/commands/plugin/test.ts b/packages/cli/src/commands/plugin/testCommand.ts similarity index 100% rename from packages/cli/src/commands/plugin/test.ts rename to packages/cli/src/commands/plugin/testCommand.ts diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index bb5eb8f65d..61fa36d2af 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -6,7 +6,7 @@ import watch from './commands/watch-deps'; import pluginBuild from './commands/plugin/build'; import pluginLint from './commands/plugin/lint'; import pluginServe from './commands/plugin/serve'; -import pluginTest from './commands/plugin/test'; +import pluginTest from './commands/plugin/testCommand'; process.on('unhandledRejection', err => { throw err;