Skip to content

RHINENG-29747: fix admin API - #2328

Merged
Dugowitch merged 1 commit into
RedHatInsights:masterfrom
Dugowitch:pr
Sep 10, 2026
Merged

RHINENG-29747: fix admin API#2328
Dugowitch merged 1 commit into
RedHatInsights:masterfrom
Dugowitch:pr

Conversation

@Dugowitch

@Dugowitch Dugowitch commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

InitAdmin route did not match OpenAPI

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Fix admin API routing and database context initialization.

Bug Fixes:

  • Correct the admin system deletion endpoint to use the plural /systems/:inventory_id path.
  • Enable database context middleware for the admin API.

@Dugowitch
Dugowitch requested a review from a team as a code owner September 9, 2026 15:53
@sourcery-ai

sourcery-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the admin API by correcting the system deletion route to the expected plural path and adding database-context middleware to the admin server.

File-Level Changes

Change Details Files
Correct the admin API route for system deletion to use the plural resource path.
  • Change the DELETE endpoint from /system/:inventory_id to /systems/:inventory_id.],
  • files:[
manager/routes/routes.go
Enable database context middleware for the standalone admin API.
  • Register DatabaseWithContext after request/response logging and before admin Swagger setup.
  • Ensure admin handlers receive database context through the middleware chain.
turnpike/admin_api.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.06%. Comparing base (7d85c4a) to head (bac4abd).

Files with missing lines Patch % Lines
manager/routes/routes.go 0.00% 1 Missing ⚠️
turnpike/admin_api.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2328      +/-   ##
==========================================
- Coverage   59.07%   59.06%   -0.01%     
==========================================
  Files         150      150              
  Lines        9614     9615       +1     
==========================================
  Hits         5679     5679              
- Misses       3341     3342       +1     
  Partials      594      594              
Flag Coverage Δ
unittests 59.06% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@swadeley swadeley self-assigned this Sep 9, 2026
@Dugowitch
Dugowitch merged commit 5898fc5 into RedHatInsights:master Sep 10, 2026
8 checks passed
@Dugowitch
Dugowitch deleted the pr branch September 10, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants