From b45577512616da069f099210b855140ccd52cc3e Mon Sep 17 00:00:00 2001 From: Adrian Martin Garcia Date: Sun, 12 Apr 2026 23:20:37 +0200 Subject: [PATCH 1/5] feat: add Docker image, tests, docs and CLI snapshot for v1.5.1 --- .dockerignore | 4 + .github/copilot-instructions.md | 77 ++++ .github/prompts/opsx-apply.prompt.md | 149 ++++++ .github/prompts/opsx-archive.prompt.md | 154 +++++++ .github/prompts/opsx-explore.prompt.md | 170 +++++++ .github/prompts/opsx-propose.prompt.md | 103 +++++ .github/skills/openspec-apply-change/SKILL.md | 156 +++++++ .../skills/openspec-archive-change/SKILL.md | 114 +++++ .github/skills/openspec-explore/SKILL.md | 288 ++++++++++++ .github/skills/openspec-propose/SKILL.md | 110 +++++ .github/updatecli/powerpipe.yaml | 23 + .github/workflows/copilot-setup-steps.yml | 30 ++ .github/workflows/docker-build.yml | 282 ++++++++++++ .gitignore | 16 + .hadolint.yaml | 9 + CONTRIBUTING.md | 97 ++++ Dockerfile | 50 ++ LICENSE | 21 + README.md | 117 ++++- cli-snapshot.json | 432 ++++++++++++++++++ docs/configuration.md | 120 +++++ docs/examples.md | 176 +++++++ docs/getting-started.md | 109 +++++ docs/kubernetes.md | 173 +++++++ docs/troubleshooting.md | 165 +++++++ examples/docker-compose.yml | 40 ++ examples/powerpipe.ppvars | 15 + package.json | 21 + .../compare_snapshots.cpython-314.pyc | Bin 0 -> 10154 bytes scripts/compare_snapshots.py | 166 +++++++ scripts/extract-cli-snapshot.sh | 124 +++++ scripts/extract-env-vars.sh | 28 ++ structure-tests.yaml | 87 ++++ .../conftest.cpython-314-pytest-9.0.2.pyc | Bin 0 -> 627 bytes .../conftest.cpython-314-pytest-9.0.3.pyc | Bin 0 -> 627 bytes ...are_snapshots.cpython-314-pytest-9.0.2.pyc | Bin 0 -> 40162 bytes ...are_snapshots.cpython-314-pytest-9.0.3.pyc | Bin 0 -> 40162 bytes tests/conftest.py | 5 + tests/requirements.txt | 2 + tests/test_compare_snapshots.py | 317 +++++++++++++ trivy.yaml | 9 + 41 files changed, 3958 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 .github/copilot-instructions.md create mode 100644 .github/prompts/opsx-apply.prompt.md create mode 100644 .github/prompts/opsx-archive.prompt.md create mode 100644 .github/prompts/opsx-explore.prompt.md create mode 100644 .github/prompts/opsx-propose.prompt.md create mode 100644 .github/skills/openspec-apply-change/SKILL.md create mode 100644 .github/skills/openspec-archive-change/SKILL.md create mode 100644 .github/skills/openspec-explore/SKILL.md create mode 100644 .github/skills/openspec-propose/SKILL.md create mode 100644 .github/updatecli/powerpipe.yaml create mode 100644 .github/workflows/copilot-setup-steps.yml create mode 100644 .github/workflows/docker-build.yml create mode 100644 .gitignore create mode 100644 .hadolint.yaml create mode 100644 CONTRIBUTING.md create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 cli-snapshot.json create mode 100644 docs/configuration.md create mode 100644 docs/examples.md create mode 100644 docs/getting-started.md create mode 100644 docs/kubernetes.md create mode 100644 docs/troubleshooting.md create mode 100644 examples/docker-compose.yml create mode 100644 examples/powerpipe.ppvars create mode 100644 package.json create mode 100644 scripts/__pycache__/compare_snapshots.cpython-314.pyc create mode 100644 scripts/compare_snapshots.py create mode 100755 scripts/extract-cli-snapshot.sh create mode 100755 scripts/extract-env-vars.sh create mode 100644 structure-tests.yaml create mode 100644 tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc create mode 100644 tests/__pycache__/conftest.cpython-314-pytest-9.0.3.pyc create mode 100644 tests/__pycache__/test_compare_snapshots.cpython-314-pytest-9.0.2.pyc create mode 100644 tests/__pycache__/test_compare_snapshots.cpython-314-pytest-9.0.3.pyc create mode 100644 tests/conftest.py create mode 100644 tests/requirements.txt create mode 100644 tests/test_compare_snapshots.py create mode 100644 trivy.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..050fa4c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.github +*.md +LICENSE diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..3c681be --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,77 @@ +# Copilot Instructions — devops-ia/powerpipe + +## Project Overview + +This repo maintains a community Docker image for [Powerpipe](https://powerpipe.io). Turbot stopped publishing official Docker images, so we build from their pre-compiled binaries. + +The image is a thin wrapper: it downloads the Powerpipe binary, sets up the runtime environment (UID 9193, dirs, env vars), and provides a default CMD. + +## Architecture + +``` +Dockerfile → builds the image (ARG POWERPIPE_VERSION controls version) +README.md → documents flags, env vars, quickstart, Kubernetes notes +cli-snapshot.json → machine-readable snapshot of CLI behavior (auto-generated) +scripts/ → extraction and comparison tools (do not modify) +package.json → semantic-release config (do not modify) +``` + +## When Upstream Releases a New Version + +1. Review the behavioral diff in the PR comment +2. Update `README.md`: + - Add new CLI flags to the flag tables + - Remove deprecated/removed flags + - Add new environment variables to the env var table + - Remove dropped environment variables + - Update the version in example commands if relevant +3. Update `Dockerfile`: + - Add/remove ENV vars if defaults changed + - Update HEALTHCHECK if the service behavior changed +4. Do NOT update `ARG POWERPIPE_VERSION` (updatecli handles this) +5. Do NOT modify `cli-snapshot.json` (CI regenerates it) + +## Files You SHOULD Modify + +- `README.md` — flag tables, env var tables, examples +- `Dockerfile` — ENV defaults, HEALTHCHECK, EXPOSE + +## Files You MUST NOT Modify + +- `.github/workflows/` — CI/CD pipelines +- `package.json` — semantic-release config +- `cli-snapshot.json` — auto-generated by CI +- `scripts/` — extraction tools +- `LICENSE` + +## How to Build and Test + +```bash +# Build +docker build -t powerpipe:test . + +# Smoke test +docker run --rm powerpipe:test powerpipe --version + +# Server test +docker run --rm -d --name pp-test -p 9033:9033 powerpipe:test powerpipe server +sleep 5 +curl -sf http://localhost:9033/ && echo "OK" +docker stop pp-test +``` + +## Documentation Format + +Flag tables use this format: +```markdown +| Flag | Description | Default | +|------|-------------|---------| +| `--listen` | Listen address (local/network) | `network` | +``` + +Env var tables use this format: +```markdown +| Variable | Image default | Description | +|----------|--------------|-------------| +| `POWERPIPE_LISTEN` | `network` | Interface to listen on | +``` diff --git a/.github/prompts/opsx-apply.prompt.md b/.github/prompts/opsx-apply.prompt.md new file mode 100644 index 0000000..494e10e --- /dev/null +++ b/.github/prompts/opsx-apply.prompt.md @@ -0,0 +1,149 @@ +--- +description: Implement tasks from an OpenSpec change (Experimental) +--- + +Implement tasks from an OpenSpec change. + +**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. + +**Steps** + +1. **Select the change** + + If a name is provided, use it. Otherwise: + - Infer from conversation context if the user mentioned a change + - Auto-select if only one active change exists + - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select + + Always announce: "Using change: " and how to override (e.g., `/opsx:apply `). + +2. **Check status to understand the schema** + ```bash + openspec status --change "" --json + ``` + Parse the JSON to understand: + - `schemaName`: The workflow being used (e.g., "spec-driven") + - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others) + +3. **Get apply instructions** + + ```bash + openspec instructions apply --change "" --json + ``` + + This returns: + - Context file paths (varies by schema) + - Progress (total, complete, remaining) + - Task list with status + - Dynamic instruction based on current state + + **Handle states:** + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` + - If `state: "all_done"`: congratulate, suggest archive + - Otherwise: proceed to implementation + +4. **Read context files** + + Read the files listed in `contextFiles` from the apply instructions output. + The files depend on the schema being used: + - **spec-driven**: proposal, specs, design, tasks + - Other schemas: follow the contextFiles from CLI output + +5. **Show current progress** + + Display: + - Schema being used + - Progress: "N/M tasks complete" + - Remaining tasks overview + - Dynamic instruction from CLI + +6. **Implement tasks (loop until done or blocked)** + + For each pending task: + - Show which task is being worked on + - Make the code changes required + - Keep changes minimal and focused + - Mark task complete in the tasks file: `- [ ]` → `- [x]` + - Continue to next task + + **Pause if:** + - Task is unclear → ask for clarification + - Implementation reveals a design issue → suggest updating artifacts + - Error or blocker encountered → report and wait for guidance + - User interrupts + +7. **On completion or pause, show status** + + Display: + - Tasks completed this session + - Overall progress: "N/M tasks complete" + - If all done: suggest archive + - If paused: explain why and wait for guidance + +**Output During Implementation** + +``` +## Implementing: (schema: ) + +Working on task 3/7: +[...implementation happening...] +✓ Task complete + +Working on task 4/7: +[...implementation happening...] +✓ Task complete +``` + +**Output On Completion** + +``` +## Implementation Complete + +**Change:** +**Schema:** +**Progress:** 7/7 tasks complete ✓ + +### Completed This Session +- [x] Task 1 +- [x] Task 2 +... + +All tasks complete! You can archive this change with `/opsx:archive`. +``` + +**Output On Pause (Issue Encountered)** + +``` +## Implementation Paused + +**Change:** +**Schema:** +**Progress:** 4/7 tasks complete + +### Issue Encountered + + +**Options:** +1.