Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## What does this change?

<!-- One or two sentences. Link the issue if there is one. -->

## Checklist

- [ ] `yarn lint`, `yarn tsc`, `yarn test` and `yarn prettier:check` pass locally
- [ ] A changeset is included if a published package changed (`yarn changeset`, see CONTRIBUTING.md)
- [ ] Docs (`README.md` / `docs/`) updated if the behaviour or configuration changed
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
# Keeps the action versions in .github/workflows up to date. The npm
# dependencies are deliberately left out: this is a Yarn 4 monorepo whose root
# package.json carries a long `resolutions` block, and per-package PRs against
# it are more churn than they are worth. Bump those with `yarn upgrade` and
# the Backstage version bumps instead.
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
commit-message:
prefix: ci
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Branch and pull request checks. Mirrors what CONTRIBUTING.md asks you to run
# before pushing (`yarn lint`, `yarn tsc`, `yarn test`, `yarn prettier:check`)
name: CI

on:
pull_request:
push:
branches: [master]

# One run per branch or pull request. A new push supersedes the run in flight.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
ci:
name: CI (node ${{ matrix.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# package.json engines allow "22 || 24"; .nvmrc pins v24, so that is the
# version the checks run on. Add 24.x here to cover both.
node-version: [22.x, 24.x]

env:
# `backstage-cli repo test` drops into jest's watch mode without this and
# the job would hang until the timeout. Also what the backend's
# setupTests.ts reads to let TestDatabases spawn its Postgres container.
CI: true
NODE_OPTIONS: --max-old-space-size=8192

steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Full history, so `changeset status --since=origin/<base>` below can
# diff the branch against the base branch.
fetch-depth: 0

- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn install --immutable

- name: Lint
run: yarn lint

# Plain `tsc`, not `tsc:full`: the latter passes --skipLibCheck false and
# then fails inside @testing-library/react's own .d.ts files because
# @types/react-dom isn't resolvable from there. That is a dependency
# problem, not a problem with this repo's sources.
- name: Type check
run: yarn tsc

# The backend's integration tests use Backstage's TestDatabases with
# POSTGRES_16, which starts its own Postgres through testcontainers on the
# runner's Docker daemon. No `services:` block is needed; set
# BACKSTAGE_TEST_DATABASE_POSTGRES16_CONNECTION_STRING here instead if you
# ever want to point them at an external database.
- name: Test
run: yarn test

- name: Build
run: yarn build

# Runs after the gates above on purpose: formatting is the cheapest thing
# to fix and the least interesting failure, so it shouldn't be what hides
# a type or test error. `yarn fix` formats whatever this reports. Add
# `continue-on-error: true` here if you'd rather it never failed a build.
- name: Prettier
run: yarn prettier:check

# Advisory only. `yarn changeset:check` isn't used here
- name: Changeset check (advisory)
if: github.event_name == 'pull_request'
continue-on-error: true
run: yarn changeset status --since=origin/${{ github.base_ref }}
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,23 @@ exports.up = async function up(knex) {
// reconciliation pass compares the catalog's `spec.owner` with the accepted
// owner, using `pr_id` to read the PR's state and `pr_checked_at` to
// throttle itself.
table
.string('pr_status')
.notNullable()
.defaultTo('none')
.checkIn(
[
'none',
'pending',
'raised',
'failed',
// No installed SCM provider can raise PRs for this repository host.
'unsupported_scm',
// Catalog owner matches the accepted team.
'completed',
// PR declined; retryable.
'declined',
// Someone else changed the owner.
'superseded',
],
'ownership_entities_pr_status_check',
);
table.string('pr_status').notNullable().defaultTo('none').checkIn(
[
'none',
'pending',
'raised',
'failed',
// No installed SCM provider can raise PRs for this repository host.
'unsupported_scm',
// Catalog owner matches the accepted team.
'completed',
// PR declined; retryable.
'declined',
// Someone else changed the owner.
'superseded',
],
'ownership_entities_pr_status_check',
);
table.text('pr_url').nullable();
table.string('pr_branch').nullable();
// Failed attempts since the last (re)enqueue.
Expand Down Expand Up @@ -152,24 +148,20 @@ exports.up = async function up(knex) {
table.string('confidence_reason').notNullable();
table.float('confidence_score').nullable();
table.integer('proposal_order').notNullable().defaultTo(1);
table
.string('status')
.notNullable()
.defaultTo('pending')
.checkIn(
[
'queued',
'pending',
'accepted',
'rejected',
'expired',
'cancelled',
// Candidate below the configured notificationThreshold: offered for
// voluntary claiming in the UI instead of being notified.
'possible_owner',
],
'ownership_proposals_status_check',
);
table.string('status').notNullable().defaultTo('pending').checkIn(
[
'queued',
'pending',
'accepted',
'rejected',
'expired',
'cancelled',
// Candidate below the configured notificationThreshold: offered for
// voluntary claiming in the UI instead of being notified.
'possible_owner',
],
'ownership_proposals_status_check',
);
table.integer('escalation_level').notNullable().defaultTo(0);
table.timestamp('notified_at').nullable();
table.timestamp('responded_at').nullable();
Expand Down
Loading