From 5c16d1d937f3f28bc53c630b981d30a538b060e6 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 21 Mar 2020 10:59:23 +0100 Subject: [PATCH 1/8] workflows/frontend: add missing lint check --- .github/workflows/frontend.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 599ad8a893..8b9f22a909 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -31,6 +31,7 @@ jobs: - name: yarn install, build, and test run: | yarn install + yarn lint yarn build yarn test env: From 9528bed0b72765e177fcbd1844a518f98e0bca6b Mon Sep 17 00:00:00 2001 From: Vern Burton Date: Sat, 21 Mar 2020 16:55:10 -0500 Subject: [PATCH 2/8] adding issue templates for feature/bug (#329) --- .github/ISSUE_TEMPLATE/bug_template.md | 35 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_template.md | 18 +++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_template.md create mode 100644 .github/ISSUE_TEMPLATE/feature_template.md diff --git a/.github/ISSUE_TEMPLATE/bug_template.md b/.github/ISSUE_TEMPLATE/bug_template.md new file mode 100644 index 0000000000..8c1733a6a6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_template.md @@ -0,0 +1,35 @@ +--- +name: 'Bug Report' +about: 'Create Bug Report' +--- + + + +## Expected Behavior + + +## Current Behavior + + +## Possible Solution + + + +## Steps to Reproduce (for bugs) + + +1. +2. +3. +4. + +## Context + + + + +## Your Environment + +* NodeJS Version (v12): +* Operating System and Version (e.g. Ubuntu 14.04): +* Browser Information: \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_template.md b/.github/ISSUE_TEMPLATE/feature_template.md new file mode 100644 index 0000000000..17b543c27a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_template.md @@ -0,0 +1,18 @@ +--- +name: 'Feature Request' +about: 'Suggest new features and changes' +--- + + + +## Feature Suggestion + + + +## Possible Implementation + + +## Context + + + \ No newline at end of file From 9955e9cea6d67bd5170fc935a9f346fa18ac4e9b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 22 Mar 2020 16:08:45 +0100 Subject: [PATCH 3/8] cli: exclude templates dir from linting --- packages/cli/.eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/.eslintrc.js b/packages/cli/.eslintrc.js index 182a6df30a..f3f858836d 100644 --- a/packages/cli/.eslintrc.js +++ b/packages/cli/.eslintrc.js @@ -1,4 +1,5 @@ module.exports = { + ignorePatterns: ['templates/**'], rules: { 'no-console': 0, }, From fc5aa5dc48c00e7d121ecaa844beea42823a4e24 Mon Sep 17 00:00:00 2001 From: AndreasAugustin Date: Sun, 22 Mar 2020 19:23:06 +0100 Subject: [PATCH 4/8] #332 add .editorconfig The coniguration is set like the current file types have --- .editorconfig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..7f07aec2b9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,27 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space + +[*.{ts,json,js}] +indent_style = space +indent_size = 2 + +[*.md] +indent_size = 2 +indent_style = space + +[Dockerfile] +indent_style = space +indent_size = 2 + +[*.{yml,yaml}] +indent_size = 2 +indent_style = space From 24a4a74f23e890d395840b6d80e0d072e7c275df Mon Sep 17 00:00:00 2001 From: AndreasAugustin Date: Sun, 22 Mar 2020 19:40:42 +0100 Subject: [PATCH 5/8] #332 add *.tsx, *.jsx, *.html to the .editorconfig --- .editorconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 7f07aec2b9..c69a5cb18f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,11 @@ insert_final_newline = true charset = utf-8 indent_style = space -[*.{ts,json,js}] +[*.html] +indent_style = space +indent_size = 2 + +[*.{ts,json,js,tsx,jsx}] indent_style = space indent_size = 2 From 6923c2904ec112d516e9d79860c8899f056cde18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 19 Mar 2020 13:33:55 +0100 Subject: [PATCH 6/8] Make sure that minimist gets bumped past the vulnerable version --- yarn.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index dda14de215..a6914db055 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10772,12 +10772,12 @@ load-json-file@^5.3.0: type-fest "^0.3.0" loader-fs-cache@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.2.tgz#54cedf6b727e1779fd8f01205f05f6e88706f086" - integrity sha512-70IzT/0/L+M20jUlEqZhZyArTU6VKLRTYRDAYN26g4jfzpJqjipLL3/hgYpySqI9PwsVRHHFja0LfEmsx9X2Cw== + version "1.0.3" + resolved "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.3.tgz#f08657646d607078be2f0a032f8bd69dd6f277d9" + integrity sha512-ldcgZpjNJj71n+2Mf6yetz+c9bM4xpKtNds4LbqXzU/PTdeAX0g3ytnU1AJMEcTk2Lex4Smpe3Q/eCTsvUBxbA== dependencies: find-cache-dir "^0.1.1" - mkdirp "0.5.1" + mkdirp "^0.5.1" loader-runner@^2.4.0: version "2.4.0" @@ -11435,16 +11435,16 @@ minimist-options@^3.0.1: arrify "^1.0.1" is-plain-obj "^1.1.0" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - minimist@1.2.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + minimist@~0.0.1: version "0.0.10" resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" @@ -11537,12 +11537,12 @@ mkdirp@*: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea" integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g== -mkdirp@0.5.1, mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= +mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.3" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" + integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg== dependencies: - minimist "0.0.8" + minimist "^1.2.5" modify-values@^1.0.0: version "1.0.1" From 3195e2f2c440f045544e672190797eda4db53c4d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 22 Mar 2020 21:52:06 +0100 Subject: [PATCH 7/8] eslint: move copyright template to separate file --- .eslintrc.js | 22 ++-------------------- scripts/copyright.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 scripts/copyright.js diff --git a/.eslintrc.js b/.eslintrc.js index a7cf9c3694..c227c17938 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,21 +1,4 @@ -const copyrightTemplate = `/* - * 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. - */ - -`; - +const path = require('path') const base = require('@spotify-backstage/cli/config/eslint'); module.exports = { @@ -25,8 +8,7 @@ module.exports = { 'notice/notice': [ 'error', { - template: copyrightTemplate, - onNonMatchingHeader: 'replace', + templateFile: path.resolve(__dirname, "scripts/copyright.js"), }, ], }, diff --git a/scripts/copyright.js b/scripts/copyright.js new file mode 100644 index 0000000000..4376d55847 --- /dev/null +++ b/scripts/copyright.js @@ -0,0 +1,15 @@ +/* + * Copyright <%= YEAR %> 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 daa891cb2ee6c3350ad26cc2f31b06edc1d83104 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 22 Mar 2020 21:21:09 +0100 Subject: [PATCH 8/8] github/workflows: move cli e2e test to separate workflow, prepare for running on windows as well --- .github/workflows/cli.yml | 49 ++++++++++++++++++++++++++++++++++ .github/workflows/frontend.yml | 17 ++---------- 2 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/cli.yml diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml new file mode 100644 index 0000000000..31bf396f5f --- /dev/null +++ b/.github/workflows/cli.yml @@ -0,0 +1,49 @@ +name: CLI Test + +on: + pull_request: + paths: ['.github/workflows/cli.yml', 'packages/cli/**'] + types: [opened, reopened, edited, synchronize] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node-version: [12.x] + + name: Node ${{ matrix.node-version }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: find location of yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: use node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install + - run: yarn build + # This creates a new plugin and pollutes the workspace, so it should be run last. + - name: verify app serve and plugin creation + shell: bash + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + sudo sysctl fs.inotify.max_user_watches=524288 + fi + node scripts/cli-e2e-test.js + - name: yarn lint, test after plugin creation + working-directory: plugins/test-plugin + run: | + yarn lint + yarn test + env: + CI: true diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 8b9f22a909..5c8e5c43b9 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -13,9 +13,8 @@ jobs: node-version: [12.x] steps: - - name: checkout code - uses: actions/checkout@v2 - - name: get yarn cache + - uses: actions/checkout@v2 + - name: find location of yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v1 @@ -36,15 +35,3 @@ jobs: yarn test env: CI: true - # This creates a new plugin and pollutes the workspace, so it should be run last. - - name: verify app serve and plugin creation - run: | - sudo sysctl fs.inotify.max_user_watches=524288 - node scripts/cli-e2e-test.js - - name: yarn lint, test after plugin creation - working-directory: plugins/test-plugin - run: | - yarn lint - yarn test - env: - CI: true