|
| 1 | +# 0004 Python Checklist |
| 2 | + |
| 3 | +## Baseline |
| 4 | + |
| 5 | +- [x] Plugin work lives under `extended/plugins/send-message-python/`. |
| 6 | +- [x] The subtree stands alone. |
| 7 | +- [x] No committed Slack credential appears anywhere. |
| 8 | +- [x] The plugin owns Kubernetes reads and Slack calls. |
| 9 | + |
| 10 | +## Phase 0: pin the contract |
| 11 | + |
| 12 | +- [x] Re-read `proposal.md`. |
| 13 | +- [x] Re-read `spec.md`. |
| 14 | +- [x] Re-read the `send-message` slice in proposal `0002`. |
| 15 | +- [x] Keep scope to Slack only. |
| 16 | + |
| 17 | +## Phase 1: create the tiny repo |
| 18 | + |
| 19 | +- [x] Create `extended/plugins/send-message-python/`. |
| 20 | +- [x] Add runtime source. |
| 21 | +- [x] Add image build. |
| 22 | +- [x] Add `plugin.yaml`. |
| 23 | +- [x] Add CRD manifests. |
| 24 | +- [x] Add RBAC manifests. |
| 25 | +- [x] Add smoke assets. |
| 26 | + |
| 27 | +## Phase 2: implement the runtime |
| 28 | + |
| 29 | +- [x] Implement `POST /api/v1/step.execute`. |
| 30 | +- [x] Enforce bearer auth from `/var/run/kargo/token`. |
| 31 | +- [x] Read `MessageChannel`. |
| 32 | +- [x] Read `ClusterMessageChannel`. |
| 33 | +- [x] Read referenced `Secret`. |
| 34 | +- [x] Send plaintext Slack payloads. |
| 35 | +- [x] Send encoded Slack payloads. |
| 36 | +- [x] Return `slack.threadTS`. |
| 37 | + |
| 38 | +## Phase 3: test the contract |
| 39 | + |
| 40 | +- [x] Add auth tests. |
| 41 | +- [x] Add channel lookup tests. |
| 42 | +- [x] Add Secret lookup tests. |
| 43 | +- [x] Add plaintext payload tests. |
| 44 | +- [x] Add encoded payload tests. |
| 45 | +- [x] Add XML decode tests. |
| 46 | +- [x] Add Slack failure tests. |
| 47 | + |
| 48 | +## Phase 4: smoke |
| 49 | + |
| 50 | +- [x] Add plugin-owned `smoke/smoke_test.py`. |
| 51 | +- [x] Keep smoke orchestration in Python, not shell. |
| 52 | +- [x] Build the image. |
| 53 | +- [x] Load it into kind. |
| 54 | +- [x] Install CRDs and RBAC. |
| 55 | +- [x] Install StepPlugin `ConfigMap`. |
| 56 | +- [x] Create local-only test Secret. |
| 57 | +- [x] Create test `MessageChannel`. |
| 58 | +- [x] Run a `Stage` with `uses: send-message`. |
| 59 | +- [x] Assert `Succeeded`. |
| 60 | +- [x] Assert non-empty `slack.threadTS`. |
| 61 | + |
| 62 | +## Phase 5: mandatory radical simplification pass 1 |
| 63 | + |
| 64 | +- [x] Ask "can I make this look easier by deleting a dependency?" |
| 65 | +- [x] Ask "can I merge files without making the contract harder to read?" |
| 66 | +- [x] Ask "am I using a framework just because it is familiar?" |
| 67 | +- [x] Delete anything that fails those checks. |
| 68 | + |
| 69 | +## Phase 6: mandatory radical simplification pass 2 |
| 70 | + |
| 71 | +- [x] Re-run tests and smoke from a green tree. |
| 72 | +- [x] Ask "can I make this radically simpler?" |
| 73 | +- [x] Remove abstractions that only serve style. |
| 74 | +- [x] Remove helpers that only save a few lines. |
| 75 | +- [x] Stop only when the repo still reads like a small third-party plugin. |
| 76 | + |
| 77 | +Refactor pass notes: |
| 78 | +- Split the runtime into small package files for: |
| 79 | + - app flow |
| 80 | + - HTTP entrypoint |
| 81 | + - Kubernetes and Slack clients |
| 82 | + - payload decoding and shaping |
| 83 | +- Split smoke support out of the entrypoint into `smoke/lib.py`. |
| 84 | +- Re-ran unit tests after refactor. |
| 85 | +- Re-ran `py_compile` across all Python files after refactor. |
| 86 | +- Re-ran isolated kind smoke through `extended/tests/e2e_stepplugins.sh`. |
0 commit comments