fix: test breaking caused by race in non-idempotent create folder op#1346
fix: test breaking caused by race in non-idempotent create folder op#1346
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA minor refactor of the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Code Review
This pull request updates the configuration utility to use os.makedirs with exist_ok=True for creating the settings directory, simplifying the logic. A review comment suggests enhancing security by explicitly setting the directory permissions to 0o700 to protect sensitive data like API keys.
📊 Coverage ReportOverall Coverage: 45% Diff: origin/main...HEAD
Summary
Line-by-lineView line-by-line diff coveragelibs/core/kiln_ai/utils/config.pyLines 281-290 281
282 @classmethod
283 def settings_dir(cls, create=True) -> str:
284 settings_dir = os.path.join(Path.home(), ".kiln_ai")
! 285 if create:
! 286 os.makedirs(settings_dir, exist_ok=True)
287 return settings_dir
288
289 @classmethod
290 def settings_path(cls, create=True) -> str:
|
What does this PR do?
Non-idempotent folder creation op seems to break tests on
maindue to a race.Checklists