8000 feat(web): add /api/v1/managers endpoint listing 22 package managers by dominicusin · Pull Request #62 · dominicusin/package-maximizer · GitHub
[go: up one dir, main page]

Skip to content

feat(web): add /api/v1/managers endpoint listing 22 package managers - #62

Merged
dominicusin merged 2 commits into
mainfrom
feat/webapi-managers-endpoint
Sep 1, 2026
Merged

dominicusin merged 2 commits into
mainfrom
feat/webapi-managers-endpoint

Conversation

@dominicusin
Copy link
Copy Markdown
Owner

Summary

  • New endpoint GET /api/v1/managers returns all 22 registered package managers
  • Added tests for the new endpoint
  • Tests: 501 passed, 2 skipped, 86% total coverage

Test plan

  • 501 passed, 2 skipped
  • Coverage 86%
  • CI green (pending)

- New endpoint GET /api/v1/managers returns all registered package managers
- Added tests for the new endpoint
- Tests: 501 passed, 2 skipped, 86% total coverage
@qodo-code-review
Copy link
Copy Markdown

PR Summary by Qodo

Expose registered package managers through the web API

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Add an authenticated endpoint exposing registered package-manager metadata and totals.
• Verify the response includes at least 22 managers and representative ecosystems.
• Advance the source-control fallback version to 0.6.0.
Diagram

sequenceDiagram
    actor Client
    participant Auth as API Key Guard
    participant API as Managers API
    participant Registry as Parser Registry
    Client->>Auth: GET managers
    Auth->>API: Authorized request
    API->>Registry: Iterate managers
    Registry-->>API: Parser metadata
    API-->>Client: Managers and count
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Share registry serialization with parsers endpoint
  • ➕ Prevents manager and parser metadata formatting from drifting
  • ➕ Keeps both public response envelopes while removing duplicated iteration logic
  • ➖ Introduces a helper for a currently small amount of code
  • ➖ Requires deciding where shared web serialization belongs
2. Extend the existing parsers endpoint
  • ➕ Avoids adding another route for the same underlying registry
  • ➕ Maintains a single discovery contract
  • ➖ Does not provide the requested package-manager terminology
  • ➖ Could require clients to reinterpret or migrate the existing response schema

Recommendation: Keep the dedicated /api/v1/managers contract for clearer package-manager discovery, but extract shared registry serialization with /api/v1/parsers. Both routes currently traverse the same registry and emit identical item fields, so centralizing that behavior reduces future drift without sacrificing API clarity.

Files changed (3) +34 / -1

Enhancement (1) +20 / -0
app.pyAdd authenticated package-manager discovery endpoint +20/-0

Add authenticated package-manager discovery endpoint

• Adds GET /api/v1/managers, backed by PARSER_REGISTRY. The endpoint returns each manager's registry name, parser class, first docstring line, and the total count.

package_maximizer/web/app.py

Tests (1) +13 / -0
test_web_api.pyCover package-manager listing response +13/-0

Cover package-manager listing response

• Adds an authenticated endpoint test that checks the response keys, minimum registry size, and presence of apt, pip, and conda.

tests/test_web_api.py

Other (1) +1 / -1
pyproject.tomlAdvance setuptools-scm fallback version to 0.6.0 +1/-1

Advance setuptools-scm fallback version to 0.6.0

• Updates the fallback package version used when source-control metadata is unavailable.

pyproject.toml

@read-the-docs-community
Copy link
Copy Markdown
< 8000 /div>

Documentation build overview

📚 package-maximizer | 🛠️ Build #34322258 | 📁 Comparing 065bb03 against latest (0c3a876)

  🔍 Preview build  

3 files changed
± genindex.html
± web.html
± _modules/package_maximizer/web/app.html

@qodo-code-review
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Managers endpoint undocumented 🐞 Bug ≡ Correctness
Description
The live /api/v1/managers route is missing from both /api/v1/openapi.json and /api/v1/docs.
API consumers relying on either advertised documentation surface cannot discover the new endpoint.
Code

package_maximizer/web/app.py[222]

+@app.get("/api/v1/managers")
Evidence
The added Flask route exists, while the manually constructed OpenAPI paths and docs HTML enumerate
neighboring listing endpoints but omit managers.

package_maximizer/web/app.py[222-238]
package_maximizer/web/app.py[542-609]
package_maximizer/web/app.py[612-632]
tests/test_web_api.py[81-90]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `GET /api/v1/managers` route is exposed by Flask but omitted from both the machine-readable OpenAPI paths and the human-readable docs page, leaving the published API descriptions incomplete.

## Issue Context
The project maintains these documentation surfaces manually in `package_maximizer/web/app.py`. Add the managers operation and response description to the OpenAPI map, add the route to the HTML endpoint list, and strengthen tests to assert that both surfaces include it.

## Fix Focus Areas
- package_maximizer/web/app.py[222-238]
- package_maximizer/web/app.py[542-632]
- tests/test_web_api.py[81-90]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Runtime version remains stale 🐞 Bug ≡ Correctness
Description
Changing only setuptools_scm.fallback_version to 0.6.0 can produce distribution metadata for
0.6.0 while the imported package, health endpoint, and OpenAPI document still report 0.5.0. Version
checks and production diagnostics therefore return contradictory release identities.
Code

pyproject.toml[79]

+fallback_version = "0.6.0"
Evidence
The PR changes the fallback distribution version to 0.6.0, but the package constant and both web API
version fields remain 0.5.0; the existing basic test explicitly preserves that stale runtime value.

pyproject.toml[78-79]
package_maximizer/init.py[1-7]
package_maximizer/web/app.py[164-178]
package_maximizer/web/app.py[542-552]
tests/test_basic.py[6-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The fallback package version is bumped to `0.6.0`, but every runtime-facing version value remains hard-coded to `0.5.0`, creating inconsistent package metadata and API/runtime output when the fallback is used.

## Issue Context
Use a single authoritative runtime version source, preferably distribution metadata with an appropriate source-tree fallback, and have the package attribute, health response, and OpenAPI info consume it. Update the version assertion accordingly so tests detect future drift.

## Fix Focus Areas
- pyproject.toml[78-79]
- package_maximizer/__init__.py[1-7]
- package_maximizer/web/app.py[164-178]
- package_maximizer/web/app.py[542-552]
- tests/test_basic.py[6-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo



# ─── List available managers (package managers) ──────────────
@app.get("/api/v1/managers")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. Managers endpoint undocumented 🐞 Bug ≡ Correctness

The live /api/v1/managers route is missing from both /api/v1/openapi.json and /api/v1/docs.
API consumers relying on either advertised documentation surface cannot discover the new endpoint.
Agent Prompt
## Issue description
The new `GET /api/v1/managers` route is exposed by Flask but omitted from both the machine-readable OpenAPI paths and the human-readable docs page, leaving the published API descriptions incomplete.

## Issue Context
The project maintains these documentation surfaces manually in `package_maximizer/web/app.py`. Add the managers operation and response description to the OpenAPI map, add the route to the HTML endpoint list, and strengthen tests to assert that both surfaces include it.

## Fix Focus Areas
- package_maximizer/web/app.py[222-238]
- package_maximizer/web/app.py[542-632]
- tests/test_web_api.py[81-90]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread pyproject.toml

[tool.setuptools_scm]
fallback_version = "0.5.0"
fallback_version = "0.6.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Runtime version remains stale 🐞 Bug ≡ Correctness

Changing only setuptools_scm.fallback_version to 0.6.0 can produce distribution metadata for
0.6.0 while the imported package, health endpoint, and OpenAPI document still report 0.5.0. Version
checks and production diagnostics therefore return contradictory release identities.
Agent Prompt
## Issue description
The fallback package version is bumped to `0.6.0`, but every runtime-facing version value remains hard-coded to `0.5.0`, creating inconsistent package metadata and API/runtime output when the fallback is used.

## Issue Context
Use a single authoritative runtime version source, preferably distribution metadata with an appropriate source-tree fallback, and have the package attribute, health response, and OpenAPI info consume it. Update the version assertion accordingly so tests detect future drift.

## Fix Focus Areas
- pyproject.toml[78-79]
- package_maximizer/__init__.py[1-7]
- package_maximizer/web/app.py[164-178]
- package_maximizer/web/app.py[542-552]
- tests/test_basic.py[6-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@coderabbitai
coderabbitai Bot commented Sep 1, 2026
Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 16 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 459256f9-d03c-41bf-b1ea-f4584f5781d7

📥 Commits

Reviewing files that changed from the base of the PR and between 0c3a876 and 065bb03.

📒 Files selected for processing (3)
  • package_maximizer/web/app.py
  • pyproject.toml
  • tests/test_web_api.py

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.

@dominicusin
dominicusin merged commit dce1dfd into main Sep 1, 2026
16 of 17 checks passed
87C8
@dominicusin
dominicusin deleted the feat/webapi-managers-endpoint branch September 1, 2026 00:21
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.

1 participant

0