From 93e443d42fb0a375441558b0a212fa015af42257 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 3 Sep 2025 22:18:14 +0100 Subject: [PATCH 1/4] chore: add templates, CODEOWNERS, and CI workflow --- .github/CODEOWNERS | 9 ++++ .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 6 +++ .github/ISSUE_TEMPLATE/feature_request.md | 31 ++++++++++++++ .github/pull_request_template.md | 20 +++++++++ .github/workflows/ci.yml | 52 +++++++++++++++++++++++ 6 files changed, 156 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..e5f47b46 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,9 @@ +# Code owners control default reviewers and approvals. +# Use GitHub teams or usernames. Example: @org/team-name + +* @mrhpython + +# Examples (uncomment and adjust as teams evolve): +# backend/* @mrhpython +# agents/* @mrhpython + diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..8ff19eef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +name: Bug report +description: Report a problem to help us improve +title: "[bug] " +labels: [bug] +body: + - type: textarea + id: summary + attributes: + label: Summary + description: What happened? What did you expect? + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: Provide minimal steps to reproduce + placeholder: | + 1. Go to ... + 2. Run ... + 3. See error ... + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs / screenshots + description: Include relevant logs or screenshots + validations: + required: false + - type: input + id: version + attributes: + label: Version / commit + description: App version or git commit SHA + validations: + required: false + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..a0df7adb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +blank_issues_enabled: false +contact_links: + - name: Questions / help + url: https://github.com/mrhpython/Soulfield/discussions + about: Ask questions and discuss ideas in Discussions + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..b52da5a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,31 @@ +name: Feature request +description: Suggest an idea or improvement +title: "[feature] " +labels: [enhancement] +body: + - type: textarea + id: summary + attributes: + label: Summary + description: What problem does this solve? What’s the proposal? + validations: + required: true + - type: textarea + id: scope + attributes: + label: Scope / acceptance criteria + description: Define success and out-of-scope items + placeholder: | + - Must have: + - Nice to have: + - Out of scope: + validations: + required: false + - type: textarea + id: context + attributes: + label: Context / references + description: Links to specs, designs, or prior art + validations: + required: false + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..21f0d896 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +Title: + +Summary +- What changed and why (1–3 lines). + +Checklist +- [ ] Scope is minimal and focused +- [ ] CI green locally (if applicable) +- [ ] Tests added/updated or not applicable +- [ ] Docs updated or not applicable + +Validation +- Steps to verify manually: + 1. + 2. + +Links +- Related issue: # +- Context/spec: + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..ff7aaa3c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + node: + if: ${{ hashFiles('package.json') != '' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + - name: Install + run: npm ci + - name: Lint (if present) + run: npm run -s lint --if-present + - name: Test (if present) + run: npm run -s test --if-present + + python: + if: ${{ hashFiles('requirements.txt') != '' || hashFiles('pyproject.toml') != '' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install deps (if requirements.txt) + run: | + if [ -f requirements.txt ]; then + python -m pip install --upgrade pip + pip install -r requirements.txt + fi + - name: Run pytest if tests are present + run: | + if ls -1 tests test_*.py 2>/dev/null | grep -q .; then + pip install pytest + pytest -q + else + echo "No python tests found; skipping" + fi + From b8bb62876eacd97d09451567fa355bbfba5c37fd Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 3 Sep 2025 22:21:15 +0100 Subject: [PATCH 2/4] test: add FastAPI root endpoint sanity test --- tests/test_root.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/test_root.py diff --git a/tests/test_root.py b/tests/test_root.py new file mode 100644 index 00000000..c3a9b6ac --- /dev/null +++ b/tests/test_root.py @@ -0,0 +1,11 @@ +from fastapi.testclient import TestClient + +import main + + +def test_root_endpoint(): + client = TestClient(main.app) + res = client.get("/") + assert res.status_code == 200 + assert res.json().get("status") == "ok" + From e9a0e017fc9744d01d9d6b145ad8e2646a7c8eab Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 3 Sep 2025 22:21:30 +0100 Subject: [PATCH 3/4] chore: enable Dependabot for npm and pip --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..dd75460d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + From 5aa4963ebca9ef381169631aff020a5daa3677e3 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 3 Sep 2025 22:38:17 +0100 Subject: [PATCH 4/4] ci: add API /health check and .dockerignore --- .dockerignore | 23 +++++++++++++++++++++++ .github/workflows/ci.yml | 8 +++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..a373ed7f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +# Secrets / config +.env +.env.* +receipts/ + +# VCS +.git + +# Dependencies / caches +node_modules/ +.venv/ +__pycache__/ + +# Runtime data +data/ +sessions/ +workspace/data/ +backend/.agent-os/runs/ + +# OS/editor cruft +.DS_Store +*.log + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff7aaa3c..65f2978d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,13 @@ jobs: cache: 'npm' - name: Install run: npm ci + - name: API health (offline) + run: | + DEV_NO_API=1 node backend/index.cjs & + echo $! > api.pid + sleep 1 + curl -fsS http://127.0.0.1:8790/health | tee health.json + kill $(cat api.pid) - name: Lint (if present) run: npm run -s lint --if-present - name: Test (if present) @@ -49,4 +56,3 @@ jobs: else echo "No python tests found; skipping" fi -