Skip to content

Conversation

@zackspear
Copy link
Contributor

@zackspear zackspear commented Mar 18, 2025

  • Handles auto-extensions key check and install of extend license key with new OS Updates Expiration date

Related to unraid/webgui#2071 but not 100% dependent on them.

@elibosley, do we want to use the force param on the check() method for either of these pages?

Additionally, what do you think about any potential integration with UnraidCheck.php – which is used for the UPC's "Check for Updates" button and the user configured automatically scheduled update check?

Summary by CodeRabbit

  • New Features
    • Enhanced plugin registration and update processes with an integrated key validation step that verifies system parameters automatically.

…ages

- Added `ReplaceKey` class inclusion and instantiation in `Registration.page` and `Update.page`.
- Implemented a call to the `check()` method of `ReplaceKey` to enhance server registration and update processes.
@zackspear zackspear requested a review from elibosley as a code owner March 18, 2025 22:47
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

Walkthrough

The pull request integrates the ReplaceKey functionality into two plugin pages by including the ReplaceKey.php file, instantiating the ReplaceKey class, and executing its check() method. Additionally, a new public method check() is added to the ReplaceKey class, which underpins the new functionality in both the registration and update pages without modifying pre-existing variables or operations.

Changes

File(s) Change Summary
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Registration.page
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/Update.page
Added a require_once inclusion for ReplaceKey.php, created an instance of ReplaceKey, and invoked the check() method in both pages.
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix/.../ReplaceKey.php Added a new public method check() to the ReplaceKey class.

Sequence Diagram(s)

sequenceDiagram
    participant Page
    participant ReplaceKey
    Page->>ReplaceKey: Instantiate ReplaceKey
    Page->>ReplaceKey: Call check() method
    ReplaceKey-->>Page: Return check result
Loading

Possibly related PRs

  • unraid/craft-unraid#828: Integrates and utilizes the ReplaceKey class and its check() method, closely related at the code level to these changes.

Poem

In lines of code, a key is replaced,
A check is called, no time to waste.
Two pages now sing, validated and true,
With functions fresh, beginning anew.
Code flows like art in every line, 😊
A small change today, a leap for design!
Happy coding in every byte!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between edc93a9 and 100b6e1.

📒 Files selected for processing (2)
  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Registration.page (1 hunks)
  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/Update.page (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build Web App
  • GitHub Check: Test API
  • GitHub Check: Build API
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Registration.page (1)

17-19: Integration of ReplaceKey functionality looks good.

The addition correctly incorporates the ReplaceKey class and calls its check method, which aligns with the PR objectives for handling auto-extensions key functionality. The code follows PHP best practices for including files and instantiating objects.

Consider adding error handling around the instantiation and method call to gracefully handle any potential issues.

plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/Update.page (1)

17-20: ReplaceKey integration is consistent with Registration page.

The implementation properly includes the ReplaceKey file, creates an instance, and calls the check method - mirroring the approach used in the Registration page. This consistency is good for maintainability.

As with the Registration page, consider adding error handling for robustness.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
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/PR1246/dynamix.unraid.net.plg

@elibosley
Copy link
Member

@zackspear This is a much cleaner solution for now. About UnraidCheck - I think the right path forwards for that is to make UnraidCheck the source of truth for all checking, and remove the replacekey check from these files in favor of just checking for updates.

Let's do that in a follow-on unless you'd like to handle now?

@elibosley elibosley merged commit 04307c9 into main Mar 20, 2025
8 checks passed
@elibosley elibosley deleted the feat/replace-key-check-registration-and-update branch March 20, 2025 18:50
elibosley pushed a commit that referenced this pull request Mar 25, 2025
🤖 I have created a release *beep* *boop*
---


## [4.4.0](v4.3.1...v4.4.0)
(2025-03-25)


### Features

* add ReplaceKey functionality to plugin
([#1264](#1264))
([4aadcef](4aadcef))
* downgrade page replace key check
([#1263](#1263))
([8d56d12](8d56d12))
* make log viewer component dynamic
([#1242](#1242))
([e6ec110](e6ec110))
* ReplaceKey functionality in Registration and Update pages
([#1246](#1246))
([04307c9](04307c9))
* UnraidCheckExec for Check OS Updates via UPC dropdown
([#1265](#1265))
([5935a3b](5935a3b))


### Bug Fixes

* **deps:** update all non-major dependencies
([#1236](#1236))
([7194f85](7194f85))
* **deps:** update all non-major dependencies
([#1247](#1247))
([20b0aeb](20b0aeb))
* **deps:** update all non-major dependencies
([#1251](#1251))
([33a1a1d](33a1a1d))
* **deps:** update all non-major dependencies
([#1253](#1253))
([53fec0e](53fec0e))
* **deps:** update dependency @nestjs/passport to v11
([#1244](#1244))
([edc93a9](edc93a9))
* **deps:** update dependency graphql-subscriptions to v3
([#1209](#1209))
([c14c85f](c14c85f))
* **deps:** update dependency ini to v5
([#1217](#1217))
([f27660f](f27660f))
* **deps:** update dependency jose to v6
([#1248](#1248))
([42e3d59](42e3d59))
* **deps:** update dependency marked to v15
([#1249](#1249))
([2b6693f](2b6693f))
* **deps:** update dependency pino-pretty to v13
([#1250](#1250))
([85fb910](85fb910))
* **deps:** update dependency pm2 to v6
([#1258](#1258))
([04ad2bc](04ad2bc))
* **deps:** update dependency shadcn-vue to v1
([#1259](#1259))
([1a4fe8f](1a4fe8f))
* **deps:** update dependency vue-i18n to v11
([#1261](#1261))
([0063286](0063286))
* **deps:** update vueuse monorepo to v13 (major)
([#1262](#1262))
([94caae3](94caae3))
* make scripts executable when building the plugin
([#1255](#1255))
([e237f38](e237f38))
* node installation not persisting across reboots
([#1256](#1256))
([0415cf1](0415cf1))
* update configValid state to ineligible in var.ini and adjust rel…
([#1268](#1268))
([ef8c954](ef8c954))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants