Consolidate open PR changes into a single main-ready branch#245
Conversation
|
❌ Lint/Format Check Failed Please run |
Co-authored-by: Ven0m0 <[email protected]>
|
❌ Lint/Format Check Failed Please run |
Co-authored-by: Ven0m0 <[email protected]>
|
❌ Lint/Format Check Failed Please run |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThe PR consolidates multiple open PRs into a single branch with refactored code, new tests, and shell hardening improvements.
Files Reviewed (9 files)
Notes
Reviewed by minimax-m2.5-20260211 · 651,468 tokens |
There was a problem hiding this comment.
Pull request overview
This PR improves reliability and test coverage across several utility scripts by hardening edge-case handling, refactoring repeated logic into helper functions, and adding unit tests for previously untested behaviors.
Changes:
- Hardened filesystem/config cleanup logic in Raspberry Pi scripts (Nextcloud
/tmpfix; ext4 config removal). - Refactored Google Photos grouping logic and added an edge-case unit test.
- Refactored the CIA/3DS decryptor into smaller helpers, added unit tests for parsing/content-id/sanitization, and tightened package install logging behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| RaspberryPi/Scripts/Fix.sh | Reworked Nextcloud container /tmp permission fix logic. |
| RaspberryPi/raspi-f2fs.sh | More robust ext4-related cron/timer removal using grep over file lists. |
| Cachyos/Scripts/WIP/gphotos/Splitter.py | Refactor grouping loop into helpers; safer handling for missing paths. |
| Cachyos/Scripts/WIP/gphotos/test_splitter.py | Added test for missing directory case in get_latest_group_info(). |
| Cachyos/Scripts/WIP/emu/cia_3ds_decryptor.py | Refactor CIA handling + tool initialization into helpers; add content-id extraction helper. |
| Cachyos/Scripts/WIP/emu/test_sanitize_filename.py | New unit tests for sanitize_filename(). |
| Cachyos/Scripts/WIP/emu/test_decryptor_parser.py | New unit tests for ctrtool output parsing. |
| Cachyos/Scripts/WIP/emu/test_decryptor_contentid.py | New unit tests for content-id extraction / argument building. |
| Cachyos/Scripts/packages.sh | Make log file permissions safer and use mktemp for fallback log creation. |
Comments suppressed due to low confidence (1)
Cachyos/Scripts/WIP/emu/cia_3ds_decryptor.py:585
- sanitize_filenames() renames files directly to the sanitized name without checking whether the destination already exists. On POSIX, Path.rename can overwrite an existing file, which risks data loss if two different filenames sanitize to the same output (or if the sanitized name collides with an existing file). Add an existence check and pick a unique name / skip with a warning rather than overwriting.
def sanitize_filenames(root: Path) -> None:
"""Sanitizes all filenames in the root directory."""
for f in root.glob("*"):
if f.is_file():
new_name = sanitize_filename(f.name)
if new_name != f.name:
try:
f.rename(root / new_name)
except OSError as e:
You can also share your feedback on Copilot code review. Take the survey.
| if ! sudo docker exec nextcloud sh -c ' | ||
| set -eu | ||
| if [ -L /tmp ]; then | ||
| rm -f /tmp | ||
| fi | ||
| if ! sudo docker exec nextcloud chmod 1777 /tmp; then | ||
| warn "Failed to chmod /tmp in nextcloud" | ||
| perms_ok=0 | ||
| fi | ||
| if (( perms_ok )); then | ||
| log "Nextcloud permissions fixed" | ||
| mkdir -p /tmp | ||
| if getent group www-data >/dev/null 2>&1; then | ||
| chown root:www-data /tmp | ||
| chmod 1770 /tmp | ||
| else | ||
| warn "Nextcloud permission fix incomplete" | ||
| chown root:root /tmp | ||
| chmod 1777 /tmp | ||
| fi |
| def get_latest_group_info(photos_folder): | ||
| """Finds the highest numbered Group_N folder under photos_folder and its size.""" | ||
| if not os.path.exists(photos_folder): | ||
| return 1, None, 0 | ||
|
|
||
| max_group_num = 0 | ||
| latest_group_folder = None | ||
|
|
||
| if os.path.exists(photos_folder): | ||
| for entry in os.scandir(photos_folder): | ||
| if entry.name.startswith("Group_") and entry.is_dir(): | ||
| try: | ||
| num = int(entry.name.split("_")[1]) | ||
| if num > max_group_num: | ||
| max_group_num = num | ||
| latest_group_folder = entry.path | ||
| except (ValueError, IndexError): | ||
| continue | ||
| for entry in os.scandir(photos_folder): | ||
| if not (entry.name.startswith("Group_") and entry.is_dir()): |
This branch folds the substantive changes from the currently open code-focused PRs into one reviewable update, so
maincan receive them in a single merge instead of through a fragmented queue. It combines the overlapping Python refactors, new unit coverage, and shell hardening into a consistent branch state.Decryptor refactors + coverage
cia_3ds_decryptor.pyrefactors into a single implementation.Google Photos splitter cleanup
Splitter.pyrefactors into one pass:sysimport to module scopeShell hardening
packages.sh./tmprepair logic inFix.shto handle symlink replacement and ownership/mode setup more safely.raspi-f2fs.shconsolidationgrepscans with batched matching while preserving safe behavior undernullglobwhen no files match.Representative delta
Scope notes
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.