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
27 changes: 27 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# The Docker image only needs nginx.conf + the prebuilt dist/ (see Dockerfile).
# Keep the build context small and avoid leaking source/secrets into the image.
node_modules
.git
.github
tests
scripts
src
contract
plugins
public
apps
tmp
.astro
playwright-report
test-results
*.md
.gitignore
.dockerignore
.env
Dockerfile
playwright*.js
astro.config.mjs
vite.config.js
tsconfig.json
package-lock.json
apps.json
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dependabot keeps npm dependencies and pinned GitHub Actions up to date.
# Action updates land as SHA bumps with the human-readable tag in a comment.
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
groups:
# Batch low-risk dev tooling into a single PR.
dev-dependencies:
dependency-type: development

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
127 changes: 65 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,112 +1,115 @@
# CI checks β€” run on every PR and push to main.
# CI β€” runs on every PR and push to the default branch.
#
# Fully hermetic: the build + E2E suites use the vendored docs-example fixture
# (tests/fixtures/docs-example.dist.tar.gz) via apps.json `prebuilt` entries, so
# no GITHUB_TOKEN, network, or sibling repo is required.
#
# Jobs:
# typecheck β€” astro check (TypeScript / Astro type errors)
# build β€” full headless build (fetches app releases via GITHUB_TOKEN)
# playwright β€” standalone Playwright tests against the preview server
# (no data-gateway needed β€” covers web-fragment contract)
#
# Full integration tests (marketplace.spec.js) require a running data-gateway
# and are run locally. See playwright.config.js.
# build β€” headless build from the vendored fixture; uploads dist/
# e2e β€” Playwright: embedded web-fragment harness + standalone layer
# audit β€” npm dependency vulnerability gate

name: CI

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

# Least privilege: jobs only read the repo. Override per-job if more is needed.
permissions:
contents: read

jobs:
# ── 1. TypeScript / Astro type-check ───────────────────────────────────────
# Non-blocking: `astro check` is memory-hungry and can OOM on standard runners
# (tracked separately). The `build` job below is the hard compile gate β€” a real
# type/template error fails `astro build`. This job surfaces strict diagnostics
# without wedging CI on an OOM.
typecheck:
name: Type-check
name: Type-check (non-blocking)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'
cache: npm

- name: Install dependencies
run: npm ci

- run: npm ci
- name: Astro type-check
run: npx astro check
env:
NODE_OPTIONS: --max-old-space-size=6144

# ── 2. Build ───────────────────────────────────────────────────────────────
# ── 2. Build (headless, hermetic) ──────────────────────────────────────────
build:
name: Build (headless)
runs-on: ubuntu-latest
needs: typecheck
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'
cache: npm

- name: Install dependencies
run: npm ci

# Fetches release artifacts from apps.json repos (AbsaOSS public repos)
# then builds the Astro site in headless/web-fragment mode.
- name: Build marketplace (headless)
- run: npm ci
# Builds from the committed apps.json (vendored fixture) β€” no token/network.
- name: Build (headless)
run: npm run build:headless
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MP_HEADLESS: 'true'

- name: Upload dist artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: dist
path: dist/
retention-days: 1
retention-days: 7

# ── 3. Playwright β€” standalone (no gateway) ────────────────────────────────
#
# Tests the fragment server directly on port 3000. Covers:
# - HTTP header safety (X-Frame-Options must not block the gateway iframe)
# - Headless mode (data-mp-headless, no chrome bar)
# - CSS link stability (data-astro-transition-persist present β€” prevents #297)
# - Asset routing (/__wf/knowledge-base/ rewrite via Astro preview plugin)
# - Client-side nav (no full reload, URL updates via pushState)
# ── 3. Playwright E2E ──────────────────────────────────────────────────────
#
playwright:
name: Playwright (standalone)
# Two layers, both hermetic (each webServer rebuilds from the fixture):
# β€’ embedded (playwright.config.js) β€” full web-fragment harness: host
# gateway proxies/embeds the fragment, shadow-DOM isolation, SPA routing,
# cross-app nav, asset 404s, history limitation.
# β€’ standalone (playwright.config.ci.js) β€” fragment server only: HTTP header
# safety, headless contract, CSS-link stability (#297), asset routing.
e2e:
name: E2E (Playwright)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'
cache: npm

- name: Install dependencies
run: npm ci

- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Install Playwright browsers
- run: npm ci
- name: Install Playwright browser
run: npx playwright install --with-deps chromium

- name: Run standalone tests
- name: Embedded web-fragment tests
run: npm test
- name: Standalone fragment tests
run: npx playwright test --config=playwright.config.ci.js

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: playwright-report
path: playwright-report/
retention-days: 7

# ── 4. Dependency audit ────────────────────────────────────────────────────
audit:
name: npm audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'
cache: npm
- run: npm ci
# Fail only on production-dependency vulnerabilities (high or above).
- name: Audit production dependencies
run: npm audit --omit=dev --audit-level=high
Loading
Loading