Skip to content

[#2048] Do not show Starter in update mode in installer.#2111

Merged
AlexSkrypnyk merged 1 commit into
developfrom
feature/2048-no-starter-update
Nov 19, 2025
Merged

[#2048] Do not show Starter in update mode in installer.#2111
AlexSkrypnyk merged 1 commit into
developfrom
feature/2048-no-starter-update

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Nov 19, 2025

Copy link
Copy Markdown
Member

Closes #2048

Summary by CodeRabbit

  • New Features
    • Starter prompt is now conditionally displayed based on installation state, improving user flow for different project scenarios.
    • Automatic default configuration is applied when the Starter step is skipped, reducing manual setup requirements.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 19, 2025

Copy link
Copy Markdown

Walkthrough

Adds conditional execution control to the Starter handler and PromptManager. A new shouldRun() method determines if the Starter prompt should display based on installation state. The prompt is conditionally added via addIf(), and a default value is auto-populated when the Starter response is missing in Vortex projects.

Changes

Cohort / File(s) Summary
Starter Handler Logic
.vortex/installer/src/Prompts/Handlers/Starter.php
Added public shouldRun(array $responses): bool method that returns true when the installer is not already installed, providing a pre-check hook for handler execution.
Prompt Manager Control Flow
.vortex/installer/src/Prompts/PromptManager.php
Modified Drupal section to conditionally add Starter prompt via addIf() gated by Starter::shouldRun(). Added auto-population of Starter default (LOAD_DATABASE_DEMO) when response is missing in Vortex projects during update/no-interaction flow.
Test Coverage
.vortex/installer/tests/Unit/Handlers/StarterPromptManagerTest.php
Added new test case variant "starter - installed project - skipped" with empty prompt input and Config import. Tests default assignment in installed Vortex project scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant PM as PromptManager
    participant S as Starter Handler
    participant User as User/CLI

    rect rgb(200, 220, 255)
    Note over PM,S: Interactive Mode Flow
    PM->>S: Check shouldRun(responses)
    alt Installer not installed
        S-->>PM: true
        PM->>User: Display Starter prompt
        User-->>PM: Provide response
    else Installer already installed
        S-->>PM: false
        PM->>PM: Skip Starter prompt
        Note over PM: Proceed to next handler
    end
    end

    rect rgb(220, 240, 220)
    Note over PM,S: Update/No-Interaction Mode Flow
    PM->>PM: Check if Starter in responses
    alt Starter response missing & Vortex project
        PM->>PM: Auto-populate Starter = LOAD_DATABASE_DEMO
        Note over PM: Default assigned
    else Starter response provided
        PM->>PM: Use provided response
    end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review the shouldRun() method logic in Starter handler for correctness
  • Verify conditional addIf() integration in PromptManager doesn't break existing flow
  • Confirm default value assignment logic only applies to Vortex projects in the intended context

Possibly related PRs

Suggested labels

AUTOMERGE

Poem

🐰 A starter's turn to know when to show,
Installed or fresh—when should I go?
With shouldRun() guiding the way,
Prompts skip and defaults play,
Updates sail smooth, hooray hooray! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 directly references issue #2048 and clearly summarizes the main change: preventing the Starter prompt from showing in update mode.
Linked Issues check ✅ Passed The PR implementation satisfies issue #2048 by conditionally hiding the Starter prompt during updates via the new shouldRun() method and addIf() logic.
Out of Scope Changes check ✅ Passed All changes directly support the objective of preventing Starter prompt display in update mode; test additions validate the new behavior.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/2048-no-starter-update

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db94878 and 316af19.

📒 Files selected for processing (3)
  • .vortex/installer/src/Prompts/Handlers/Starter.php (1 hunks)
  • .vortex/installer/src/Prompts/PromptManager.php (2 hunks)
  • .vortex/installer/tests/Unit/Handlers/StarterPromptManagerTest.php (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
.vortex/installer/src/Prompts/PromptManager.php (3)
.vortex/installer/src/Prompts/Handlers/Starter.php (2)
  • Starter (10-163)
  • shouldRun (92-94)
.vortex/installer/src/Prompts/Handlers/AbstractHandler.php (2)
  • id (52-62)
  • shouldRun (102-104)
.vortex/installer/src/Utils/Config.php (1)
  • isVortexProject (122-124)
.vortex/installer/tests/Unit/Handlers/StarterPromptManagerTest.php (3)
.vortex/installer/src/Utils/Config.php (1)
  • Config (14-126)
.vortex/installer/src/Prompts/Handlers/Starter.php (1)
  • Starter (10-163)
.vortex/installer/tests/Unit/Handlers/AbstractPromptManagerTestCase.php (3)
  • getExpectedInstalled (156-167)
  • AbstractPromptManagerTestCase (50-277)
  • stubVortexProject (263-269)
.vortex/installer/src/Prompts/Handlers/Starter.php (4)
.vortex/installer/src/Prompts/Handlers/DatabaseImage.php (1)
  • shouldRun (47-49)
.vortex/installer/src/Prompts/Handlers/AbstractHandler.php (2)
  • shouldRun (102-104)
  • isInstalled (178-180)
.vortex/installer/src/Prompts/Handlers/HandlerInterface.php (1)
  • shouldRun (87-87)
.vortex/installer/src/Prompts/Handlers/DatabaseDownloadSource.php (1)
  • shouldRun (67-69)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (4)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-docs
🔇 Additional comments (5)
.vortex/installer/src/Prompts/Handlers/Starter.php (1)

89-94: LGTM! Correctly gates the Starter prompt based on installation state.

The shouldRun() implementation returns false when the project is already installed (update mode) and true for new installations, which aligns perfectly with the PR objective to skip the Starter prompt in update mode.

.vortex/installer/tests/Unit/Handlers/StarterPromptManagerTest.php (2)

9-9: LGTM! Import required for test callback parameter.

The Config import is needed for the type hint in the new test case callback at line 49.


46-52: LGTM! Well-structured test case for update mode behavior.

The test correctly verifies that when running in an installed project (update mode) with no user input, the Starter prompt is skipped and defaults to LOAD_DATABASE_DEMO, along with other installed-project defaults.

.vortex/installer/src/Prompts/PromptManager.php (2)

129-133: LGTM! Correctly conditionalizes the Starter prompt.

The change from add() to addIf() ensures the Starter prompt is only shown when shouldRun() returns true (i.e., during new installations, not updates).


240-243: The review comment is based on a misunderstanding of the design intent and should be disregarded.

Starter is explicitly documented as a "first-run-only" feature (see the hint at line 61 of Starter.php: "Applies only on the first run of the installer"). The current implementation is intentionally correct:

  • shouldRun() returns !$this->isInstalled(), ensuring the prompt only appears on fresh installations
  • In update mode (existing Vortex project), addIf() skips the prompt entirely because shouldRun() returns false
  • The fallback at lines 240-243 sets a sensible default without checking env vars—which is appropriate because Starter should never be overridable in update mode

Environment variables are designed for configuring prompts that are relevant during execution. Since Starter doesn't apply to existing projects, not consulting env vars in update mode is the correct behavior, not an oversight.

Likely an incorrect or invalid review comment.


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

@AlexSkrypnyk AlexSkrypnyk added this to the 25.11.0 milestone Nov 19, 2025
@github-actions github-actions Bot temporarily deployed to commit November 19, 2025 21:00 Inactive
@codecov

codecov Bot commented Nov 19, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.38%. Comparing base (db94878) to head (316af19).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2111      +/-   ##
===========================================
+ Coverage    70.34%   70.38%   +0.04%     
===========================================
  Files           98       98              
  Lines         4974     4981       +7     
  Branches        44       44              
===========================================
+ Hits          3499     3506       +7     
  Misses        1475     1475              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk merged commit 8376dcf into develop Nov 19, 2025
28 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/2048-no-starter-update branch November 19, 2025 22:21
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[INSTALLER] Do not show the Starter prompt if the installer runs in the update mode

1 participant