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
42 changes: 42 additions & 0 deletions .gitea/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Quality

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
NODE_VERSION: 22.11.0
NPM_VERSION: 10.9.0

jobs:
quality:
name: Typecheck, lint, test, and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm install --global npm@${NPM_VERSION}
- run: npm ci
- run: npm run verify
- run: npm run build
- run: npm audit --omit=dev --audit-level=high

openspec-validate:
name: OpenSpec change validation (merge gate)
needs: quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm install --global npm@${NPM_VERSION}
- run: npm install --global @fission-ai/openspec@1.7.0
- run: npm ci
- run: npm run start --workspace @openspec-ui/cli -- validate --cwd "${{ github.workspace }}"
32 changes: 32 additions & 0 deletions .gitea/workflows/require-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Require changeset

on:
pull_request:
branches: [main]

jobs:
require-changeset:
name: Require a changeset when package source changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for a changeset when package source or manifests changed
run: |
set -e
BASE="origin/${{ github.event.pull_request.base.ref }}"
git fetch origin "${{ github.event.pull_request.base.ref }}" --depth=50
CHANGED=$(git diff --name-only "$BASE"...HEAD)
echo "Changed files:"
echo "$CHANGED"
if echo "$CHANGED" | grep -qE '^packages/[^/]+/(src/|package\.json$)'; then
if echo "$CHANGED" | grep -qE '^\.changeset/.*\.md$'; then
echo "Package source or manifest changed and a changeset is present. OK."
else
echo "::error::Package source or a package.json changed under packages/*/ but no .changeset/*.md file was added. Run 'npx changeset' and commit the result."
exit 1
fi
else
echo "No package source or manifest changed; changeset not required."
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schema: spec-driven
created: 2026-08-26
skip_specs: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## Why

Follow-up from the 2026-08-26 discussion, which asked for the CLI-based
merge gate to work the same way on both GitHub and Gitea, and the agreed
Gitea Actions plan. A proof-of-concept was validated end-to-end on the
user's own Gitea
instance (Gitea 1.26.4, self-hosted `ubuntu-latest` runner): a scratch
repository confirmed `actions/checkout@v4` (a GitHub Marketplace action)
runs unmodified, and a "require changeset when package source changed"
check correctly failed without a changeset and passed once one was
added. This change carries that validated approach into the actual
repository as reference/portable CI, so a fork or mirror hosted on
Gitea gets the same `@openspec-ui/cli validate` merge gate and the same
Changesets discipline as the GitHub-hosted original, without touching
`.github/workflows/` at all (Gitea ignores `.github/`, GitHub ignores
`.gitea/` — the two are additive, not conflicting).

## What Changes

- Add `.gitea/workflows/quality.yml`: mirrors the `quality` (typecheck,
lint, test, build, `npm audit`) and `openspec-validate` (the
`@openspec-ui/cli validate` merge gate — the concrete "same CLI on
both hosts" requirement) jobs from `.github/workflows/quality.yml`,
using `${{ github.workspace }}` (a context expression, confirmed
working during the POC) instead of the `$GITHUB_WORKSPACE` env var
(not independently verified on Gitea Actions).
- Add `.gitea/workflows/require-changeset.yml`: the POC's
require-a-changeset check, adapted to this repository's real
structure — gates on `packages/*/src/**` or `packages/*/package.json`
changes (not any file under `packages/`, which would over-trigger on
docs-only edits) lacking an accompanying `.changeset/*.md` file.
- Deliberately out of scope (not mirrored): `extension-integration`,
`release-extension` (uses `gh release`, GitHub-token-specific), and
`dependency-review` (`actions/dependency-review-action` is a
GitHub-only API integration, not Marketplace-portable) — these need
host-specific redesign, not a mechanical mirror, and are not part of
the validated POC scope.
- Not adding an equivalent changeset-presence check to
`.github/workflows/`: that would newly gate every existing GitHub PR
on this repository, a policy change distinct from Gitea-portability
and better made as its own explicit decision later if wanted.

## Capabilities

### New Capabilities

(none)

### Modified Capabilities

(none in the specified-behavior sense; `.openspec.yaml` sets
`skip_specs: true` — these are additional execution surfaces for the
same already-specified `quality-gates`/`ci-cli` behavior, not new or
changed product behavior)

## Impact

- `.gitea/workflows/quality.yml` (new)
- `.gitea/workflows/require-changeset.yml` (new)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## 1. Add the Gitea Actions workflows

- [x] 1.1 Add `.gitea/workflows/quality.yml`, mirroring
`.github/workflows/quality.yml`'s `quality` and `openspec-validate`
jobs (same steps, same pinned `NODE_VERSION`/`NPM_VERSION`), using
`${{ github.workspace }}` instead of `$GITHUB_WORKSPACE`.
- [x] 1.2 Add `.gitea/workflows/require-changeset.yml`, adapted from the
validated POC: gate on `packages/*/src/**` or `packages/*/package.json`
changes lacking an accompanying `.changeset/*.md` file.

## 2. Verification

- [x] 2.1 Both workflow files are valid YAML and were exercised in
equivalent form during the Gitea Actions POC on the user's own Gitea
instance (confirmed: `actions/checkout@v4` runs unmodified; the
require-changeset check fails without a changeset and passes with
one) — no product code changed, so no `npm run typecheck`/`lint`/
`test` impact.
- [x] 2.2 `npm run lint` (including `lint:english`) passes workspace-wide.
- [x] 2.3 Run `openspec change validate --strict add-gitea-actions-parity`.
Loading