Skip to content

Return if no egg was selected in the Installer - #2073

Merged
rmartinoscar merged 2 commits into
mainfrom
issue/2072
Jan 5, 2026
Merged

Return if no egg was selected in the Installer#2073
rmartinoscar merged 2 commits into
mainfrom
issue/2072

Conversation

@rmartinoscar

Copy link
Copy Markdown
Member

Closes #2072

@coderabbitai

coderabbitai Bot commented Jan 4, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Removes the EggImporterService dependency from the PanelInstaller class. The submit() and installEggs() methods no longer accept this service; installEggs() now checks for selected eggs and returns early if none are chosen, and egg installation dispatches jobs using internal state.

Changes

Cohort / File(s) Summary
Panel installer refactor
app/Livewire/Installer/PanelInstaller.php
Removed EggImporterService import and parameter from submit() and installEggs() signatures. installEggs() now returns early when no eggs are selected and uses internal state to dispatch InstallEgg jobs (no service parameter). Public API changed accordingly; adjust callers for new method signatures.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Title check ✅ Passed The title accurately describes the main change: adding an early return when no eggs are selected in the installer.
Description check ✅ Passed The description references the linked issue #2072, which is directly related to the changeset addressing the egg installer behavior.
Linked Issues check ✅ Passed The code changes implement the required fix by adding an early return guard in installEggs() when no eggs are selected, preventing the 'Egg Install Started' state from displaying.
Out of Scope Changes check ✅ Passed The refactoring of method signatures and removal of EggImporterService from the public API are necessary to implement the required early return behavior and do not introduce unrelated changes.

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59adf83 and ca7cfbe.

📒 Files selected for processing (1)
  • app/Livewire/Installer/PanelInstaller.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/Livewire/Installer/PanelInstaller.php

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

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

@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: 0

🧹 Nitpick comments (1)
app/Livewire/Installer/PanelInstaller.php (1)

249-249: Remove redundant return statement.

The return; statement on line 249 is redundant since it's at the end of the try block. The method will naturally exit at this point, and the only code after this is the catch block which handles exceptions.

🔎 Proposed cleanup
             ->persistent()
             ->send();
-
-        return;
     } catch (Exception $exception) {
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76b6118 and 59adf83.

📒 Files selected for processing (1)
  • app/Livewire/Installer/PanelInstaller.php
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Boy132
Repo: pelican-dev/panel PR: 1947
File: app/Http/Controllers/Api/Application/Eggs/EggController.php:88-104
Timestamp: 2025-12-15T22:09:08.200Z
Learning: In the pelican-dev/panel codebase, the YAML parser used by EggImporterService can natively handle JSON content, so there's no need to explicitly specify the format when importing eggs.
🔇 Additional comments (2)
app/Livewire/Installer/PanelInstaller.php (2)

228-234: Excellent fix for issue #2072!

The early return when no eggs are selected correctly prevents the "Egg Install Started" notification from displaying when zero eggs are present. Since array_get() on line 231 defaults to an empty array, the check if (!$selectedEggs) will properly detect the empty state and return early.


131-131: No external callers affected by signature change.

Verification confirms that no callers of the submit() method pass the removed EggImporterService parameter, making this a safe refactoring. The service remains properly used elsewhere in the codebase (notably in InstallEgg::handle()), confirming the parameter removal was intentional.

@rmartinoscar
rmartinoscar merged commit fcfafad into main Jan 5, 2026
25 checks passed
@rmartinoscar
rmartinoscar deleted the issue/2072 branch January 5, 2026 13:21
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Egg Install Started with 0 eggs should not show

2 participants