refactor(install): address audit findings (stdlib reuse, dead-code, comment hygiene)#382
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
More reviews will be available in 3 minutes and 10 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…omment hygiene) - plan.zig: replace hand-rolled ensureDirAll/ensureDir with std.fs.cwd().makePath - plan.zig: replace copyFile body with std.fs.copyFileAbsolute (atomic, no partial-file on failure, preserves source mode) - plan.zig: userInGroup buffer 64 -> 1024 gids so heavy LDAP/AD memberships are not silently missed - plan.zig: drop duplicated InstallPlan doc sentence; remove PR-N forward-compat markers - udev.zig: fix sentinel ISO date month off-by-one (Month enum is 1-based) - services.zig: free already-duped argv strings on error in buildSystemctlSystemArgv and buildSystemctlUserArgv - mappings.zig: gate config backup on has_target so a pure force/interactive add no longer writes a spurious backup - phase.zig/tests.zig: remove PR-N markers from comments - tests.zig: add regression test for writeBinding force pure-add (entry added, no backup) refs: codebase audit
c785c31 to
0da4e51
Compare
Addresses a batch of LOW-severity audit findings in src/cli/install/.
Changes
ensureDirAll/ensureDirwithstd.fs.cwd().makePath(behavior-identical, absolute paths work; ~20 LoC removed).copyFilebody withstd.fs.copyFileAbsolute— atomic temp+rename, no partial/truncated destination on mid-copy failure, preserves source mode.userInGroupsupplementary-group buffer 64 -> 1024 so heavy LDAP/AD memberships no longer silently miss the input-group hint.InstallPlandoc sentence; stripPR-Nforward-compat markers.Monthenum is 1-based;+ 1produced 2..13).buildSystemctlSystemArgv/buildSystemctlUserArgvnow free already-duped strings on allocation error instead of leaking them.has_targetso a pure force/interactive add (no matching entry) no longer writes a spuriousconfig.toml.bak.*.PR-Nmarkers from comments.writeBinding force pure-add does not create backup(asserts new entry added, old preserved, no backup file).Skipped findings
groupGid/hostHasInputGroup/userInGroup+ call sites; disproportionate to a hint-only edge (LDAP /etc/group >4KB). Left as-is._internals_for_testsboundary; removing them expands test code and churns many call sites with no behavior benefit.Test plan
./scripts/padctl-docker test-> EXIT=0.has_targetgate makes exactly this test fail atexpect(!found_bak).zig fmt --check(0.15.2) clean on all changed files.refs: codebase audit