Skip to content

Conversation

@elibosley
Copy link
Member

@elibosley elibosley commented Mar 24, 2025

…ated tests

  • Changed configValid value from "yes" to "ineligible" in var.ini.
  • Updated tests in emhttp.test.ts and var.test.ts to reflect the new state.
  • Refactored var.ts to handle the new configErrorState logic based on configValid.
  • Adjusted config.resolver.ts to return the correct error state.

Summary by CodeRabbit

  • New Features

    • Enhanced configuration status reporting to indicate when settings are ineligible, improving clarity on configuration validity.
  • Chores

    • Updated recorded download times to maintain accurate logging.
    • Refined the installation process with streamlined dependency linkage and improved script readability.

…ated tests

- Changed `configValid` value from "yes" to "ineligible" in `var.ini`.
- Updated tests in `emhttp.test.ts` and `var.test.ts` to reflect the new state.
- Refactored `var.ts` to handle the new `configErrorState` logic based on `configValid`.
- Adjusted `config.resolver.ts` to return the correct error state.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2025

Walkthrough

This pull request updates the configuration validation state by changing the configValid value from "yes" to "ineligible" and correspondingly adjusting test expectations. The change replaces the generic configState with a more specific configErrorState through type modifications and introduces a helper function for conversion. Additionally, fixture timestamps have been updated, and plugin scripts have been modified: one for improved readability and another to create symbolic links for binaries.

Changes

File(s) Change Summary
api/dev/states/var.ini, api/src/__test__/{store/modules/emhttp.test.ts,store/state-parsers/var.test.ts}, api/src/core/types/states/var.ts, api/src/store/state-parsers/var.ts, api/src/unraid-api/graph/resolvers/config/config.resolver.ts Updated config parameters: changed configValid from "yes" to "ineligible", replaced configState with configErrorState, added new type ConfigErrorState, introduced convertconfigErrorStateToEnum(), and updated test expectations and resolver logic.
api/src/unraid-api/unraid-file-modifier/modifications/__test__/__fixtures__/downloaded/{.login.php.last-download-time,DefaultPageLayout.php.last-download-time,Notifications.page.last-download-time,auth-request.php.last-download-time} Updated timestamp values to new recorded last download times.
plugin/{plugins/dynamix.unraid.net.plg,source/dynamix.unraid.net/install/doinst.sh} Inserted a blank line for readability in the .plg file and added numerous symbolic link creation commands in doinst.sh for various binaries.

Sequence Diagram(s)

sequenceDiagram
    participant CFG as Config File (var.ini)
    participant Parser as State Parser
    participant Converter as convertconfigErrorStateToEnum()
    participant Resolver as Config Resolver

    CFG->>Parser: Read configValid="ineligible"
    Parser->>Converter: Evaluate configValid value
    Converter-->>Parser: Return ConfigErrorState ENUM ("INELIGIBLE")
    Parser-->>Resolver: Return parsed state with configErrorState
    Resolver->>Resolver: Set error property using configErrorState
Loading

Possibly related PRs

  • unraid/webgui-patches#279: Updates similar configuration parameters and error state handling.
  • unraid/webgui-patches#280: Modifies configuration state management with the introduction of configErrorState.
  • fix: add INELIGIBLE state to ConfigErrorState enum #1220: Directly relates to the addition of the INELIGIBLE status within the configuration error state enum.

Suggested reviewers

  • pujitm

Poem

In the world of code so grand,
A change was made, both sleek and planned.
From "yes" to "ineligible" it did flow,
With types and tests now set to go.
New links and time stamps joined the art,
A joyful fix—a masterpiece at heart!
🚀🌟


📜 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 cc216c3 and 3ae8c78.

📒 Files selected for processing (4)
  • api/src/core/types/states/var.ts (2 hunks)
  • api/src/store/state-parsers/var.ts (4 hunks)
  • api/src/unraid-api/graph/resolvers/config/config.resolver.ts (1 hunks)
  • web/components/UpdateOs/IgnoredRelease.vue (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • api/src/unraid-api/graph/resolvers/config/config.resolver.ts
  • api/src/store/state-parsers/var.ts
  • api/src/core/types/states/var.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build Web App
  • GitHub Check: Build API
  • GitHub Check: Test API
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
web/components/UpdateOs/IgnoredRelease.vue (2)

10-13: Making label optional aligns with default value pattern

The change to make the label property optional is consistent with how it's handled in the withDefaults function, where it's assigned an empty string as a default value. This provides flexibility for component consumers while ensuring the property always has a value.


32-39:

❓ Verification inconclusive

Verify handling of empty label value in removal function

While the template will display an empty string when no label is provided, it's important to verify that the updateOsRemoveIgnoredRelease function in the server store can properly handle an empty string as an identifier for removal.


🏁 Script executed:

#!/bin/bash
# Search for the updateOsRemoveIgnoredRelease function to check how it handles empty labels
rg -A 10 "updateOsRemoveIgnoredRelease" --type ts

Length of output: 1158


Action Required: Verify Empty Label Handling in Removal Function

The current implementation of updateOsRemoveIgnoredRelease in web/store/server.ts does not include an explicit check for an empty string. Passing an empty label will result in filtering the ignored releases and invoking WebguiUpdateIgnore with an empty version. Please confirm that this behavior is intentional. If an empty label should not trigger a removal action, consider adding validation to prevent or appropriately handle empty input values.


🪧 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.

…g.resolver.ts

- Changed import statements in `var.ts` to use type imports for better clarity.
- Refactored `configErrorState` assignment in `var.ts` for improved readability.
- Simplified error handling logic in `config.resolver.ts` to enhance code clarity.

This commit improves code maintainability and readability without altering functionality.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

🛑 Comments failed to post (0)

@zackspear zackspear self-requested a review as a code owner March 24, 2025 18:12
@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/PR1268/dynamix.unraid.net.plg

@elibosley elibosley merged commit ef8c954 into main Mar 24, 2025
8 checks passed
@elibosley elibosley deleted the fix/overriding-config-errors branch March 24, 2025 18:19
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