Skip to content

fix(plugin): preserve Connect during install start#2027

Merged
elibosley merged 1 commit into
mainfrom
codex/fix-connect-install-start-cleanup
Jun 14, 2026
Merged

fix(plugin): preserve Connect during install start#2027
elibosley merged 1 commit into
mainfrom
codex/fix-connect-install-start-cleanup

Conversation

@elibosley

@elibosley elibosley commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #2025. Starts the API during .plg installation with SKIP_CONNECT_PLUGIN_CHECK=true so the first install boot does not treat Connect as stale before plugin-manager has persisted /boot/config/plugins/dynamix.unraid.net.plg.

Why

While testing the #2025 preview plugin against root@unraid.local, I could still break the first boot after remove/reinstall:

  • api.json contained "plugins": ["unraid-api-plugin-connect"]
  • unraid-api plugins list reported Connect installed
  • the first post-install API boot did not initialize ConnectPluginModule
  • a manual API restart loaded Connect correctly

The install script already adds Connect before starting the API, but during plugin-manager installation the canonical .plg file may still be absent at the instant the main API process starts. The runtime stale cleanup is correct for normal starts, but not for this install-start window.

Change

  • Prefix the .plg install-time API start with SKIP_CONNECT_PLUGIN_CHECK=true.
  • Normal starts and restarts remain unchanged once the .plg exists on disk.

Validation

  • pnpm --filter @unraid/connect-plugin test
  • On root@unraid.local, reproduced the break with the fix(api): keep plugin config loads side-effect free #2025 preview plugin after remove/reinstall.
  • Installed a patched preview .plg with this change under the canonical dynamix.unraid.net.plg filename.
  • Verified first post-install boot loaded ConnectPluginModule without a second restart.
  • Verified normal /etc/rc.d/rc.unraid-api restart still loaded ConnectPluginModule.
  • Final server state: API 4.35.0+f415f324, canonical .plg present, api.json includes unraid-api-plugin-connect, unraid-api plugins list reports Connect installed.

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted Unraid API service startup to skip Connect plugin compatibility checks, improving startup reliability during installation.

- Start the API with SKIP_CONNECT_PLUGIN_CHECK during .plg installation.

- The prior behavior could start the main API process before plugin-manager had persisted dynamix.unraid.net.plg, causing the runtime stale cleanup to suppress Connect for that first boot.

- Keeps normal API starts unchanged once the .plg is present on disk.
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cadb7e4b-d629-4272-95db-41f2e54ab267

📥 Commits

Reviewing files that changed from the base of the PR and between 3c84326 and e532d5b.

📒 Files selected for processing (1)
  • plugin/plugins/dynamix.unraid.net.plg

Walkthrough

The plugin manifest's installation script is updated so that the rc.unraid-api start command is invoked with SKIP_CONNECT_PLUGIN_CHECK=true in its environment, bypassing the Connect plugin compatibility check during service startup. No other logic is modified.

Changes

API Startup Environment Flag

Layer / File(s) Summary
Set SKIP_CONNECT_PLUGIN_CHECK on API start
plugin/plugins/dynamix.unraid.net.plg
rc.unraid-api start now runs with SKIP_CONNECT_PLUGIN_CHECK=true in its environment, skipping the Connect plugin check at install-time startup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hops past the plugin gate,
No Connect check to make it wait,
SKIP_CONNECT_PLUGIN_CHECK=true 🐇
The API starts without debate,
One line changed — how remarkably great!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the main change: preserving the Connect plugin during install startup by skipping the stale plugin check via environment variable.
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.

✏️ 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 codex/fix-connect-install-start-cleanup

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

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.63%. Comparing base (3c84326) to head (e532d5b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2027      +/-   ##
==========================================
- Coverage   52.64%   52.63%   -0.01%     
==========================================
  Files        1035     1035              
  Lines       72034    72034              
  Branches     8257     8248       -9     
==========================================
- Hits        37921    37917       -4     
- Misses      33987    33991       +4     
  Partials      126      126              

☔ View full report in Codecov by Harness.
📢 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.

@github-actions

Copy link
Copy Markdown
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR2027/dynamix.unraid.net.plg

@elibosley elibosley merged commit 6f94aa1 into main Jun 14, 2026
12 of 13 checks passed
@elibosley elibosley deleted the codex/fix-connect-install-start-cleanup branch June 14, 2026 04:13
@github-actions

Copy link
Copy Markdown
Contributor

🔄 PR Merged - Plugin Redirected to Staging

This PR has been merged and the preview plugin has been updated to redirect to the staging version.

For users testing this PR:

  • Your plugin will automatically update to the staging version on the next update check
  • The staging version includes all merged changes from this PR
  • No manual intervention required

Staging URL:

https://preview.dl.unraid.net/unraid-api/dynamix.unraid.net.plg

Thank you for testing! 🚀

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