Skip to content

feat: maintenance flag to pause queue worker during deploys#66

Merged
JohnRDOrazio merged 10 commits intomainfrom
feat/maintenance-flag
May 2, 2026
Merged

feat: maintenance flag to pause queue worker during deploys#66
JohnRDOrazio merged 10 commits intomainfrom
feat/maintenance-flag

Conversation

@JohnRDOrazio
Copy link
Copy Markdown
Member

@JohnRDOrazio JohnRDOrazio commented May 2, 2026

Closes #62.

Summary

  • Adds POST /cdcf/v1/maintenance to cdcf-redis-translations plugin — sets/clears cdcf:maintenance:until in Redis with TTL clamped to [60, 600].
  • Worker checks the flag with redis-cli EXISTS at the top of each poll cycle; logs one transition line per pause window.
  • Deploy workflow calls begin before tarball extraction and end after plugin activation (with if: always()); production-only.
  • Adds maintenance subcommand to scripts/cdcf_api.py.
  • Documents the flag in docs/redis-queue-worker.md and CLAUDE.md.

Mitigates the FPM saturation that produced the 504 wave during deploys (root cause investigated in #41). Complementary to #61's idempotent activation — neither alone fixes everything; together they remove two of the three concurrent stressors.

Verification done locally

  • PHP php -l clean
  • Bash bash -n clean
  • Python argparse --help output verified
  • Markdown code-fence balance verified (even count, no orphan triple-backticks)
  • Spec compliance + code quality reviewed per task

Verification still needed (post-merge)

  • After merge, copy the updated scripts/cdcf_queue_worker.sh to /usr/local/bin/cdcf_queue_worker.sh on the VPS and systemctl restart cdcf-queue-worker.
  • Verify the worker check end-to-end on the VPS:
    • redis-cli SETEX cdcf:maintenance:until 60 1 → expect one "Entering maintenance mode" log line within POLL_INTERVALs
    • redis-cli DEL cdcf:maintenance:until → expect one "Exiting maintenance mode" log line, then resumed processing
  • Trigger a manual workflow_dispatch deploy with environment: production and tail journalctl -u cdcf-queue-worker -f. Expect exactly one "Entering" then one "Exiting" line bracketing the deploy.
  • Compare 504 count in the WP access log for the deploy day to the Apr 29 baseline (262). Expect a meaningful drop.

Test coverage

None — no test runner is configured in this project. A follow-up to add Vitest/PHPUnit/bats coverage is tracked as #63.

Rollback

Revert the PR. The Redis key auto-expires within ≤600s of the last begin, so a worker on the old version simply resumes immediately. The endpoint going away is harmless once the workflow no longer calls it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Deploys now pause the queue worker before extracting bundles and always attempt to resume it after (resume failures are logged but won’t fail the deploy).
    • Added REST and CLI maintenance commands to begin/end a Redis-backed maintenance window (begin accepts a duration, clamped to 60–600s).
  • Documentation

    • Added docs for maintenance mode usage, CLI examples, prerequisites, behavior, and deploy-time verification.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@JohnRDOrazio has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 26 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4f9ffd7-9f57-429d-8852-b5f974c80a5a

📥 Commits

Reviewing files that changed from the base of the PR and between 4fc9a19 and ad51d32.

📒 Files selected for processing (2)
  • AGENTS.md
  • scripts/cdcf_queue_worker.sh
📝 Walkthrough

Walkthrough

This PR adds a maintenance-mode system: a new POST /cdcf/v1/maintenance REST endpoint that sets/clears a Redis maintenance flag, the queue worker reads that flag each cycle to pause/resume work, the deploy workflow toggles the flag before/after extraction, and a Python CLI exposes the endpoint.

Changes

Maintenance-Mode Feature

Layer / File(s) Summary
REST Endpoint & Redis Integration
wordpress/plugins/cdcf-redis-translations/cdcf-redis-translations.php
Registers POST cdcf/v1/maintenance requiring manage_options; validates action (begin/end), clamps duration_seconds to 60–600s, uses setex/del on cdcf:maintenance:until, and returns {ok, until, duration} on success.
Worker Redis Flag Check
scripts/cdcf_queue_worker.sh
Adds in_maintenance() checking Redis EXISTS cdcf:maintenance:until; main loop tracks IN_MAINTENANCE, logs single-entry/exit messages, sleeps POLL_INTERVAL, and skips daily tasks and queue processing while flag exists.
Python Client & CLI
scripts/cdcf_api.py
Adds CdcfClient.maintenance(action, duration_seconds=300) to POST to cdcf/v1/maintenance; adds maintenance CLI subcommand with --action {begin,end} and --duration.
Deploy Workflow Hooks
.github/workflows/deploy.yml
Adds production-only "Pause queue worker for deploy" step (before extraction) that POSTs {"action":"begin","duration_seconds":300} with Basic auth and fails deploy on repeated non-200; adds if: always() && env.ENVIRONMENT == 'production' resume step that POSTs {"action":"end"} but logs a warning instead of failing on error.
Documentation
AGENTS.md, docs/redis-queue-worker.md
Documents capability requirement (manage_options), POST /maintenance payload and TTL clamp, CLI usage examples, redis-cli prerequisite, maintenance-mode behavior, expected worker logs, and deploy verification steps.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions<br/>(Deploy Workflow)
    participant WP as WordPress REST<br/>(maintenance endpoint)
    participant Redis as Redis Server
    participant Worker as Queue Worker<br/>(bash loop)
    
    GHA->>WP: POST /cdcf/v1/maintenance<br/>{action:"begin", duration_seconds:300}
    WP->>Redis: SETEX cdcf:maintenance:until TTL=300
    Redis-->>WP: OK
    WP-->>GHA: {ok, until, duration}
    
    Note over GHA,Worker: Extract tarball, activate plugins
    
    Worker->>Redis: EXISTS cdcf:maintenance:until (each cycle)
    Redis-->>Worker: 1
    Worker->>Worker: log "Entering maintenance mode" (once)\n sleep POLL_INTERVAL\n continue (skip processing)
    
    GHA->>WP: POST /cdcf/v1/maintenance<br/>{action:"end"} (if: always)
    WP->>Redis: DEL cdcf:maintenance:until
    Redis-->>WP: OK
    WP-->>GHA: {ok}
    
    Worker->>Redis: EXISTS cdcf:maintenance:until (next cycle)
    Redis-->>Worker: 0
    Worker->>Worker: log "Exiting maintenance mode" (once)\n resume normal processing
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A quiet queue while files rearrange,
Redis holds the pause for a brief, safe change.
Five minutes of hush, then the jobs reappear—
Back to translating, the inbox cheered! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: maintenance flag to pause queue worker during deploys' clearly and specifically summarizes the main feature addition—a maintenance flag system to pause the queue worker during deployments.
Linked Issues check ✅ Passed All requirements from issue #62 are met: WP REST endpoint with proper auth/TTL clamping, Redis-based flag, worker loop check, deploy workflow integration, CLI subcommand, and documentation updates.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the maintenance-flag feature described in issue #62 with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/maintenance-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 50 minutes and 26 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 2, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

JohnRDOrazio and others added 7 commits May 2, 2026 04:12
Sets/clears cdcf:maintenance:until in Redis with a TTL clamped to
[60, 600] seconds. The cdcf-queue-worker will check this key at the
top of each poll cycle to pause processing during deploys (#62).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds an in_maintenance() helper that checks Redis at the top of each
poll cycle. Logs a single transition line on entry and exit, not per
cycle. Treats redis-cli failures as "not in maintenance" so a Redis
outage doesn't stall the worker (#62).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Calls POST /cdcf/v1/maintenance{begin,300} before tarball extraction
and {end} after plugin activation (with if: always()). If begin fails,
abort the deploy — the whole point is to mitigate FPM stress, so
deploying without the pause defeats the purpose. End failures emit a
warning; the Redis TTL self-heals within 600s (#62).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wraps POST /cdcf/v1/maintenance for ergonomic admin use:
  scripts/.venv/bin/python scripts/cdcf_api.py maintenance --action begin --duration 300
  scripts/.venv/bin/python scripts/cdcf_api.py maintenance --action end

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses code-review feedback: surface that argparse handles action
validation at the CLI layer (so the ValueError is for programmatic
callers), and add the missing # -- Maintenance Flag -- section comment
that every other method group in CdcfClient has.

No behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Documents the new POST /cdcf/v1/maintenance endpoint, its redis-cli
fallback, the Python CLI subcommand, and the expected worker log
output during a deploy (#62).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses doc-review feedback on the new /maintenance row:
- Note that this endpoint requires manage_options (administrator),
  not the table preamble's default edit_posts. An editor's Application
  Password would get 403 with no obvious explanation.
- Clarify that the 60-600 range is server-side clamping, not a
  client-side validation requirement.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JohnRDOrazio JohnRDOrazio force-pushed the feat/maintenance-flag branch from 641482b to 432deff Compare May 2, 2026 02:12
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Line 88: The table row for the POST /maintenance entry is splitting into four
columns because of the unescaped pipe in begin|end—edit the row so the action
values are inside inline code (e.g., `begin`/`end`) or otherwise escape the pipe
so it renders as a single cell, and specify the capability as `manage_options`
(or similar admin wording) instead of implying it uses `edit_posts`; also update
the section intro that currently states all cdcf/v1 endpoints require
`edit_posts` to call out that `/maintenance` is an exception and requires the
admin `manage_options` capability.

In `@docs/redis-queue-worker.md`:
- Around line 150-186: Add a clear prerequisite that the worker requires
redis-cli available in PATH on the worker host (because the worker polls the
cdcf:maintenance:until key each POLL_INTERVAL cycle), and update the
install/prerequisites section to instruct operators to install redis-cli (e.g.,
package name for common distros) and verify it for the worker service; also
mention the alternative methods already shown (scripts/cdcf_api.py maintenance
and WP REST API) remain valid but will not work if redis-cli is missing on the
worker host.

In `@wordpress/plugins/cdcf-redis-translations/cdcf-redis-translations.php`:
- Around line 85-93: The current handler always returns HTTP 200 even if Redis
write fails; update the block that calls $redis->setex to check its boolean
return value (the call to $redis->setex) and if it returns false respond with a
5xx WP_REST_Response (e.g., 500) indicating the maintenance flag write failed,
otherwise continue returning the 200 response with 'until' and 'duration';
reference the $redis->setex call and the WP_REST_Response creation when making
the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 537b28ca-ffd9-4cad-a2ee-f5ba40dad8e5

📥 Commits

Reviewing files that changed from the base of the PR and between c423d39 and 641482b.

📒 Files selected for processing (6)
  • .github/workflows/deploy.yml
  • AGENTS.md
  • docs/redis-queue-worker.md
  • scripts/cdcf_api.py
  • scripts/cdcf_queue_worker.sh
  • wordpress/plugins/cdcf-redis-translations/cdcf-redis-translations.php

Comment thread AGENTS.md Outdated
Comment thread docs/redis-queue-worker.md
Comment thread scripts/cdcf_queue_worker.sh
JohnRDOrazio and others added 2 commits May 2, 2026 04:16
Codacy flagged three style issues on the new endpoint:
- Replace `!class_exists(...)` with `=== false` comparison
- Replace `!$redis->connect(...)` with `=== false` comparison
- Replace `intval(...)` with `(int)` cast

The pre-existing `/process-queue` route still uses the older patterns;
those weren't in this PR's diff so Codacy didn't flag them. Cleanup of
that route is left for a separate PR to keep this diff minimal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three findings, fixed:

- AGENTS.md: the cdcf/v1 preamble said all endpoints require edit_posts,
  but /process-queue and /maintenance both require manage_options. The
  /maintenance row already noted its capability inline, but the preamble
  was misleading. Update the preamble to flag the exception.
- docs/redis-queue-worker.md: the worker now calls redis-cli from
  in_maintenance() at every poll cycle, so add it to the prerequisites
  list with a hint about the package name on Debian/Ubuntu and RHEL.
- cdcf-redis-translations.php: $redis->setex() can return false on a
  Redis write failure even when connect() succeeded; without checking
  it, the deploy would proceed thinking the worker is paused when the
  flag wasn't actually set. Return 500 with redis_write_failed if the
  setex returns false; the deploy step's existing 3-attempt retry will
  surface the failure and abort the deploy.

One finding skipped: CodeRabbit claimed the pipe inside backticks in the
/maintenance row description splits the cell into four columns. GFM
correctly preserves pipes inside inline code spans, so the row renders
as a single cell. No change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
scripts/cdcf_queue_worker.sh (1)

136-144: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

redis-cli absence silently disables maintenance mode — startup guard still missing.

If redis-cli is not in PATH, the 2>/dev/null suppresses the shell's "command not found" stderr, || return 1 fires, and every in_maintenance() call returns "false." The deploy workflow sees a 200 OK from the REST endpoint and believes the worker is paused — but the worker continues processing jobs throughout the deploy, defeating the feature entirely.

A one-line startup guard (suggested in the previous review) catches this before the service starts:

🛡️ Proposed fix — add redis-cli check near the existing env-var validation
 if [ -z "$WP_REST_URL" ] || [ -z "$WP_APP_USERNAME" ] || [ -z "$WP_APP_PASSWORD" ]; then
     echo "ERROR: WP_REST_URL, WP_APP_USERNAME, and WP_APP_PASSWORD must be set."
     exit 1
 fi
+
+if ! command -v redis-cli >/dev/null 2>&1; then
+    echo "ERROR: redis-cli is required for maintenance-mode checks but was not found in PATH."
+    exit 1
+fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/cdcf_queue_worker.sh` around lines 136 - 144, The in_maintenance()
function can silently return false if redis-cli is missing because the
command-not-found stderr is redirected; add a one-line startup guard (near the
existing env-var validation) that checks for redis-cli (e.g. use command -v
redis-cli >/dev/null or which redis-cli) and, if not found, print a clear error
to stderr and exit non-zero so the service fails fast at startup; keep the
in_maintenance() logic unchanged but ensure the new check runs before any
maintenance or worker loop begins so missing redis-cli cannot silently disable
maintenance mode.
AGENTS.md (1)

88-88: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Unescaped pipe in table cell still breaks the row into four columns.

The "begin"|"end" inside the inline code span is treated as a table-column separator. The resulting fourth cell is silently dropped by Markdown renderers, so the description text for the /maintenance route is truncated in the rendered docs.

🛠️ Proposed fix
-| `POST` | `/maintenance` | Pause or resume the cdcf-queue-worker by setting/clearing a Redis flag (`{action: "begin"|"end", duration_seconds?: int}` — server-clamps duration to 60–600). Requires administrator (`manage_options`) capability. |
+| `POST` | `/maintenance` | Pause or resume the cdcf-queue-worker by setting/clearing a Redis flag (`{action: "begin"\|"end", duration_seconds?: int}` — server-clamps duration to 60–600). Requires administrator (`manage_options`) capability. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 88, The table cell for the `POST /maintenance` route
contains a pipe in the inline code span (`{action: "begin"|"end",
duration_seconds?: int}`) which is being parsed as a Markdown column separator;
update that code span to avoid an unescaped pipe (for example replace the `|`
with an HTML entity `&#124;` or escape it) so the cell stays one column and the
description isn’t truncated—target the `/maintenance` table row and the
inline-code snippet containing `"begin"|"end"` when making the fix.
🧹 Nitpick comments (1)
scripts/cdcf_queue_worker.sh (1)

142-142: ⚡ Quick win

in_maintenance() hardcodes Redis host/port — consider env-var overrides.

The PR objectives noted adding REDIS_HOST/REDIS_PORT/REDIS_PASSWORD to the worker env file; only the host/port are reachable from the shell script and both are currently hardcoded. The PHP plugin uses the same literals today, but making them configurable removes friction if Redis moves or auth is added later.

♻️ Proposed refactor
 in_maintenance() {
     local result
-    result=$(redis-cli -h 127.0.0.1 -p 6379 -n 0 EXISTS cdcf:maintenance:until 2>/dev/null) || return 1
+    local _host="${REDIS_HOST:-127.0.0.1}"
+    local _port="${REDIS_PORT:-6379}"
+    local _auth_args=()
+    [ -n "${REDIS_PASSWORD:-}" ] && _auth_args=(-a "$REDIS_PASSWORD" --no-auth-warning)
+    result=$(redis-cli -h "$_host" -p "$_port" "${_auth_args[@]}" -n 0 EXISTS cdcf:maintenance:until 2>/dev/null) || return 1
     [ "$result" = "1" ]
 }

Add the optional vars to the env-file template and docs table as well.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/cdcf_queue_worker.sh` at line 142, The in_maintenance() check
hardcodes Redis connection parameters; change it to use environment variables
REDIS_HOST (default 127.0.0.1), REDIS_PORT (default 6379) and optional
REDIS_PASSWORD when present, and build the redis-cli invocation accordingly
instead of the literal "-h 127.0.0.1 -p 6379". Update the line that sets
result=$(redis-cli ...) in the in_maintenance function to use these vars (and
include "-a $REDIS_PASSWORD" only if REDIS_PASSWORD is non-empty), ensuring you
preserve stderr redirection and the "|| return 1" behavior so the function still
returns on failure. Also ensure any new env vars are documented/added to the
worker env-file template as suggested.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@AGENTS.md`:
- Line 88: The table cell for the `POST /maintenance` route contains a pipe in
the inline code span (`{action: "begin"|"end", duration_seconds?: int}`) which
is being parsed as a Markdown column separator; update that code span to avoid
an unescaped pipe (for example replace the `|` with an HTML entity `&#124;` or
escape it) so the cell stays one column and the description isn’t
truncated—target the `/maintenance` table row and the inline-code snippet
containing `"begin"|"end"` when making the fix.

In `@scripts/cdcf_queue_worker.sh`:
- Around line 136-144: The in_maintenance() function can silently return false
if redis-cli is missing because the command-not-found stderr is redirected; add
a one-line startup guard (near the existing env-var validation) that checks for
redis-cli (e.g. use command -v redis-cli >/dev/null or which redis-cli) and, if
not found, print a clear error to stderr and exit non-zero so the service fails
fast at startup; keep the in_maintenance() logic unchanged but ensure the new
check runs before any maintenance or worker loop begins so missing redis-cli
cannot silently disable maintenance mode.

---

Nitpick comments:
In `@scripts/cdcf_queue_worker.sh`:
- Line 142: The in_maintenance() check hardcodes Redis connection parameters;
change it to use environment variables REDIS_HOST (default 127.0.0.1),
REDIS_PORT (default 6379) and optional REDIS_PASSWORD when present, and build
the redis-cli invocation accordingly instead of the literal "-h 127.0.0.1 -p
6379". Update the line that sets result=$(redis-cli ...) in the in_maintenance
function to use these vars (and include "-a $REDIS_PASSWORD" only if
REDIS_PASSWORD is non-empty), ensuring you preserve stderr redirection and the
"|| return 1" behavior so the function still returns on failure. Also ensure any
new env vars are documented/added to the worker env-file template as suggested.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71ff696e-8a20-463f-838e-43e0c296fea3

📥 Commits

Reviewing files that changed from the base of the PR and between 641482b and 4fc9a19.

📒 Files selected for processing (6)
  • .github/workflows/deploy.yml
  • AGENTS.md
  • docs/redis-queue-worker.md
  • scripts/cdcf_api.py
  • scripts/cdcf_queue_worker.sh
  • wordpress/plugins/cdcf-redis-translations/cdcf-redis-translations.php
✅ Files skipped from review due to trivial changes (2)
  • wordpress/plugins/cdcf-redis-translations/cdcf-redis-translations.php
  • scripts/cdcf_api.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/deploy.yml

Two new actionable findings; the other two CodeRabbit re-flagged
(redis-cli prereq in worker docs and setex return check in PHP) were
already addressed by 4fc9a19 and are stale review state.

- worker: fail fast at startup if redis-cli is missing from PATH.
  Without this guard, in_maintenance()'s 2>/dev/null swallows the
  shell's "command not found" stderr and || return 1 makes the worker
  always think it's not in maintenance — so the deploy pause is
  silently ignored and FPM stress proceeds as before.
- AGENTS.md: rewrite the /maintenance row description to avoid the raw
  pipe in `"begin"|"end"`. GFM does preserve pipes inside backticks,
  but CodeRabbit's parser disagrees and the prose form ('"begin" or
  "end"') is unambiguous regardless of which renderer reads it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JohnRDOrazio JohnRDOrazio merged commit 664e821 into main May 2, 2026
10 checks passed
@JohnRDOrazio JohnRDOrazio deleted the feat/maintenance-flag branch May 2, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: maintenance flag to pause queue worker during deploys

1 participant