Skip to content

Conversation

@pujitm
Copy link
Member

@pujitm pujitm commented Jul 2, 2025

Tested via manual dispatch on #1456 via cli. results in:

<!DOCTYPE PLUGIN [
  <!ENTITY name "dynamix.unraid.net">
  <!ENTITY launch "Connect">
  <!ENTITY author "limetech">
  <!ENTITY version "2025.07.03.0623">
  <!ENTITY plugin_url "https://preview.dl.unraid.net/unraid-api/dynamix.unraid.net.plg">
  <!ENTITY source "/boot/config/plugins/dynamix.my.servers/&txz_name;">
  <!ENTITY txz_sha256 "2075cdb8206733f7f037fefdb004a2d719498d6d6d7f3872afd0682a40ceff28">
  <!ENTITY txz_url "https://preview.dl.unraid.net/unraid-api/tag/PR1456/dynamix.unraid.net-4.8.0-x86_64-24.txz">
  <!ENTITY txz_name "dynamix.unraid.net-4.8.0-x86_64-24.txz">
  <!ENTITY arch "x86_64">
  <!ENTITY build "24">
  <!ENTITY tag "PR1456">
  <!ENTITY api_version "4.8.0">
]>

Summary by CodeRabbit

  • Chores
    • Updated workflow input descriptions for consistency.
    • Expanded job permissions to improve workflow capabilities.
    • Enhanced artifact download step with additional input options.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

Walkthrough

A GitHub Actions workflow was updated to use double quotes for input descriptions, expand job permissions to include actions: read, and enhance the artifact download step by adding two new boolean inputs. The regex pattern for updating the plugin URL in a .plg file was refined. No functional logic or exported entities were changed.

Changes

File(s) Change Summary
.github/workflows/push-staging-pr-on-close.yml Changed input descriptions to double quotes, expanded job permissions to include actions: read, added new boolean inputs (workflow_search, search_artifacts) to the artifact download step, and refined regex pattern for plugin URL update

Possibly related PRs

Suggested reviewers

  • elibosley

Poem

In the workflow’s gentle code,
Double quotes now take the road.
Permissions widened, inputs new,
Artifacts searched with clearer view.
A tidy step, no logic swayed,
GitHub Actions, smoothly played!


🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/push-staging-pr-on-close.yml (1)

40-51: Trim the extra dependency on jq by using gh api --jq

jq is available on the runner today, but it’s not guaranteed forever.
gh api already supports server-side filtering via --jq, so we can drop the pipe and keep the step slimmer:

-          gh api repos/${{ github.repository }}/actions/artifacts --paginate | \
-            jq -r '.artifacts[] | select(.workflow_run.head_branch == "pr/${{ steps.pr_number.outputs.pr_number }}") | "  - \(.name) (run: \(.workflow_run.id))"' || echo "No artifacts found or error listing artifacts"
+          gh api repos/${{ github.repository }}/actions/artifacts \
+            --paginate \
+            --jq '.artifacts[] | select(.workflow_run.head_branch == "pr/${{ steps.pr_number.outputs.pr_number }}") | "  - \(.name) (run: \(.workflow_run.id))"' \
+          || echo "No artifacts found or error listing artifacts"

Benefits: one less process, clearer intent, and slightly faster execution.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13bd9bb and d997ccd.

📒 Files selected for processing (1)
  • .github/workflows/push-staging-pr-on-close.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: elibosley
PR: unraid/api#1120
File: plugin/Dockerfile:1-3
Timestamp: 2025-02-05T14:25:37.316Z
Learning: The Dockerfile in the plugin directory is specifically for building artifacts during CI and is not used for production deployments. It creates a build environment with Node.js and necessary dependencies to generate plugin files.
Learnt from: elibosley
PR: unraid/api#1125
File: .github/workflows/main.yml:233-233
Timestamp: 2025-02-07T19:53:37.715Z
Learning: In the plugin build workflow, the TAG environment variable (previously PR) is used for display purposes in OS releases, with "PR" prefix indicating it's from a pull request.
Learnt from: elibosley
PR: unraid/api#1120
File: .github/workflows/main.yml:240-240
Timestamp: 2025-02-05T14:44:05.679Z
Learning: In GitHub Actions workflows, Docker commands will automatically fail the build if they return a non-zero exit code, making explicit error handling unnecessary.
Learnt from: pujitm
PR: unraid/api#1352
File: packages/unraid-api-plugin-generator/src/create-plugin.ts:91-112
Timestamp: 2025-04-21T18:27:36.482Z
Learning: For utility functions like file operations in api plugin generators, pujitm prefers minimal error handling rather than verbose try/catch blocks for each operation, as errors will propagate properly to higher level error handlers.
.github/workflows/push-staging-pr-on-close.yml (1)
Learnt from: elibosley
PR: unraid/api#1125
File: .github/workflows/main.yml:233-233
Timestamp: 2025-02-07T19:53:37.715Z
Learning: In the plugin build workflow, the TAG environment variable (previously PR) is used for display purposes in OS releases, with "PR" prefix indicating it's from a pull request.
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Test API
  • GitHub Check: Build Web App
  • GitHub Check: Build API
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
.github/workflows/push-staging-pr-on-close.yml (1)

9-17: Input descriptions: change to double quotes looks good
No functional impact; keeps YAML consistent with the other strings in the workflow.

@pujitm pujitm force-pushed the fix/plugin-promotion branch from 709c74c to fc00f1b Compare July 3, 2025 12:45
@pujitm pujitm marked this pull request as ready for review July 3, 2025 13:25
@pujitm pujitm requested a review from elibosley as a code owner July 3, 2025 13:25
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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/push-staging-pr-on-close.yml (2)

10-10: Keep quoting style consistent across workflows

Switching to double-quotes is harmless, but other workflow files still mix single and double quotes for descriptions. Consider standardising on one style repo-wide to avoid noisy diffs.

Also applies to: 14-14


65-65: Trailing whitespace flagged by YAML-lint

Line 65 has stray spaces; remove to keep the workflow YAML-lint-clean.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bc1646 and c73c033.

📒 Files selected for processing (1)
  • .github/workflows/push-staging-pr-on-close.yml (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: elibosley
PR: unraid/api#1120
File: plugin/Dockerfile:1-3
Timestamp: 2025-02-05T14:25:37.316Z
Learning: The Dockerfile in the plugin directory is specifically for building artifacts during CI and is not used for production deployments. It creates a build environment with Node.js and necessary dependencies to generate plugin files.
Learnt from: elibosley
PR: unraid/api#1125
File: .github/workflows/main.yml:233-233
Timestamp: 2025-02-07T19:53:37.715Z
Learning: In the plugin build workflow, the TAG environment variable (previously PR) is used for display purposes in OS releases, with "PR" prefix indicating it's from a pull request.
Learnt from: elibosley
PR: unraid/api#1120
File: plugin/scripts/build-plugin-and-txz.ts:177-200
Timestamp: 2025-02-05T14:43:04.715Z
Learning: In the plugin build system (plugin/scripts/build-plugin-and-txz.ts), updating all XML entities in a single loop is an acceptable pattern when all values need to be replaced, as it ensures consistency and maintainability. The PR entity is optional and handled separately in the validation.
Learnt from: elibosley
PR: unraid/api#1167
File: api/package.json:69-69
Timestamp: 2025-02-20T22:12:49.905Z
Learning: The repository has automated workflows that handle dependency compatibility checks, making manual verification redundant during dependency updates.
Learnt from: pujitm
PR: unraid/api#1352
File: packages/unraid-api-plugin-generator/src/create-plugin.ts:91-112
Timestamp: 2025-04-21T18:27:36.482Z
Learning: For utility functions like file operations in api plugin generators, pujitm prefers minimal error handling rather than verbose try/catch blocks for each operation, as errors will propagate properly to higher level error handlers.
.github/workflows/push-staging-pr-on-close.yml (4)
Learnt from: elibosley
PR: unraid/api#1125
File: .github/workflows/main.yml:233-233
Timestamp: 2025-02-07T19:53:37.715Z
Learning: In the plugin build workflow, the TAG environment variable (previously PR) is used for display purposes in OS releases, with "PR" prefix indicating it's from a pull request.
Learnt from: pujitm
PR: unraid/api#1415
File: plugin/plugins/dynamix.unraid.net.plg:234-236
Timestamp: 2025-06-11T14:14:30.348Z
Learning: For the Unraid Connect plugin, the script `/etc/rc.d/rc.unraid-api` is bundled with the plugin package itself, so its presence on the target system is guaranteed during installation.
Learnt from: elibosley
PR: unraid/api#1381
File: plugin/source/dynamix.unraid.net/usr/local/share/dynamix.unraid.net/install/scripts/verify_install.sh:19-24
Timestamp: 2025-05-08T19:28:54.365Z
Learning: The directory `/usr/local/emhttp/plugins/dynamix.my.servers` is a valid directory that exists as part of the Unraid API plugin installation and should be included in verification checks.
Learnt from: elibosley
PR: unraid/api#1120
File: plugin/scripts/build-plugin-and-txz.ts:177-200
Timestamp: 2025-02-05T14:43:04.715Z
Learning: In the plugin build system (plugin/scripts/build-plugin-and-txz.ts), updating all XML entities in a single loop is an acceptable pattern when all values need to be replaced, as it ensures consistency and maintainability. The PR entity is optional and handled separately in the validation.
🪛 YAMLlint (1.37.1)
.github/workflows/push-staging-pr-on-close.yml

[error] 65-65: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build API
  • GitHub Check: Build Web App
  • GitHub Check: Test API
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
.github/workflows/push-staging-pr-on-close.yml (2)

25-25: 👍 Necessary permission added

actions: read is required for the artifact-download action to query the Actions API. Good catch.


49-50: Verify input support in the chosen action version

workflow_search and search_artifacts were added in later releases of dawidd6/action-download-artifact. The tag v11 predates those inputs, so they will be silently ignored.
Either confirm that a newer tag (e.g. v2) is already aliased to the same commit that supports these inputs, or bump the action version explicitly.

# Change the plugin url to point to staging
url="https://preview.dl.unraid.net/unraid-api/dynamix.unraid.net.plg"
sed -i -E "s#(<!ENTITY pluginURL \").*(\">)#\1${url}\2#g" "${plgfile}" || exit 1
sed -i -E "s#(<!ENTITY plugin_url \").*?(\">)#\1${url}\2#g" "${plgfile}" || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Sed pattern never matches – non-greedy .*? isn’t supported

GNU sed ERE doesn’t recognise the Perl-style lazy quantifier ? after *; the pattern will fail to match and plugin_url stays unchanged.

-          sed -i -E "s#(<!ENTITY plugin_url \").*?(\">)#\1${url}\2#g" "${plgfile}" || exit 1
+          sed -i -E "s#(<!ENTITY plugin_url \")[^\"]*(\">)#\1${url}\2#g" "${plgfile}" || exit 1

The character-class approach [^"]* reliably matches up to the closing quote without using PCRE.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sed -i -E "s#(<!ENTITY plugin_url \").*?(\">)#\1${url}\2#g" "${plgfile}" || exit 1
sed -i -E "s#(<!ENTITY plugin_url \")[^\"]*(\">)#\1${url}\2#g" "${plgfile}" || exit 1
🤖 Prompt for AI Agents
In .github/workflows/push-staging-pr-on-close.yml at line 68, the sed command
uses a non-greedy quantifier `.*?` which GNU sed does not support, causing the
pattern to never match and leaving `plugin_url` unchanged. Replace `.*?` with a
character class pattern `[^"]*` to correctly match all characters up to the
closing quote, ensuring the substitution works as intended.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

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/PR1458/dynamix.unraid.net.plg

@pujitm pujitm merged commit 27b33f0 into main Jul 3, 2025
13 checks passed
@pujitm pujitm deleted the fix/plugin-promotion branch July 3, 2025 13:31
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