[MAIN-IMP] Add error logging and hide sensitive configs from individual jobs#99
[MAIN-IMP] Add error logging and hide sensitive configs from individual jobs#99moda20 wants to merge 2 commits into
Conversation
Update config shared with jobs to have no sensitive data (explicitly hidden from jobs, encrypted values) small improvement for config categorization for the frontend
|
Warning Review limit reached
More reviews will be available in 58 minutes and 44 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: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR implements filtering of sensitive configuration properties from job execution contexts. The ChangesJob-Safe Configuration Filtering
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config/config.service.ts`:
- Around line 71-75: The code dereferences propertiesValues[pvk].job_hidden
after potentially deleting entries and never populates job_hidden from the
schema, causing runtime crashes and a non-functional filter; update the logic in
the function handling propertiesValues (the block using variables
propertiesValues, pvk and the withJobHiddenProperties flag) to (1) populate a
job_hidden boolean on each property from the schema before any deletions, (2)
check job_hidden via a safe accessor (or guard) before dereferencing, and (3)
perform deletion/filtering based on job_hidden when withJobHiddenProperties is
false by removing entries first or skipping them rather than dereferencing
deleted objects so the filter actually excludes hidden keys without causing
crashes.
In `@src/initialization/jobsManager.ts`:
- Around line 61-67: The JOB_START_ERROR logging currently calls
JSON.stringify(d, ...) where d is the result from
ScheduleJobManager.startJobById and may be non-serializable; wrap the
serialization in a safe guard (try/catch) and fall back to a safe representation
(e.g., util.inspect(d) or a simple string like "<unserializable payload>") so
the logger (sysLog.error) never throws and the original job.start failure is
preserved; update the code around sysLog.error and the JSON.stringify(d, null,
4) usage (referencing sysLog, LogEventNames.SysLogEvent, JOB_START_ERROR,
job.getName(), and ScheduleJobManager.startJobById) to use the safe-serialized
value instead.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d61cfa96-c69f-4fdc-8ba3-cf4d010c1d9d
📒 Files selected for processing (6)
src/config/config.service.tssrc/config/config.tssrc/initialization/jobsManager.tssrc/jobConsumer/jobConsumer.tssrc/types/models/config.tssrc/utils/convictUtils.ts
… when converting schema to job accessible version
Improvements:
Notes
How Has This Been Tested?
Related Issues
Screenshots (if applicable)
Additional Context