diff --git a/docs/guides/github-automation.md b/docs/guides/github-automation.md index 8c6cf58113..5785b48503 100644 --- a/docs/guides/github-automation.md +++ b/docs/guides/github-automation.md @@ -29,10 +29,10 @@ and via `workflow_dispatch` with a PR number. 1. **Skip checks** — Skips draft PRs and PRs with `[skip-review]` in the title. 2. **Wait for CI checks** — Waits for all non-review checks (e.g., lint, tests) to complete - before starting the review. Skips checks that match `Code Review`, `Design Review`, - `SDLC Pipeline`, or `SDLC HITL` to avoid self-deadlock. If checks fail, the review is - skipped. Workflow dispatch triggers bypass this wait. Times out after 25 minutes with - a warning and proceeds anyway. + before starting the review. Excludes checks matching `egg-reviewer-*` (all reviewer jobs), + `SDLC Pipeline`, and `SDLC HITL` to avoid self-deadlock and ensure reviewers don't wait + for each other. If checks fail, the review is skipped. Workflow dispatch triggers bypass + this wait. Times out after 25 minutes with a warning and proceeds anyway. 3. **Re-review detection** — Searches for an `` marker in previous reviews/comments to identify the last reviewed commit. On re-review, the agent uses `git diff ..HEAD` to focus on new changes only. @@ -68,6 +68,12 @@ skipping linter-handled style issues. This enables multiple specialized reviewers (e.g., security-focused, design-focused) by providing different prompt scripts while sharing the review infrastructure. +**Reviewer Naming Convention:** All reviewer jobs use the standardized name pattern +`egg-reviewer-{bot_name}` (e.g., `egg-reviewer-review`, `egg-reviewer-agent-mode-design`). +This allows the feedback workflow to identify and wait for all reviewers to complete +before addressing their feedback, preventing race conditions when multiple reviewers +trigger concurrently. + ## Address Review Feedback **Workflow:** [`.github/workflows/on-review-feedback.yml`](../../.github/workflows/on-review-feedback.yml) @@ -92,13 +98,21 @@ The workflow runs on: - Review is not an approval (filtered at job level to prevent runner allocation) - Iteration count is below the limit (default: 3 rounds) -2. **Comment cleanup** — Minimizes previous feedback-addressing comments to reduce clutter. +2. **Wait for all reviewers** — Polls GitHub check runs for all `egg-reviewer-*` jobs + to complete before proceeding. This prevents race conditions when multiple reviewers + (e.g., Code Review and Design Review) trigger the feedback workflow concurrently. + The workflow waits up to 10 minutes, proceeding with a warning on timeout. If no + reviewer checks are found after 2 minutes, the workflow exits with a warning (this + indicates a potential configuration issue since the workflow was triggered by + reviewer feedback). + +3. **Comment cleanup** — Minimizes previous feedback-addressing comments to reduce clutter. -3. **Acknowledgment** — Posts a comment indicating feedback is being addressed, with an `` marker for iteration tracking. +4. **Acknowledgment** — Posts a comment indicating feedback is being addressed, with an `` marker for iteration tracking. -4. **Trusted prompt build** — Checks out `main` (not the PR branch) to run `build-feedback-prompt.sh`, preventing prompt injection from malicious PRs. +5. **Trusted prompt build** — Checks out `main` (not the PR branch) to run `build-feedback-prompt.sh`, preventing prompt injection from malicious PRs. -5. **Agent execution** — Checks out the PR branch and runs egg. The agent: +6. **Agent execution** — Checks out the PR branch and runs egg. The agent: - Reads review feedback via `gh pr view`, `gh api` for reviews and line-level comments - Understands the current code via `gh pr diff` - Makes fixes addressing actionable feedback @@ -106,7 +120,7 @@ The workflow runs on: - Commits and pushes all fixes together - Replies to feedback it disagrees with or cannot address -6. **Result comment** — Posts success or failure status with link to run logs. +7. **Result comment** — Posts success or failure status with link to run logs. ### Iteration Limiting diff --git a/shared/egg_config/README.md b/shared/egg_config/README.md index db0fff56ef..593475657b 100644 --- a/shared/egg_config/README.md +++ b/shared/egg_config/README.md @@ -9,6 +9,7 @@ Unified configuration framework for egg services. - **Validation** with clear error messages - **Health checks** to verify API connectivity - **Secret masking** in logs and debug output +- **System constants** for ports, network names, and container configuration ## Quick Start @@ -78,6 +79,28 @@ CONFLUENCE_API_TOKEN="your-atlassian-api-token" GATEWAY_SECRET="your-gateway-secret" ``` +## System Constants + +The `constants` module provides centralized definitions for ports, network names, and container configuration: + +```python +from egg_config.constants import GATEWAY_PORT, GATEWAY_PROXY_PORT +from egg_config.constants import EGG_ISOLATED_NETWORK, EGG_EXTERNAL_NETWORK + +# Use in code instead of hardcoding values +health_url = f"http://localhost:{GATEWAY_PORT}/api/v1/health" +``` + +Available constants: +- `GATEWAY_PORT` (9848) - Gateway HTTP API port +- `GATEWAY_PROXY_PORT` (3129) - Gateway filtering proxy port +- `GATEWAY_CONTAINER_NAME`, `GATEWAY_IMAGE_NAME` - Container identifiers +- `EGG_ISOLATED_NETWORK`, `EGG_EXTERNAL_NETWORK` - Docker network names +- `EGG_ISOLATED_SUBNET`, `EGG_EXTERNAL_SUBNET` - Network CIDR ranges +- `EGG_CONTAINER_IP`, `GATEWAY_ISOLATED_IP`, `GATEWAY_EXTERNAL_IP` - Fixed IP addresses + +See `shared/egg_config/constants.py` for the full list. + ## Available Configs | Config | Purpose | Key Fields |