chore: ignore artifacts from unraid-api package#2270
Conversation
WalkthroughThis change removes several PHP files and components related to Unraid's "my servers" plugin, including classes for web component extraction, server state, translations, activation code extraction, and reboot details. It also updates the Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
💤 Files with no reviewable changes (6)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
.gitignore (3)
75-83:pnpm-lock.yamlis ignored but workspace files are still trackedIf you’re adopting pnpm, consider also ignoring the cache/work-space artefacts (
pnpm-workspace.yaml,.pnpm-store*, etc.) to keep the repository free of large, deterministic build artefacts.emhttp/plugins/pnpm-lock.yaml +emhttp/plugins/pnpm-workspace.yaml +.pnpm-store/
84-90:bin/andlib/node_modulespatterns are too broadPatterns without a leading slash match any nested path named
bin/orlib/node_modules/.
That will silently exclude unrelated project assets under sub-directories (e.g. adocs/bin/folder).Tighten the scope by anchoring the patterns to the repo root:
-bin/ -lib/node_modules + /bin/ + /lib/node_modules/Please double-check whether any legitimate sub-directory is now unintentionally ignored.
91-99: Inconsistent use of trailing slashesSome directory entries (
etc/rc.d/rc0.d,etc/rc.d/rc6.d) are missing the trailing slash while others have it. Keeping the syntax consistent avoids future confusion and accidental mismatches.-etc/rc.d/rc0.d -etc/rc.d/rc6.d +etc/rc.d/rc0.d/ +etc/rc.d/rc6.d/emhttp/plugins/dynamix.my.servers/.gitignore (1)
1-13: Duplication with root-level.gitignoreMost of these patterns are already covered by the root
.gitignore. Keeping two sources of truth invites divergence over time.Option A – delete this file and rely on the root ignore rules.
Option B – keep it, but add a comment explaining why a plugin-scoped
.gitignoreis required (e.g. to support subtree check-outs).Either way, document the intent to prevent future clean-up churn.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.gitignore(1 hunks)emhttp/plugins/dynamix.my.servers/.gitignore(1 hunks)emhttp/plugins/dynamix.my.servers/include/myservers1.php(0 hunks)emhttp/plugins/dynamix.my.servers/include/state.php(0 hunks)emhttp/plugins/dynamix.my.servers/include/translations.php(0 hunks)
💤 Files with no reviewable changes (3)
- emhttp/plugins/dynamix.my.servers/include/state.php
- emhttp/plugins/dynamix.my.servers/include/myservers1.php
- emhttp/plugins/dynamix.my.servers/include/translations.php
|
a sister pr for the api repo is up at unraid/api#1435 ran a diff between the 2 dynamix.my.servers to make sure recent changes from here are reflected in the api's dynamix.my.servers. |
Complement to unraid/webgui#2270 Compared our dynamix.my.servers with the webgui's and made the corresponding changes. activation code logic was omitted because it has already been written into the api. python script used for comparison: https://gist.github.com/pujitm/43a4d2fc35c74f51c70cc66fe1909e6c ```py #!/usr/bin/env python3 """ Directory comparison script that recursively compares two directories and shows files that exist in one but not the other, plus diffs for common files. """ import os import sys import subprocess from pathlib import Path from typing import Set, Tuple def get_all_files(directory: str) -> Set[str]: """Get all files in a directory recursively, returning relative paths.""" files = set() dir_path = Path(directory) if not dir_path.exists(): print(f"Error: Directory '{directory}' does not exist") return files for root, dirs, filenames in os.walk(directory): for filename in filenames: full_path = Path(root) / filename # Get relative path from the base directory relative_path = full_path.relative_to(dir_path) files.add(str(relative_path)) return files def compare_directories(dir1: str, dir2: str) -> Tuple[Set[str], Set[str], Set[str]]: """ Compare two directories and return files in each directory. Returns: - files only in dir1 - files only in dir2 - files in both directories """ files1 = get_all_files(dir1) files2 = get_all_files(dir2) only_in_dir1 = files1 - files2 only_in_dir2 = files2 - files1 in_both = files1 & files2 return only_in_dir1, only_in_dir2, in_both def run_diff(file1_path: str, file2_path: str, relative_path: str) -> bool: """ Run diff on two files and print the output. Returns True if files are different, False if identical. """ try: # Use diff -u for unified diff format result = subprocess.run( ['diff', '-u', file1_path, file2_path], capture_output=True, text=True ) if result.returncode == 0: # Files are identical return False elif result.returncode == 1: # Files are different print(f"\n--- Diff for: {relative_path} ---") print(result.stdout) return True else: # Error occurred print(f"\nError running diff on {relative_path}: {result.stderr}") return False except FileNotFoundError: print(f"\nError: 'diff' command not found. Please install diffutils.") return False except Exception as e: print(f"\nError comparing {relative_path}: {e}") return False def compare_file_contents(dir1: str, dir2: str, common_files: Set[str]) -> Tuple[int, int]: """ Compare contents of files that exist in both directories. Returns (identical_count, different_count). """ identical_count = 0 different_count = 0 print(f"\nComparing contents of {len(common_files)} common files...") print("=" * 60) for relative_path in sorted(common_files): file1_path = os.path.join(dir1, relative_path) file2_path = os.path.join(dir2, relative_path) if run_diff(file1_path, file2_path, relative_path): different_count += 1 else: identical_count += 1 return identical_count, different_count def main(): if len(sys.argv) < 3: print("Usage: python compare_directories.py <directory1> <directory2> [--no-diff]") print("Example: python compare_directories.py /path/to/dir1 /path/to/dir2") print("Use --no-diff to skip content comparison") sys.exit(1) dir1 = sys.argv[1] dir2 = sys.argv[2] skip_diff = '--no-diff' in sys.argv print(f"Comparing directories:") print(f" Directory 1: {dir1}") print(f" Directory 2: {dir2}") print("=" * 60) only_in_dir1, only_in_dir2, in_both = compare_directories(dir1, dir2) print(f"\nFiles only in '{dir1}' ({len(only_in_dir1)} files):") if only_in_dir1: for file in sorted(only_in_dir1): print(f" - {file}") else: print(" (none)") print(f"\nFiles only in '{dir2}' ({len(only_in_dir2)} files):") if only_in_dir2: for file in sorted(only_in_dir2): print(f" - {file}") else: print(" (none)") print(f"\nFiles in both directories ({len(in_both)} files):") if in_both: for file in sorted(in_both): print(f" - {file}") else: print(" (none)") # Compare file contents if requested and there are common files identical_count = 0 different_count = 0 if not skip_diff and in_both: identical_count, different_count = compare_file_contents(dir1, dir2, in_both) print("\n" + "=" * 60) print(f"Summary:") print(f" Total files in '{dir1}': {len(only_in_dir1) + len(in_both)}") print(f" Total files in '{dir2}': {len(only_in_dir2) + len(in_both)}") print(f" Files only in '{dir1}': {len(only_in_dir1)}") print(f" Files only in '{dir2}': {len(only_in_dir2)}") print(f" Files in both: {len(in_both)}") if not skip_diff and in_both: print(f" Identical files: {identical_count}") print(f" Different files: {different_count}") if __name__ == "__main__": main() ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for extracting and displaying activation code data, including partner information and logos, when relevant. - **Style** - Removed embedded CSS styling from the server management interface header. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
For developer convenience, gitignore artifacts produced by installing an unraid-api slackware pkg.
Also stop tracking duplicated files concerned with api/web component/connect integration.
Based on the following
git status:Summary by CodeRabbit
Chores
Refactor
No user-facing features or bug fixes are included in this release.