Skip to content

fix: duplicate Swagger tags#63

Open
DevanandGowda wants to merge 1 commit intowarestack:mainfrom
DevanandGowda:fix/duplicate-swagger-tags
Open

fix: duplicate Swagger tags#63
DevanandGowda wants to merge 1 commit intowarestack:mainfrom
DevanandGowda:fix/duplicate-swagger-tags

Conversation

@DevanandGowda
Copy link

@DevanandGowda DevanandGowda commented Mar 3, 2026

Stick to Swagger tags only on main.py to avoid duplicate entries on Swagger docs

Summary by CodeRabbit

  • Bug Fixes

    • Fixed duplicate tags in API documentation that caused methods to appear multiple times.
  • Improvements

    • Streamlined API documentation with simplified, more concise tags for better clarity.
  • New Features

    • Enhanced health check endpoint to include additional system metrics: task queue status, worker count, queue size, and cache information.

@watchflow
Copy link

watchflow bot commented Mar 3, 2026

🛡️ Watchflow Governance Checks

Status: ❌ 4 Violations Found

🟡 Medium Severity (4)

Checks PR description (body) and title for a linked issue reference (e.g. #123, Fixes #123, Closes #456). Use when the rule requires issue refs in either field.

PR does not reference a linked issue (e.g. #123 or closes #123 in body/title)
How to fix: Add an issue reference in the PR title or description (e.g. Fixes #123).

Validates if the PR description meets minimum length requirements

PR description is empty
How to fix: Add a description with at least 50 characters.

Ensures PRs that modify source code also include a CHANGELOG or .changeset addition.

Source code was modified without a corresponding CHANGELOG update.
How to fix: Add an entry to CHANGELOG.md or generate a new .changeset file describing your changes.

Validates that the PR description accurately reflects the actual code changes.

PR description does not align with code changes: The PR description is empty and does not provide any information about the changes made. The code changes remove 'tags' from APIRouter instances in multiple API modules and adjust the tags used in app.include_router calls in main.py, which is related to fixing duplicate Swagger tags as indicated by the PR title. However, without any description, the intent and scope of the changes are not communicated, making the description misaligned with the actual changes.
How to fix: Add a description explaining that the PR removes duplicate Swagger tags from API routers to fix documentation issues.


💡 Reply with @watchflow ack [reason] to override these rules, or @watchflow help for commands.

Thanks for using Watchflow! It's completely free for OSS and private repositories. You can also self-host it easily.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc5d9c9 and b14b1c0.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • src/api/auth.py
  • src/api/recommendations.py
  • src/api/repos.py
  • src/main.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main.py
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/guidelines.mdc)

**/*.py: Use modern typing only: dict[str, Any], list[str], str | None (no Dict, List, Optional)
GitHub/HTTP/DB calls must be async def; avoid blocking calls (time.sleep, sync HTTP) in async paths
All agent outputs and external payloads must use validated BaseModel from Pydantic
Use dataclasses for internal immutable state where appropriate
Use structured logging at boundaries with fields: operation, subject_ids, decision, latency_ms
Implement Agent pattern: single-responsibility agents with typed inputs/outputs
Use Decorator pattern for retries, metrics, caching as cross-cutting concerns
Agent outputs must include: decision, confidence (0..1), short reasoning, recommendations, strategy_used
Implement confidence policy: reject or route to human-in-the-loop when confidence < 0.5
Use minimal, step-driven prompts; provide Chain-of-Thought only for complexity > 0.7 or ambiguity > 0.6
Strip secrets/PII from agent prompts; scope tools; keep raw reasoning out of logs (store summaries only)
Cache idempotent lookups; lazy-import heavy dependencies; bound fan-out with asyncio.Semaphore
Avoid redundant LLM calls; memoize per event when safe
Use domain errors (e.g., AgentError) with error_type, message, context, timestamp, retry_count
Use exponential backoff for transient failures; circuit-break noisy integrations when needed
Fail closed for risky decisions; provide actionable remediation in error paths
Validate all external inputs; verify webhook signatures
Implement prompt-injection hardening; sanitize repository content passed to LLMs
Performance targets: Static validation ~<100ms typical, hybrid decisions sub-second when cache warm, budget LLM paths thoughtfully
Reject old typing syntax (Dict, List, Optional) in code review
Reject blocking calls in async code; reject bare except: clauses; reject swallowed errors
Reject LLM calls for trivial/deterministic checks
Reject unvalidated agent outputs and missing confidenc...

Files:

  • src/api/auth.py
  • src/api/repos.py
  • src/api/recommendations.py
🔇 Additional comments (4)
CHANGELOG.md (1)

17-20: Changelog entry is aligned with the fix.

This accurately documents the Swagger duplicate-tag resolution and matches the PR objective.

src/api/recommendations.py (1)

19-19: Router tag removal is correct for Swagger deduplication.

Keeping tags out of the router here is consistent with centralized tag assignment and prevents duplicate Swagger tag entries.

src/api/auth.py (1)

12-12: This router-level tag removal looks good.

It aligns with the deduplication strategy of defining Swagger tags in one place.

src/api/repos.py (1)

13-13: Good change — router tags are correctly removed here as well.

This is consistent with the PR’s Swagger tag deduplication approach.


📝 Walkthrough

Walkthrough

This PR removes router tags metadata from individual API modules (auth, recommendations, repos), shortens router tags in the main application, and enriches the health_tasks endpoint response with additional status fields.

Changes

Cohort / File(s) Summary
API Router Tags Removal
src/api/auth.py, src/api/recommendations.py, src/api/repos.py
Removed tags parameter from APIRouter instantiations, eliminating module-level OpenAPI tags ("Authentication", "Recommendations", "Repositories") without changing endpoints or routes.
Router Registration & Health Enrichment
src/main.py
Updated included router tags to shorter category names and expanded health_tasks response payload to include task_queue_status, workers, queue_size, and dedup_cache metadata; other health endpoints only had tag changes.
Changelog
CHANGELOG.md
Added note under Unreleased fixing duplicate Swagger doc tags so methods no longer repeat across multiple tags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Tags trimmed away so neat and clean,
Generic names in place of the old scene,
Health checks now flourish with detail divine,
A tidier API, working just fine!
hops cheerfully 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing duplicate Swagger tags by consolidating tag definitions to main.py only, which directly addresses the stated objective.
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

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.

@DevanandGowda DevanandGowda force-pushed the fix/duplicate-swagger-tags branch from cc5d9c9 to b14b1c0 Compare March 3, 2026 18:03
@watchflow
Copy link

watchflow bot commented Mar 3, 2026

🛡️ Watchflow Governance Checks

Status: ❌ 1 Violations Found

🟡 Medium Severity (1)

Checks PR description (body) and title for a linked issue reference (e.g. #123, Fixes #123, Closes #456). Use when the rule requires issue refs in either field.

PR does not reference a linked issue (e.g. #123 or closes #123 in body/title)
How to fix: Add an issue reference in the PR title or description (e.g. Fixes #123).


💡 Reply with @watchflow ack [reason] to override these rules, or @watchflow help for commands.

Thanks for using Watchflow! It's completely free for OSS and private repositories. You can also self-host it easily.

@DevanandGowda
Copy link
Author

@watchflow ack "Low hanging fix, GitHub issue not present"

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (71.5%) is below the target coverage (80.0%). You can increase the head coverage or adjust the target coverage.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@          Coverage Diff          @@
##            main     #63   +/-   ##
=====================================
  Coverage   71.5%   71.5%           
=====================================
  Files        165     165           
  Lines      10847   10847           
=====================================
  Hits        7756    7756           
  Misses      3091    3091           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 947e64b...b14b1c0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants