You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Part 1 of the OOT → CRCR rename series. Renames all `oot` references to
`crcr` in the `cross_repo_ci_relay` Lambda code to align with the
official "Cross-Repository CI Relay" (CRCR) terminology.
**Changes (6 files):**
- **`utils/config.py`** — `oot_status_ttl` → `crcr_status_ttl`,
`OOT_STATUS_TTL` → `CRCR_STATUS_TTL` env var, `/oot/results` →
`/crcr/results` HUD API path
- **`utils/redis_helper.py`** — Redis key prefixes: `oot:state:` →
`crcr:state:`, `oot:rate:` → `crcr:rate:`, `oot:allowlist_yaml` →
`crcr:allowlist_yaml`, `config.oot_status_ttl` →
`config.crcr_status_ttl`
- **`README.md`** — Updated key format example and Docker container name
- **`tests/test_redis_helper.py`** — Updated mock config field
- **`tests/test_callback_handler.py`** — Updated mock config field and
URL
- **`tests/test_hud.py`** — Updated mock URL
**Deployment note:** Existing Redis keys with the `oot:*` prefix will
expire naturally via TTL — no migration needed. The `CRCR_STATUS_TTL`
env var replaces `OOT_STATUS_TTL` on the Lambda.
**Depends on:** HUD-side `/api/crcr/results` endpoint (PR 3 in this
series) must be deployed before or alongside this change so the Lambda
can forward to the new path.
## Rename series
| PR | Scope | Status |
|----|-------|--------|
| **PR 1 (this)** | Lambda — Redis keys, config, tests | This PR |
| PR 2 | ClickHouse — schema + replicator | Upcoming |
| PR 3 | Frontend — lib, API, components, queries, tests | Upcoming |
## Test plan
- [ ] Verify all existing Lambda unit tests pass with renamed fields
- [ ] Confirm `CRCR_STATUS_TTL` env var is read correctly
- [ ] Confirm HUD API URL is constructed as `/crcr/results`
---------
Co-authored-by: Andrey Talman <atalman@fb.com>
Copy file name to clipboardExpand all lines: aws/lambda/cross_repo_ci_relay/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ The callback endpoint validates incoming callbacks and forwards them to HUD for
47
47
- **State machine**: Relay maintains a **unified state machine** in Redis to validate callback lifecycles, compute timing metrics, and support per-workflow tracking:
48
48
- **Unified structure**: Single enum `CallbackState` with states `DISPATCHED` (webhook side, keyed by sentinel `run_id=0, run_attempt=0`), `IN_PROGRESS`, and `COMPLETED` (callback side, per-workflow). State records stored as JSON: `{"state": "...", "timestamp": 1234.56}`.
49
49
- **Dispatch validation**: `DISPATCHED` state proves valid webhook origin. Callbacks without this state are rejected (no prior dispatch).
50
-
- **Workflow-level tracking**: Each workflow has independent state and timestamps keyed by `{run_id}:{run_attempt}` (`oot:state:{delivery_id}:{repo}:{run_id}:{run_attempt}`). Supports multiple workflows per webhook.
50
+
- **Workflow-level tracking**: Each workflow has independent state and timestamps keyed by `{run_id}:{run_attempt}` (`crcr:state:{delivery_id}:{repo}:{run_id}:{run_attempt}`). Supports multiple workflows per webhook.
51
51
- **Timing metrics**: `queue_time = dispatch_timestamp → in_progress_timestamp`, `execution_time = in_progress_timestamp → completed_timestamp`. Timestamps extracted from state records.
52
52
- **State transitions**: Rejects invalid flows (`COMPLETED` without prior `IN_PROGRESS`, duplicate `IN_PROGRESS` for the same `{run_id}:{run_attempt}`, duplicate `COMPLETED`, callbacks without a prior `DISPATCHED` record).
53
53
Note that the direction graph below is for a single check run, reruns have different `run_attempt` and are treated as separate workflows, so they won't violate the state machine since they won't have a prior `IN_PROGRESS` or `COMPLETED` record.
@@ -253,7 +253,7 @@ make clean
253
253
- A running Redis instance:
254
254
```bash
255
255
# Using the built-in "default" user with a password:
0 commit comments