Skip to content

ops: scheduled live-domain monitor for the deployed product (PT-17)#602

Merged
BigSimmo merged 1 commit into
mainfrom
claude/pt-audit-pt17-live-monitor
Jul 13, 2026
Merged

ops: scheduled live-domain monitor for the deployed product (PT-17)#602
BigSimmo merged 1 commit into
mainfrom
claude/pt-audit-pt17-live-monitor

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

Audit PT-17: nothing exercised the deployed product after release, so a broken domain, dead health probe, or lost route could only be discovered by a user.

Adds .github/workflows/live-domain-monitor.yml: every six hours (plus manual dispatch) it probes the public domain with plain unauthenticated GETs —

No secrets, no providers beyond what any anonymous visitor triggers, no third-party actions (nothing to pin). LIVE_DOMAIN_URL repository variable repoints it (the www check auto-skips when overridden). A red run is the alert; deeper answer-SLO probing stays in the secret-gated ops digest.

Verification

Equivalent curl probes run green against production just now (root 200 ~1.2s, health ok/live, all routes 200, www 200). check:github-actions, check:ci-scope, prettier green.

🤖 Generated with Claude Code

Nothing exercised the deployed product after release, so a broken
domain, dead health probe, or lost route could only be discovered by a
user. Probe https://psychiatry.tools every six hours with plain
unauthenticated GETs: the app shell renders, /api/health reports ok in
live (non-demo) mode, the key public routes answer 200 (following the
/applications -> /tools canonicalisation either side of that landing),
and the www alias resolves. No secrets, no third-party actions, and a
repository variable (LIVE_DOMAIN_URL) can repoint it. A red run is the
alert; deeper answer-SLO probing stays in the secret-gated ops digest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@supabase

supabase Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Added automated live monitoring for the deployed site every six hours, with manual runs supported.
    • Verifies the main application loads, health checks report expected production status, and critical routes return successfully.
    • Adds an additional production-domain availability check.
    • Clearly reports failures when any monitored check does not pass.

Walkthrough

Changes

The pull request adds a scheduled and manually triggered GitHub Actions workflow that probes the configured public domain. It verifies the application shell, live health status, critical route availability, and canonical production WWW connectivity.

Live domain monitoring

Layer / File(s) Summary
Workflow scheduling and probe setup
.github/workflows/live-domain-monitor.yml
Configures six-hour and manual triggers, read-only permissions, non-overlapping execution, Ubuntu execution, a timeout, and the target URL.
Domain availability probes
.github/workflows/live-domain-monitor.yml
Validates the root shell, /api/health fields, critical route HTTP responses, and the canonical WWW endpoint when using the production URL.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant LiveDomain
  participant HealthEndpoint
  participant CriticalRoutes
  GitHubActions->>LiveDomain: Fetch root and verify Clinical Guide
  GitHubActions->>HealthEndpoint: Fetch /api/health
  HealthEndpoint-->>GitHubActions: Return status ok and demoMode false
  GitHubActions->>CriticalRoutes: Request configured routes
  CriticalRoutes-->>GitHubActions: Return HTTP 200 responses
  GitHubActions->>LiveDomain: Check canonical WWW endpoint when applicable
Loading

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Verification Claims ❌ Error PR description claims verification passed (“Equivalent curl probes run green…”, “prettier green”) but doesn’t name the exact command/check and result. Revise the verification note to state the exact command/check and outcome (e.g. Ran curl ...: passed or Not run: reason) instead of generic “run green” / “green” wording.
Description check ⚠️ Warning The description is detailed, but it omits the repo's required template sections and checklist items, including the clinical governance preflight. Rewrite it to match the template: add the checklist items, complete the Clinical Governance Preflight, and include a Notes section.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the new scheduled live-domain monitoring workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Generated And Sensitive Files ✅ Passed Only a YAML GitHub Actions workflow was added; no secrets, credentials, .env files, caches, builds, or other sensitive/generated artifacts were committed.
Risky Git Or Deployment Actions ✅ Passed The PR only adds a scheduled domain-monitor workflow; it has no force-push, reset/clean, branch-deletion, or deployment actions/instructions.
Supabase Project And Schema Safety ✅ Passed Only changed file is a GitHub Actions workflow; no Supabase refs, schema, RLS, policy, or migration files were modified.
Runtime And Package Manager Integrity ✅ Passed PR only adds a curl-based workflow; no package.json, lockfile, .nvmrc/.node-version, engine, or npm resolution flags were changed.
Api Route Failure Handling ✅ Passed PR only adds a monitor workflow; no API route/server action/provider code changed. The probes use curl --fail, explicit checks, and exit 1 on mismatch.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/pt-audit-pt17-live-monitor
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/pt-audit-pt17-live-monitor

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

@BigSimmo
BigSimmo enabled auto-merge (squash) July 13, 2026 15:05
@BigSimmo
BigSimmo merged commit 17939db into main Jul 13, 2026
15 of 16 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/live-domain-monitor.yml:
- Line 29: Align the workflow job timeout with the worst-case runtime of all
eight sequential probes, including curl max time, retries, and retry delays;
update each affected timeout-minutes setting to exceed that retry budget so
every route can complete before termination.
- Line 37: Update each curl check in the live-domain monitor workflow to capture
url_effective while following redirects, then validate that the final URL
remains HTTPS and has the same origin as LIVE_DOMAIN_URL before accepting the
response as successful. Apply this consistently to all four monitored requests,
preserving the existing body/status checks and failing the workflow on origin or
scheme mismatches.
- Around line 18-19: Update the workflow-level permissions configuration in the
live-domain monitor workflow to use an empty permission set, removing the
unnecessary contents: read grant. Keep the anonymous HTTP probe behavior
unchanged.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7112715-13ed-43d3-944b-7f823923994d

📥 Commits

Reviewing files that changed from the base of the PR and between 1033fe1 and b5b5ab6.

📒 Files selected for processing (1)
  • .github/workflows/live-domain-monitor.yml

Comment on lines +18 to +19
permissions:
contents: read

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove the unused repository token permission.

This workflow only performs anonymous HTTP probes and does not checkout code, call GitHub APIs, or use actions. Granting contents: read is unnecessary; use permissions: {} instead.

As per coding guidelines, GitHub workflow automation must use narrow permissions.

Proposed fix
-permissions:
-  contents: read
+permissions: {}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
permissions: {}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/live-domain-monitor.yml around lines 18 - 19, Update the
workflow-level permissions configuration in the live-domain monitor workflow to
use an empty permission set, removing the unnecessary contents: read grant. Keep
the anonymous HTTP probe behavior unchanged.

Source: Coding guidelines

probe:
name: Probe public domain
runs-on: ubuntu-24.04
timeout-minutes: 10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Align the job timeout with the retry budget.

There are eight sequential probes. With --max-time 30, --retry 2, and two 10-second retry delays, transient failures can consume roughly 14 minutes 40 seconds, exceeding timeout-minutes: 10. The job may be terminated before all routes are checked.

Possible fix
-    timeout-minutes: 10
+    timeout-minutes: 20

Alternatively, reduce the per-request retry budget while preserving the desired alert latency.

Also applies to: 37-37, 46-46, 63-63, 80-80

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/live-domain-monitor.yml at line 29, Align the workflow job
timeout with the worst-case runtime of all eight sequential probes, including
curl max time, retries, and retry delays; update each affected timeout-minutes
setting to exceed that retry budget so every route can complete before
termination.

- name: Root renders the app shell
run: |
set -euo pipefail
body="$(curl -sSL --fail --max-time 30 --retry 2 --retry-delay 10 --retry-all-errors "$LIVE_DOMAIN_URL/")"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Validate redirect destinations before reporting success.

-L accepts cross-origin redirects and HTTPS-to-HTTP downgrades. A route could redirect to another server that returns the expected body or 200, causing a false-green monitor and unintended outbound requests from the runner. Capture url_effective and require the final origin to match the configured domain and remain HTTPS.

Also applies to: 46-46, 63-63, 80-80

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/live-domain-monitor.yml at line 37, Update each curl check
in the live-domain monitor workflow to capture url_effective while following
redirects, then validate that the final URL remains HTTPS and has the same
origin as LIVE_DOMAIN_URL before accepting the response as successful. Apply
this consistently to all four monitored requests, preserving the existing
body/status checks and failing the workflow on origin or scheme mismatches.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5b5ab680d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# -L follows the /applications -> /tools canonicalisation either side
# of that redirect landing, so this list survives route renames.
for route in /privacy /services /forms /differentials /applications; do
code="$(curl -sSL -o /dev/null -w '%{http_code}' --max-time 30 --retry 2 --retry-delay 10 --retry-all-errors "$LIVE_DOMAIN_URL$route")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep retries working for transient route failures

For the key-route probes, and again in the www probe below, a transient HTTP 500/502/503 enters curl's retry path, but this exact -o /dev/null --retry ... command on the ubuntu-24.04 curl 8.5.0 runner exits 23 while trying to truncate /dev/null, so it makes only one request and never reports the final status; curl --help all describes --retry as retrying transient problems and --fail as making HTTP errors fail fast, and adding --fail made a local 500-then-200 reproduction retry successfully. That means a healthy route behind a brief edge/deploy 5xx can make the scheduled monitor go red despite the intended two retries, so the probe should fail/retry HTTP errors without using this /dev/null retry path.

Useful? React with 👍 / 👎.

@BigSimmo
BigSimmo deleted the claude/pt-audit-pt17-live-monitor branch July 14, 2026 09:42
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.

1 participant