Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 1 addition & 6 deletions .claude/skills/fix-ci/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ Before fixing anything, categorize every failure into this table.
| 1 | Formatting | "Formatting failed", biome/prettier diff | `pnpm run format` |
| 2 | Lint | Biome lint errors | `pnpm run check:fix` |
| 3 | TypeScript | TS2xxx errors, type mismatch | Fix the type error in source |
| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webhook-ingest` |
| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webapp` |
| 5 | Webapp tests | "FAIL" in webapp test output | Fix test or source, verify with `pnpm run test:webapp` |
| 5 | App server tests | Maven test failures, assertion errors | Fix test or source, verify with `cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=false -T 2C --batch-mode -q` |
| 5 | Webhook tests | Vitest failures in webhook-ingest | Fix test or source, verify with `pnpm run test:webhook-ingest` |
| 6 | OpenAPI sync | "OpenAPI out of sync" | `pnpm run generate:api` |
| 6 | DB schema | "Schema drift detected" | `pnpm run db:draft-changelog` |
| 6 | DB ERD | "ERD outdated" | `pnpm run db:generate-erd-docs` |
Expand All @@ -103,10 +102,6 @@ Then run tests for ALL components that had failures:
# If webapp tests failed:
pnpm run test:webapp

# If webhook-ingest tests failed:
pnpm run test:webhook-ingest


# If app-server tests failed:
cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=false -T 2C --batch-mode -q && cd ../..
```
Expand Down
37 changes: 10 additions & 27 deletions .claude/skills/land-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ git diff --name-only HEAD
Map paths to components (mirrors CI's dorny/paths-filter config):
- `webapp/**` → webapp changed
- `server/**` OR `scripts/db-utils.sh` → app-server changed
- `webhook-ingest/**` → webhook changed
- `package.json` OR `package-lock.json` OR `.node-version` → webapp + webhook changed
- `package.json` OR `package-lock.json` OR `.node-version` → webapp changed
- `docs/**` → docs-only (skip all validation if nothing else changed)

## 3. Format
Expand Down Expand Up @@ -73,26 +72,10 @@ pnpm run db:draft-changelog
pnpm run db:generate-erd-docs
```

## 6. Build Affected TS Services

If webhook changed:

```bash
pnpm run build:webhook-ingest
```

Build failures catch path alias and import issues that typecheck alone misses.

## 7. Unit Tests for Affected Components
## 6. Unit Tests for Affected Components

Run ONLY tests for changed components. Order: fastest first.

If webhook changed:

```bash
pnpm run test:webhook-ingest
```

If webapp changed:

```bash
Expand All @@ -107,7 +90,7 @@ cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=fals

ALL tests must pass before proceeding.

## 8. OpenAPI Sync Check
## 7. OpenAPI Sync Check

If app-server changed:

Expand All @@ -118,7 +101,7 @@ git diff --quiet || echo "WARNING: OpenAPI specs were out of sync - staging chan

Stage any drift that was caught.

## 9. Final Validation Pass
## 8. Final Validation Pass

Regeneration can produce unformatted code. Run one final pass:

Expand All @@ -129,7 +112,7 @@ pnpm run check

Both must pass.

## 10. Create Branch (if on main)
## 9. Create Branch (if on main)

```bash
git branch --show-current
Expand All @@ -143,7 +126,7 @@ git checkout -b <type>/<description>

Types: `feat`, `fix`, `docs`, `refactor`, `test`, `ci`, `chore`

## 11. Commit
## 10. Commit

```bash
git add -A
Expand All @@ -156,19 +139,19 @@ git commit -m "<type>(<scope>): <description>"
- Infra (no release): `ci`, `config`, `deps`, `deps-dev`, `docker`, `scripts`, `security`, `db`, `no-release`
- Feature: `gitprovider`, `leaderboard`, `mentor`, `notifications`, `profile`, `teams`, `workspace`

## 12. Push
## 11. Push

```bash
git push -u origin HEAD
```

## 13. Check if PR Exists
## 12. Check if PR Exists

```bash
PAGER=cat gh pr view --json number,url 2>/dev/null && echo "PR exists - skip creation" || echo "No PR - create one"
```

## 14. Create PR (if needed)
## 13. Create PR (if needed)

Skip if step 13 showed "PR exists".

Expand All @@ -184,7 +167,7 @@ PAGER=cat gh pr create --base main \
<steps to verify, or 'CI covers this'>"
```

## 15. Verify
## 14. Verify

```bash
PAGER=cat gh pr view --json url,title -q '"PR: \(.title)\nURL: \(.url)"'
Expand Down
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ renovate.json @ls1intum/hephaestus-maintainers
# Application Server (Java/Spring)
server/ @ls1intum/hephaestus-maintainers

# Webhook Ingest (TypeScript/Hono)
webhook-ingest/ @ls1intum/hephaestus-maintainers

# Webapp (React/TypeScript)
webapp/ @ls1intum/hephaestus-maintainers

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body:
options:
- Webapp (React UI)
- Application Server (Java/Spring, includes Pi mentor agent)
- Webhook Ingest
- Webhook Server (inbound webhook receiver)
- Don't know
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TITLE FORMAT (required):
<type>(<scope>): <description>

Types: feat | fix | docs | refactor | test | ci | perf | revert
Scopes (Service): webapp | server | ai | webhooks | docs
Scopes (Service): webapp | server | ai | docs
Scopes (Infra - NO RELEASE): ci | config | deps | deps-dev | docker | scripts | security | db | no-release
Scopes (Feature): gitprovider | leaderboard | mentor | notifications | profile | teams | workspace

Expand Down
4 changes: 0 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ application-server:
- changed-files:
- any-glob-to-any-file: server/**

webhook-ingest:
- changed-files:
- any-glob-to-any-file: "webhook-ingest/**"

ci:
- changed-files:
- any-glob-to-any-file:
Expand Down
8 changes: 2 additions & 6 deletions .github/prompts/fix-ci.prompt.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
mode: agent
description: Diagnose and fix ALL failing CI checks on the current PR in a single pass
subtask: true
---

# Fix CI
Expand Down Expand Up @@ -58,10 +58,9 @@ Before fixing anything, categorize every failure into this table.
| 1 | Formatting | "Formatting failed", biome/prettier diff | `pnpm run format` |
| 2 | Lint | Biome lint errors | `pnpm run check:fix` |
| 3 | TypeScript | TS2xxx errors, type mismatch | Fix the type error in source |
| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webhook-ingest` |
| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webapp` |
| 5 | Webapp tests | "FAIL" in webapp test output | Fix test or source, verify with `pnpm run test:webapp` |
| 5 | App server tests | Maven test failures, assertion errors | Fix test or source, verify with `cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=false -T 2C --batch-mode -q` |
Comment on lines +61 to 63

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Build-failure guidance is scoped too narrowly.

The “Build failure” row currently validates only webapp builds. For server-side compile/build failures, this sends contributors down the wrong path.

Suggested adjustment
-| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webapp` |
+| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webapp` (webapp) or `cd server && ./mvnw -DskipTests compile --batch-mode -q` (app-server) |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webapp` |
| 5 | Webapp tests | "FAIL" in webapp test output | Fix test or source, verify with `pnpm run test:webapp` |
| 5 | App server tests | Maven test failures, assertion errors | Fix test or source, verify with `cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=false -T 2C --batch-mode -q` |
| 4 | Build failure | Compilation errors, missing exports | Fix imports/exports, verify with `pnpm run build:webapp` (webapp) or `cd server && ./mvnw -DskipTests compile --batch-mode -q` (app-server) |
| 5 | Webapp tests | "FAIL" in webapp test output | Fix test or source, verify with `pnpm run test:webapp` |
| 5 | App server tests | Maven test failures, assertion errors | Fix test or source, verify with `cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=false -T 2C --batch-mode -q` |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/prompts/fix-ci.prompt.md around lines 61 - 63, Update the "Build
failure" row (the table cell containing the literal text "Build failure") so it
covers both webapp and server-side compile/build failures: instruct contributors
to verify the webapp with `pnpm run build:webapp` and also to run the server
build (e.g., `cd server && ./mvnw -DskipTests=false package` or the project's
canonical server build command) and to check for missing exports or compilation
errors in both codebases; ensure the row includes both commands and a brief note
to run the server test/build command shown elsewhere in the file (e.g., the App
server tests row commands) so server-side CI failures are diagnosed correctly.

| 5 | Webhook tests | Vitest failures in webhook-ingest | Fix test or source, verify with `pnpm run test:webhook-ingest` |
| 6 | OpenAPI sync | "OpenAPI out of sync" | `pnpm run generate:api` |
| 6 | DB schema | "Schema drift detected" | `pnpm run db:draft-changelog` |
| 6 | DB ERD | "ERD outdated" | `pnpm run db:generate-erd-docs` |
Expand All @@ -88,9 +87,6 @@ Then run tests for ALL components that had failures:
# If webapp tests failed:
pnpm run test:webapp

# If webhook-ingest tests failed:
pnpm run test:webhook-ingest

# If app-server tests failed:
cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=false -T 2C --batch-mode -q && cd ../..
```
Expand Down
43 changes: 13 additions & 30 deletions .github/prompts/land-pr.prompt.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
mode: agent
description: Validate, branch, commit, and create PR following Hephaestus conventions
subtask: true
---

# Land PR
Expand All @@ -21,9 +21,8 @@ git diff --name-only HEAD

Map paths to components (mirrors CI's dorny/paths-filter config):
- `webapp/**` → webapp changed
- `server/**` OR `scripts/db-utils.sh` → app-server changed
- `webhook-ingest/**` → webhook changed
- `package.json` OR `package-lock.json` OR `.node-version` → webapp + webhook changed
- `server/**` OR `scripts/db-utils.sh` → app-server changed (includes webhook receiver since ADR 0008)
- `package.json` OR `package-lock.json` OR `.node-version` → webapp changed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Lockfile change detection misses pnpm lockfile updates.

This mapping tracks package-lock.json but not pnpm-lock.yaml. Dependency-only changes in pnpm can be missed by the “changed components” logic in this prompt.

Suggested adjustment
-- `package.json` OR `package-lock.json` OR `.node-version` → webapp changed
+- `package.json` OR `pnpm-lock.yaml` OR `.node-version` → webapp changed
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `package.json` OR `package-lock.json` OR `.node-version` → webapp changed
- `package.json` OR `pnpm-lock.yaml` OR `.node-version` → webapp changed
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/prompts/land-pr.prompt.md at line 25, The lockfile change detection
line that currently reads "`package.json` OR `package-lock.json` OR
`.node-version` → webapp changed" misses pnpm's lockfile; update the mapping in
the prompt to include `pnpm-lock.yaml` (e.g., add "OR `pnpm-lock.yaml`") so
dependency-only changes with pnpm are detected; ensure you update the exact
string in the prompt (the line containing `package-lock.json`/`.node-version`)
so the changed-components logic recognizes pnpm lockfile updates.

- `docs/**` → docs-only (skip all validation if nothing else changed)

## 3. Format
Expand Down Expand Up @@ -59,26 +58,10 @@ pnpm run db:draft-changelog
pnpm run db:generate-erd-docs
```

## 6. Build Affected TS Services

If webhook changed:

```bash
pnpm run build:webhook-ingest
```

Build failures catch path alias and import issues that typecheck alone misses.

## 7. Unit Tests for Affected Components
## 6. Unit Tests for Affected Components

Run ONLY tests for changed components. Order: fastest first.

If webhook changed:

```bash
pnpm run test:webhook-ingest
```

If webapp changed:

```bash
Expand All @@ -93,7 +76,7 @@ cd server && ./mvnw test -Dsurefire.includedGroups="unit" -Dmaven.test.skip=fals

ALL tests must pass before proceeding.

## 8. OpenAPI Sync Check
## 7. OpenAPI Sync Check

If app-server changed:

Expand All @@ -104,7 +87,7 @@ git diff --quiet || echo "WARNING: OpenAPI specs were out of sync - staging chan

Stage any drift that was caught.

## 9. Final Validation Pass
## 8. Final Validation Pass

Regeneration can produce unformatted code. Run one final pass:

Expand All @@ -115,7 +98,7 @@ pnpm run check

Both must pass.

## 10. Create Branch (if on main)
## 9. Create Branch (if on main)

```bash
git branch --show-current
Expand All @@ -129,7 +112,7 @@ git checkout -b <type>/<description>

Types: `feat`, `fix`, `docs`, `refactor`, `test`, `ci`, `chore`

## 11. Commit
## 10. Commit

```bash
git add -A
Expand All @@ -138,23 +121,23 @@ git commit -m "<type>(<scope>): <description>"

**Scopes:**

- Service: `webapp`, `server`, `ai`, `webhooks`, `docs`
- Service: `webapp`, `server`, `docs`
- Infra (no release): `ci`, `config`, `deps`, `deps-dev`, `docker`, `scripts`, `security`, `db`, `no-release`
- Feature: `gitprovider`, `leaderboard`, `mentor`, `notifications`, `profile`, `teams`, `workspace`

## 12. Push
## 11. Push

```bash
git push -u origin HEAD
```

## 13. Check if PR Exists
## 12. Check if PR Exists

```bash
PAGER=cat gh pr view --json number,url 2>/dev/null && echo "PR exists - skip creation" || echo "No PR - create one"
```

## 14. Create PR (if needed)
## 13. Create PR (if needed)

Skip if step 13 showed "PR exists".

Expand All @@ -170,7 +153,7 @@ PAGER=cat gh pr create --base main \
<steps to verify, or 'CI covers this'>"
```

## 15. Verify
## 14. Verify

```bash
PAGER=cat gh pr view --json url,title -q '"PR: \(.title)\nURL: \(.url)"'
Expand Down
32 changes: 4 additions & 28 deletions .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ on:
required: false
type: string
default: "true"
webhook_ingest_changed:
description: "Whether webhook-ingest files changed (or should build for other reasons)"
required: false
type: string
default: "true"
agent_images_changed:
description: "Whether agent image files changed (or should build for other reasons)"
required: false
Expand Down Expand Up @@ -76,29 +71,10 @@ jobs:
org.opencontainers.image.licenses=MIT
hephaestus.component=application-server

webhook-ingest-build:
name: "Webhook"
if: inputs.should_skip != 'true' && inputs.webhook_ingest_changed == 'true'
uses: ./.github/workflows/reusable-docker-build.yml
with:
image-name: "ls1intum/hephaestus/webhook-ingest"
docker-file: "./webhook-ingest/Dockerfile"
# Context = repo root so the Dockerfile can COPY pnpm-lock.yaml,
# pnpm-workspace.yaml, and the workspace package.json files needed for
# `pnpm install --filter webhook-ingest...` to resolve the workspace graph.
docker-context: "."
registry: "ghcr.io"
tags: |
${{ github.ref_name }}
${{ github.sha }}
ci-${{ github.run_number }}
${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'latest' }}
labels: |
org.opencontainers.image.title=Hephaestus Webhook Ingest
org.opencontainers.image.description=Hono/TypeScript-based webhook processor for Hephaestus
org.opencontainers.image.vendor=AET TUM
org.opencontainers.image.licenses=MIT
hephaestus.component=webhook-ingest
# Note: the inbound webhook receiver lives in the application-server image
# (gitprovider.webhook package) and is deployed as a separate container via
# SPRING_PROFILES_ACTIVE=prod,webhook. No separate image build is required. See
# docker/compose.core.yaml (webhook-server service) and ADR 0008.

agent-pi-build:
name: "Agent: Pi"
Expand Down
Loading
Loading