Files the ENGINEERING_REVIEW_SCORECARD.md P0-P3 action plan as tracker items (one per affected product) via the platform-service POST /api/items API. Dependency-free Node seeder mints an HS256 token from $JWT_SECRET, dedupes by title, and supports --dry-run. No live writes performed (stack is down); run the script once the platform stack is up. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
50 lines
1.9 KiB
Markdown
50 lines
1.9 KiB
Markdown
# Tracker seed — Engineering Review work items
|
||
|
||
Files the `ENGINEERING_REVIEW_SCORECARD.md` P0–P3 action plan as **tracker items**
|
||
(one per affected product) via the platform-service tracker API
|
||
(`POST /api/items` — the same endpoint `tracker-web` proxies to).
|
||
|
||
## Files
|
||
- `engineering-review-items.json` — the item payloads (16 items), scoped per `productId`.
|
||
- `seed-tracker-items.mjs` — dependency-free Node script that mints an HS256
|
||
token from `$JWT_SECRET` and POSTs each item (with dedupe-by-title).
|
||
|
||
## Prerequisites
|
||
The platform stack must be running and reachable (it serves the tracker items API):
|
||
|
||
```bash
|
||
# in learning_ai_common_plat (Cosmos emulator path)
|
||
docker compose up -d # platform-service on :4003
|
||
# …or run platform-service directly (ephemeral, no persistence):
|
||
# DB_PROVIDER=memory COSMOS_ENDPOINT=x COSMOS_KEY=x JWT_SECRET=dev \
|
||
# pnpm --dir services/platform-service dev
|
||
```
|
||
|
||
## Usage
|
||
```bash
|
||
cd scripts/tracker-seed
|
||
|
||
# 1) Preview — no token, no network calls:
|
||
node seed-tracker-items.mjs --dry-run
|
||
|
||
# 2) Create for real (uses the same JWT_SECRET platform-service verifies):
|
||
JWT_SECRET="<shared-secret>" \
|
||
PLATFORM_API_URL="http://localhost:4003" \
|
||
node seed-tracker-items.mjs
|
||
```
|
||
|
||
Re-running is safe: existing items are skipped by title per product (use
|
||
`--force` to bypass the check). View results in `tracker-web` (`:3003`) under
|
||
each product, or `GET /api/items?productId=<id>`.
|
||
|
||
## Env
|
||
| Var | Default | Notes |
|
||
|-----|---------|-------|
|
||
| `PLATFORM_API_URL` | `http://localhost:4003` | platform-service base URL |
|
||
| `JWT_SECRET` | — | required (unless `--dry-run`); must match platform-service |
|
||
| `SEED_SUB` | `eng-review-bot` | token subject → `reportedBy` |
|
||
| `SEED_ROLE` | `admin` | token role claim |
|
||
| `ITEMS_FILE` | `engineering-review-items.json` | payload file |
|
||
|
||
Source of the items: `../../ENGINEERING_REVIEW_SCORECARD.md`.
|