Extract sbuf library and integrate unit testing#3
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 37 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe PR extracts string buffer formatting utilities from kernel.c into a reusable sbuf library (header, implementation, tests), refactors kernel.c to use the new functions, and integrates host-side unit testing into the build system and CI workflows. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@kernel/src/sbuf.c`:
- Around line 17-30: sbuf_append_str currently returns early when *len + 1u >=
cap without null-terminating the buffer; update the function so that before any
early return (inside the if checking capacity) you write buffer[*len] = '\0'
(using the current *len value) to ensure the buffer is always NUL-terminated on
partial writes, leaving the rest of logic in sbuf_append_str unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1bbb4641-f282-4134-a091-f601804e5d4f
📒 Files selected for processing (8)
.github/workflows/build-kernel.yml.github/workflows/release-kernel.ymlREADME.mdkernel/Makefilekernel/src/kernel.ckernel/src/sbuf.ckernel/src/sbuf.hkernel/tests/sbuf_test.c
Summary by CodeRabbit