Skip to content

fix: try securing a Lerd or Herd site again before giving up - #44

Merged
sauce-base merged 2 commits into
mainfrom
renanroble-lerd-secure-retry
Dec 3, 2026
Merged

sauce-base merged 2 commits into
mainfrom
renanroble-lerd-secure-retry

Conversation

@roble

@roble roble commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Merge #43 first. This branch builds on its commit, which shows in this diff until then. Use a merge commit.

Fix

Installs with the Lerd driver could stop at "Securing the site with Lerd". The installer runs lerd link and then lerd secure; Lerd's nginx runs in a container and can see the config that link wrote a moment late, so the reload in secure fails. The printed resume command runs the same two steps and failed the same way.

If secure fails, the installer now waits a second and tries once more. A second failure stops the install with the same message as before. Herd shares the code, so it gets the retry too.

Checks

  • On Lerd 1.39.3, secure straight after link failed 6 of 6 times, and a retry a second later worked 6 of 6.
  • New tests, red before and green after: one failure is retried, two failures stop the install. PHPUnit 342/342, Pint clean on the changed files.
  • Two installs of the chat template on React with the Lerd driver finished and answered 200.

Predicted version: v3.11.4, after #43 releases v3.11.3.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Module installation now displays the names of the selected modules before starting.
    • Installation now runs a serving step after setup and the frontend build.
  • Bug Fixes

    • Timed-out installation steps now show which command failed and how long it ran before stopping.
    • Site security setup retries once after a failure, reducing interruptions from temporary issues. A second failure is reported as an installation failure.

roble and others added 2 commits December 2, 2026 14:34
…ules are named; Lerd and Herd link after the build
Lerd's nginx runs in a container, which can see the config `lerd link` just
wrote a moment late. `lerd secure` right after it then fails its reload and
stopped the install. It now waits a second and tries once more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The installer now reports selected module names. Environment execution handles process timeouts and calls serving after the frontend build. Linked-site environments update .env during boot and retry a failed security command once after one second.

Changes: Module installation output

Layer / File(s) Summary
Print selected modules
src/Console/Commands/InstallCommand.php, tests/Feature/InstallModulesRunnerTest.php, tests/Feature/InstallCommandCoreTest.php
The command prints selected module names, with vendor prefixes removed, before the existing module-install task. Tests assert the output and update command doubles to support line output.

Environment execution and linked sites

Layer / File(s) Summary
Run and serve lifecycle
src/Environments/Environment.php, src/Environments/LerdEnvironment.php, tests/Feature/Environments/InstallTimeoutTest.php
Environment::run() catches process timeouts, reports the command and timeout, and records failure. It calls serve() after the frontend build and checks app startup only if the result remains successful. LerdEnvironment starts workers through its serve() override.
Linked-site boot and serving
src/Environments/LinkedSiteEnvironment.php, tests/Feature/Environments/LinkedSiteEnvironmentTest.php
LinkedSiteEnvironment writes APP_HOST and APP_URL during boot. Its serving step links the site and retries a failed secure command once after a one-second delay. Tests cover execution order and retry outcomes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant EnvironmentRun
  participant LinkedSiteEnvironment
  participant InstallCommand
  participant Sleep
  EnvironmentRun->>LinkedSiteEnvironment: boot
  LinkedSiteEnvironment->>LinkedSiteEnvironment: write APP_HOST and APP_URL
  EnvironmentRun->>EnvironmentRun: build frontend
  EnvironmentRun->>LinkedSiteEnvironment: serve
  LinkedSiteEnvironment->>InstallCommand: run link command
  LinkedSiteEnvironment->>InstallCommand: run secure command
  alt secure command fails
    LinkedSiteEnvironment->>Sleep: wait one second
    LinkedSiteEnvironment->>InstallCommand: retry secure command
  end
Loading

Possibly related PRs

Merge Risk: Minimal · up to 6bc23

Installing a Lerd or Herd site now retries securing once after a short delay, which addresses the reported intermittent failure. Timeouts and module listing are also handled and tested. No specific merge-blocking problem was established. The one open question is whether a secured site could ship with stale Reverb frontend settings.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: one retry when securing a Lerd or Herd site fails, before installation stops. The raw summary shows the retry in LinkedSiteEnvironment::serve and tests for one failure…
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.
Full details: Title check

Explanation

The title names the main change: one retry when securing a Lerd or Herd site fails, before installation stops. The raw summary shows the retry in LinkedSiteEnvironment::serve and tests for one failure followed by success and two failures stopping installation. The title is specific and matches the changeset. It is not vague, and it does not describe unrelated work.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d22648e-b46d-4247-95f9-9641020923bc
Commits

Reviewing files that changed from the base of the PR and between deeceec and 6bc23e1.

Files selected for processing: 8

  • src/Console/Commands/InstallCommand.php
  • src/Environments/Environment.php
  • src/Environments/LerdEnvironment.php
  • src/Environments/LinkedSiteEnvironment.php
  • tests/Feature/Environments/InstallTimeoutTest.php
  • tests/Feature/Environments/LinkedSiteEnvironmentTest.php
  • tests/Feature/InstallCommandCoreTest.php
  • tests/Feature/InstallModulesRunnerTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@sauce-base
sauce-base merged commit 38c0457 into main Dec 3, 2026
4 checks passed
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.

2 participants