Skip to content

Conversation

@Squidly271
Copy link
Contributor

@Squidly271 Squidly271 commented Dec 6, 2025

Summary by CodeRabbit

  • New Features
    • Docker containers now support a ReadMe field for storing additional container information.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Walkthrough

A new ReadMe field is added to Docker container XML serialization. The postToXML function now encodes a contReadMe field into a ReadMe XML element, while xmlToVar decodes it back into the output array.

Changes

Cohort / File(s) Summary
Docker container XML field mapping
emhttp/plugins/dynamix.docker.manager/include/Helpers.php
Added ReadMe field support to XML serialization and deserialization functions (postToXML and xmlToVar).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Primary focus: Verify the ReadMe field mapping is correctly added to both postToXML (encoding) and xmlToVar (decoding) functions to ensure bidirectional consistency.

Poem

🐰 A ReadMe arrives in the Docker's XML nest,
Encoded and decoded with utmost zest,
Helper functions dance a synchronized ballet,
New fields take their rightful place to stay! ✨

Pre-merge checks and finishing touches

❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the fix for the ReadMe field not populating on templates, which aligns with the changeset's addition of ReadMe field mapping in the Docker container XML representation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2025.12.18.2324
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2474/webgui-pr-2474.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix.docker.manager/include/Helpers.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2474, or run:

plugin remove webgui-pr-2474

🤖 This comment is automatically generated and will be updated with each new push to this PR.

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)
emhttp/plugins/dynamix.docker.manager/include/Helpers.php (1)

82-82: Consider null-safe access to contReadMe in postToXML.

Directly indexing $post['contReadMe'] will emit a notice if the key is missing. For consistency with other optional fields and a quieter log, consider defaulting to an empty string:

-  $xml->ReadMe                     = xml_encode($post['contReadMe']);
+  $xml->ReadMe                     = xml_encode($post['contReadMe'] ?? '');
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0e94e4 and edb246f.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix.docker.manager/include/Helpers.php (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: zackspear
Repo: unraid/webgui PR: 2230
File: emhttp/plugins/dynamix/include/Templates.php:63-74
Timestamp: 2025-06-03T21:27:15.912Z
Learning: In the Unraid WebGUI codebase (emhttp/plugins/dynamix/include/Templates.php), there are known duplicate ID issues in checkbox templates across multiple template instances that the maintainers are aware of but have chosen not to address due to the effort required for legacy code improvements.
Learnt from: Squidly271
Repo: unraid/webgui PR: 0
File: :0-0
Timestamp: 2025-10-22T17:36:50.995Z
Learning: In the Unraid webgui codebase, when adjusting CPU pinning, 3rd party containers without template files do not appear in the list. Therefore, silently skipping non-existent template files without logging is the appropriate behavior in UpdateOne.php.
Learnt from: Squidly271
Repo: unraid/webgui PR: 0
File: :0-0
Timestamp: 2025-05-31T05:10:13.120Z
Learning: Squidly271 prefers not to receive CodeRabbit reviews or feedback while PRs are in draft status. Only provide reviews after PRs are moved out of draft.
Learnt from: Squidly271
Repo: unraid/webgui PR: 0
File: :0-0
Timestamp: 2025-09-03T07:28:01.902Z
Learning: Squidly271's preference for not reviewing drafts is specifically because they find reviews annoying during active development phases with multiple commits, but they do want reviews once the PR is ready and more stable.
📚 Learning: 2025-07-11T17:24:33.977Z
Learnt from: Squidly271
Repo: unraid/webgui PR: 2293
File: emhttp/plugins/dynamix.docker.manager/include/Helpers.php:302-304
Timestamp: 2025-07-11T17:24:33.977Z
Learning: In the Unraid WebGUI Docker manager (emhttp/plugins/dynamix.docker.manager/include/Helpers.php), the xmlSecurity() function call is intentionally commented out to allow users to include < and > characters in their Docker template variables on their own servers. Default templates still explicitly disallow tags, but users can customize templates as needed in their self-hosted environment.

Applied to files:

  • emhttp/plugins/dynamix.docker.manager/include/Helpers.php
🧬 Code graph analysis (1)
emhttp/plugins/dynamix.docker.manager/include/Helpers.php (1)
emhttp/plugins/dynamix.docker.manager/include/DockerClient.php (2)
  • xml_encode (445-447)
  • xml_decode (449-451)
🔇 Additional comments (1)
emhttp/plugins/dynamix.docker.manager/include/Helpers.php (1)

156-156: ReadMe round‑trip wiring looks correct; be aware it is sanitized.

The new $out['ReadMe'] mapping correctly mirrors the postToXML field and will populate templates from <ReadMe> in the XML. Note that, like other string fields, it will also pass through xmlSecurity($out), so any HTML tags in the ReadMe will be stripped—ensure that plain‑text storage is what you want for this field.

@ljm42 ljm42 added the 7.3 label Dec 9, 2025
@limetech limetech merged commit 987fa42 into unraid:master Dec 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants