Skip to content

refactor: remove the middleware management API - #317

Merged
uniqueg merged 1 commit into
devfrom
refactor/drop-middleware-api
Oct 24, 2026
Merged

uniqueg merged 1 commit into
devfrom
refactor/drop-middleware-api

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Removes the middleware management API: its OpenAPI specification (pro_tes/api/middleware_management.yaml, never served) and the middlewares collection with its indexes in config.yaml. Plugins are managed by configuration only (maintainer decision; #197 and PR #199 are superseded). The upgrade guide says the collection is no longer created and can be dropped. The database tests that used the middlewares collection as an example of another unique index now use an overlay with a collection of their own.

Light lane: removes files and configuration; no runtime code changes. I reviewed the diff myself.

Verification

Run locally on the branch:

  • ruff, ruff format, mypy, ast-grep (and its rule tests), semgrep: passed
  • pytest: 1035 passed, 80 skipped (chart and real-MongoDB tests), 100% coverage
  • mkdocs build --strict: passed

Not run locally: the Docker Compose smoke test and the MongoDB 7.0 CI entry (they run in CI).

Open questions

None.

Closes #316

🤖 Generated with Claude Code

Summary by Sourcery

Remove the unused middleware management API and its database configuration, making middleware management configuration-only.

Enhancements:

  • Remove the unused middleware management API specification and middleware collection configuration so middleware stacks are managed exclusively through configuration.
  • Update documentation to reflect the removal of the middleware management API and the ability to drop its database collection.

Tests:

  • Update database tests to use a dedicated overlay collection when validating behavior for non-task unique indexes.

The middleware management API was specified but never served, and is
not planned any more: the stack of middlewares (task plugins, with FOCA)
is managed by config only. Its specification
(`api/middleware_management.yaml`) and its collection (`middlewares`,
with two unique indexes) are removed; the tests of failing unique
indexes other than that of task identifiers use a collection of a test
overlay instead. The upgrading notes say that the collection can be
dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Removes the unserved middleware management API, its OpenAPI specification, and default database collection/index configuration, then updates documentation and database tests to treat middleware as configuration-only while retaining unique-index error coverage.

File-Level Changes

Change Details Files
Remove the unserved middleware management API and its remaining configuration references.
  • Delete the middleware management OpenAPI specification.
  • Remove middleware collection indexes from the default database configuration.
  • Remove stale API comments and documentation describing the unserved management API.
  • Document that middleware is configuration-only and the legacy collection can be dropped during upgrades.
pro_tes/api/middleware_management.yaml
pro_tes/config.yaml
docs/api.md
docs/index.md
docs/middlewares.md
docs/upgrading.md
Update tests to reflect configuration-only middleware management while preserving database index validation coverage.
  • Clarify the expected 404 test for the removed API.
  • Introduce a test overlay containing an independent collection with a unique index.
  • Run duplicate-key handling tests against the overlay collection instead of the removed middleware collection.
tests/test_app.py
tests/utils/test_db.py

Assessment against linked issues

Issue Objective Addressed Explanation
#316 Remove the obsolete middleware management API specification and references to it from the documentation and configuration. ✅
#316 Stop configuring the middlewares collection and its indexes, while documenting that existing collections can be dropped. ✅
#316 Preserve the startup failure behavior for conflicting non-task unique indexes, using a test overlay rather than the removed middlewares collection. ✅

Possibly linked issues


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

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35384631 | 📁 Comparing 84ae1c5 against latest (e8a1616)

  🔍 Preview build  

4 files changed
± index.html
± api/index.html
± middlewares/index.html
± upgrading/index.html

@uniqueg
uniqueg marked this pull request as ready for review October 24, 2026 22:41
@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e8a1616) to head (84ae1c5).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #317   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        29           
  Lines         2469      2469           
=========================================
  Hits          2469      2469           

☔ 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.

@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 ✨

@uniqueg
uniqueg merged commit 0770405 into dev Oct 24, 2026
19 checks passed
@uniqueg
uniqueg deleted the refactor/drop-middleware-api branch October 24, 2026 22:43
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.

refactor: remove the middleware management API

1 participant