fixing oban scheduler #2697
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2697
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2697/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #2350
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2350
Original created: 2026-01-18T09:53:30Z
Original updated: 2026-01-18T09:55:06Z
Original head: carverauto/serviceradar:2345-bug-sweep-groups---new-group
Original base: staging
Original merged: 2026-01-18T09:54:14Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix, Enhancement
Description
Changed Oban unavailable log level from warning to debug
Fixed Oban peer configuration to use tuple format
Changed default Oban enabled state from false to true
Refactored job catalog to support multiple AshOban resources
Added Oban running status check for admin access control
Diagram Walkthrough
File Walkthrough
schedule_sweep_monitor.ex
Reduced log severity for Oban unavailable conditionselixir/serviceradar_core/lib/serviceradar/sweep_jobs/changes/schedule_sweep_monitor.ex
config.exs
Fixed Oban peer configuration formatweb-ng/config/config.exs
Oban.Peers.Databaseto{Oban.Peers.Database, []}runtime.exs
Enabled Oban by default and fixed peer configweb-ng/config/runtime.exs
job_catalog.ex
Refactored job catalog for multi-resource supportweb-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex
PollingSchedule
user_auth.ex
Added Oban runtime status validation for admin accessweb-ng/lib/serviceradar_web_ng_web/user_auth.ex
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2350#issuecomment-3765118848
Original created: 2026-01-18T09:54:02Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 #2345
reduce the warning-level noise when Oban is unavailable).
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Silent exception handling: New code rescues all exceptions and returns a default value without logging or context,
which can hide production failures and impede debugging.
Referred Code
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Missing audit logging: The new admin-gating behavior for Oban UI access changes authorization outcomes but does
not add any audit log entries that could support reconstructing access decisions.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2350#issuecomment-3765119698
Original created: 2026-01-18T09:55:06Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Clarify Oban's role in web-ng
The PR enables Oban by default in
web-ng, but a comment suggestscore-elxhandles all jobs. This creates an architectural ambiguity that should be
clarified by updating the comment or documentation.
Examples:
web-ng/config/runtime.exs [181]
web-ng/config/config.exs [103]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a significant architectural ambiguity, as the code enables Oban in
web-ngwhile a comment claimscore-elxhandles all scheduled jobs, impacting future maintenance and clarity.Log errors instead of silently rescuing
In the
resource_triggers/1function, log any exceptions caught in therescueblock instead of silently returning an empty list to improve error visibility.
web-ng/lib/serviceradar_web_ng/jobs/job_catalog.ex [180-190]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that swallowing errors silently is bad practice and proposes adding logging, which significantly improves debuggability without breaking the function's resilience.
Normalize Oban env var case
Normalize the
SERVICERADAR_WEB_NG_OBAN_ENABLEDenvironment variable to lowercasebefore checking its value to support case-insensitive inputs like "TRUE" or
"Yes".
web-ng/config/runtime.exs [181]
Suggestion importance[1-10]: 5
__
Why: This is a good suggestion for making the environment variable check more robust by handling case-insensitivity, which is a common source of configuration errors.
Check Oban PID liveness
In the
oban_running?function, add aProcess.alive?check to ensure the processID (PID) found for Oban corresponds to a live process.
web-ng/lib/serviceradar_web_ng_web/user_auth.ex [229-232]
Suggestion importance[1-10]: 7
__
Why: This suggestion correctly identifies a potential race condition where the Oban process could be dead but still in the registry, and provides a simple, effective fix using
Process.alive?.