Merge pull request #10017 from backstage/rugvip/roles-ci

Migrate to using repo commands in CI and root scripts
This commit is contained in:
Patrik Oldsberg
2022-03-06 09:50:18 +01:00
committed by GitHub
12 changed files with 57 additions and 31 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-airbrake-backend': patch
'@backstage/plugin-code-climate': patch
---
Added `backstage.role` to `package.json`
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
The `--since` flag of repo commands now silently falls back to using the provided `ref` directly if no merge base is available.
+3 -3
View File
@@ -119,7 +119,7 @@ jobs:
run: yarn backstage-cli config:check --lax
- name: lint
run: yarn lerna -- run lint --since origin/master
run: yarn backstage-cli repo lint --since origin/master
- name: type checking and declarations
run: yarn tsc:full
@@ -139,11 +139,11 @@ jobs:
- name: build changed packages
if: ${{ steps.yarn-lock.outcome == 'success' }}
run: yarn lerna -- run build --since origin/master --include-dependencies
run: yarn backstage-cli repo build --all --since origin/master
- name: build all packages
if: ${{ steps.yarn-lock.outcome == 'failure' }}
run: yarn lerna -- run build
run: yarn backstage-cli repo build --all
- name: verify type dependencies
run: yarn lint:type-deps
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
run: yarn tsc
- name: build
run: yarn build
run: yarn backstage-cli repo build
# Prepares a nightly release version of any package with pending changesets
# Pre-mode is exited if case we're in it, otherwise it has no effect
+7 -3
View File
@@ -102,13 +102,13 @@ jobs:
run: yarn backstage-cli config:check --lax
- name: lint
run: yarn lerna -- run lint
run: yarn backstage-cli repo lint
- name: type checking and declarations
run: yarn tsc:full
- name: build
run: yarn build
run: yarn backstage-cli repo build --all
- name: verify type dependencies
run: yarn lint:type-deps
@@ -188,7 +188,11 @@ jobs:
run: yarn tsc:full
- name: build packages
run: yarn lerna -- run --ignore example-app --ignore example-backend build
run: yarn backstage-cli repo build
- name: build embedded techdocs app
working-directory: packages/techdocs-cli-embedded-app
run: yarn build
# Publishes current version of packages that are not already present in the registry
- name: publish
+1 -2
View File
@@ -71,8 +71,7 @@ jobs:
# End of yarn setup
- run: yarn tsc
- name: yarn build
run: yarn build --ignore example-app --ignore example-backend --ignore @techdocs/cli
- run: yarn backstage-cli repo build
- name: run E2E test
run: |
sudo sysctl fs.inotify.max_user_watches=524288
+1 -2
View File
@@ -50,8 +50,7 @@ jobs:
run: yarn install --frozen-lockfile
- run: yarn tsc
- name: yarn build
run: yarn build --ignore example-app --ignore example-backend --ignore @techdocs/cli
- run: yarn backstage-cli repo build
- name: run E2E test
run: yarn e2e-test run
env:
+1 -1
View File
@@ -47,7 +47,7 @@ jobs:
# End of yarn setup
- name: lint
run: yarn lerna -- run lint
run: yarn backstage-cli repo lint
- name: type checking and declarations
run: yarn tsc:full
+3 -3
View File
@@ -8,7 +8,7 @@
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
"start": "yarn workspace example-app start",
"start-backend": "yarn workspace example-backend start",
"build": "lerna run build",
"build": "backstage-cli repo build --all",
"build:api-reports": "yarn build:api-reports:only --tsc",
"build:api-reports:only": "ts-node -T -P scripts/tsconfig.json scripts/api-extractor.ts",
"build:api-docs": "yarn build:api-reports --docs",
@@ -18,9 +18,9 @@
"diff": "lerna run diff --",
"test": "backstage-cli test",
"test:all": "lerna run test -- --coverage",
"lint": "lerna run lint --since origin/master --",
"lint": "backstage-cli repo lint --since origin/master",
"lint:docs": "node ./scripts/check-docs-quality",
"lint:all": "lerna run lint --",
"lint:all": "backstage-cli repo lint",
"lint:type-deps": "node scripts/check-type-dependencies.js",
"docker-build": "yarn tsc && yarn workspace example-backend build --build-dependencies && yarn workspace example-backend build-image",
"backstage-create": "backstage-cli create --scope backstage --no-private",
+9 -2
View File
@@ -50,9 +50,16 @@ export async function listChangedFiles(ref: string) {
if (!ref) {
throw new Error('ref is required');
}
const [base] = await runGit('merge-base', 'HEAD', ref);
const tracked = await runGit('diff', '--name-only', base);
let diffRef = ref;
try {
const [base] = await runGit('merge-base', 'HEAD', ref);
diffRef = base;
} catch {
// silently fall back to using the ref directly if merge base is not available
}
const tracked = await runGit('diff', '--name-only', diffRef);
const untracked = await runGit('ls-files', '--others', '--exclude-standard');
return Array.from(new Set([...tracked, ...untracked]));
+10 -7
View File
@@ -9,14 +9,17 @@
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin"
},
"scripts": {
"start": "backstage-cli backend:dev",
"build": "backstage-cli backend:build",
"lint": "backstage-cli lint",
"test": "backstage-cli test",
"prepack": "backstage-cli prepack",
"postpack": "backstage-cli postpack",
"clean": "backstage-cli clean"
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack",
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/backend-common": "^0.12.0",
+10 -7
View File
@@ -9,15 +9,18 @@
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "frontend-plugin"
},
"scripts": {
"build": "backstage-cli plugin:build",
"start": "backstage-cli plugin:serve",
"lint": "backstage-cli lint",
"test": "backstage-cli test",
"build": "backstage-cli package build",
"start": "backstage-cli package start",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"diff": "backstage-cli plugin:diff",
"prepack": "backstage-cli prepack",
"postpack": "backstage-cli postpack",
"clean": "backstage-cli clean"
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack",
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/catalog-model": "^0.12.0",