Skip to content

Return initialize errors to servicemanager#1567

Open
JeethJJ wants to merge 1 commit intomainfrom
bug-fixes
Open

Return initialize errors to servicemanager#1567
JeethJJ wants to merge 1 commit intomainfrom
bug-fixes

Conversation

@JeethJJ
Copy link
Contributor

@JeethJJ JeethJJ commented Feb 25, 2026

Some errors have been printed from the initialize methods. They need to be returned to the service manager.

Issue : #1568

Summary by CodeRabbit

  • Refactor
    • Initialization error handling improved across services: startup failures now return errors instead of forcing process termination, allowing callers to handle failures gracefully.
    • Resulting behavior increases system resilience and enables safer startup recovery and diagnostics without abrupt service shutdowns.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Initialization in the IDP and role packages now propagate initialization errors instead of using fatal logging; the log import was removed and the IDP Initialize signature now returns an error, with error paths returning (nil, nil, err).

Changes

Cohort / File(s) Summary
IDP init (signature + error propagation)
backend/internal/idp/init.go
Removed log import; replaced fatal logging with return nil, nil, err; updated Initialize(mux *http.ServeMux) to return (IDPServiceInterface, declarativeresource.ResourceExporter, error) and propagate initialization errors.
Role init (error propagation)
backend/internal/role/init.go
Removed log import; replaced fatal logging on DB client/transactioner acquisition with return nil, nil, err; function signature unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nudged the logs and set them free,
Errors now travel back to me,
No sudden stops, no panic call,
Gentle returns — I saved them all. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete; it lacks the required template sections including Purpose, Approach, Checklist, and Security checks, with only a brief summary provided. Fill in the complete PR description template with Purpose, Approach, and applicable checklist items. At minimum, describe the solution approach and confirm testing/security checks.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: returning initialization errors to the service manager instead of logging them fatally.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug-fixes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@JeethJJ JeethJJ marked this pull request as ready for review February 25, 2026 09:06
rajithacharith
rajithacharith previously approved these changes Feb 25, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.35%. Comparing base (34adab8) to head (6d6569e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
backend/internal/idp/init.go 0.00% 2 Missing ⚠️
backend/internal/role/init.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1567   +/-   ##
=======================================
  Coverage   91.35%   91.35%           
=======================================
  Files         693      693           
  Lines       46293    46293           
=======================================
  Hits        42289    42289           
  Misses       2685     2685           
  Partials     1319     1319           
Flag Coverage Δ
backend-integration-postgres 52.42% <0.00%> (ø)
backend-integration-sqlite 52.40% <0.00%> (ø)
backend-unit 82.66% <0.00%> (ø)
frontend-apps-develop-unit 97.56% <ø> (ø)
frontend-apps-gate-unit 99.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants