test: clear remaining Codacy args_os finding on OS-restart smoke - #62
Conversation
Codacy Semgrep flags both current_exe and args_os as "should not be used for security operations". The corpus-ipc smoke is Linux-only, so resolve the test binary through /proc/self/exe instead. Co-authored-by: Raul Cardenas Montoya <montoyaraul34@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
This PR addresses a Codacy security finding by replacing args_os with /proc/self/exe for test process re-execution. However, the implementation introduces a cross-platform compatibility issue that will cause test failures on non-Linux systems.
Critical Issue:
/proc/self/exeonly exists on Linux and will panic on macOS/Windows
Required Fix:
Add platform-specific conditional compilation to prevent runtime panics on non-Linux platforms.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Rust | Sep 18, 2026 12:43a.m. | Review ↗ | |
| Secrets | Sep 18, 2026 12:43a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
CodeAnt Nitpicks1 code suggestion1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66877ea971
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Command::new(argv0) | ||
| // Linux `/proc/self/exe` (CI corpus-ipc job). Avoid `current_exe` / `args_os`, | ||
| // which Codacy Semgrep flags as "should not be used for security operations". | ||
| let exe = std::fs::read_link("/proc/self/exe").expect("read /proc/self/exe"); |
There was a problem hiding this comment.
Keep the OS-restart smoke portable outside Linux
When a developer enables corpus-ipc on macOS or Windows as supported by docs/ci.md:26-31, this test target still runs, but /proc/self/exe does not exist and the unconditional expect panics before spawning the child. The previous executable lookup was portable, so use a platform-specific fallback or gate this test to Linux rather than breaking the feature-enabled test suite on those systems.
Useful? React with 👍 / 👎.
User description
Follow-up after #61 was squash-merged as
3b777f8while Codacy still had a high finding on that head. Does notcargo publish, tag, or create a GitHub Release.Cargo.tomlstays at 0.3.0.Codacy findings (from GitHub check annotations)
#61 comment had no inline finding text. Source of truth was check-run annotations.
bae6ff8Method thalamic_os_process_restart_does_not_leak_safety has 62 lines of code (limit is 50)4cd90b6/ in #61. Test body is split into helpers.bae6ff8current_exe should not be used for security operationsargs_os.4cd90b6(merged)args_os should not be used for security operationsattests/thalamic_brainstem_smoke.rs:423main. Codacy Semgrep flags both APIs.Change
Linux corpus-ipc OS-restart child re-exec now uses
std::fs::read_link("/proc/self/exe")instead ofcurrent_exe/args_os. This test only runs on the Ubuntucorpus-ipcjob.Related: #61 (merged).
Summary by cubic
Fixes the Codacy high finding on the OS-restart smoke test by resolving the test binary via
/proc/self/exeinstead ofargs_osorcurrent_exe.corpus-ipcjob, so the/procdependency is safe.Cargo.tomlversion or create a release.Written for commit 66877ea. Summary will update on new commits.
CodeAnt-AI Description
Run the Linux OS-restart smoke test using the actual test executable
What Changed
Impact
✅ Reliable Linux process-restart testing✅ Preserved safety-state isolation✅ Fewer security-scanner findings💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.