Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""NX AI - FastAPI/Python/Postgres/tsvector"""

# Current Version
__version__ = "1.0.6"
__version__ = "1.0.7"
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Given the API response metadata schema changes in this PR (field removals/type changes), consider whether a patch bump to 1.0.7 is sufficient. If you follow semantic versioning for API/package compatibility, a minor/major bump (or a deprecation window) would better signal breaking changes to consumers.

Suggested change
__version__ = "1.0.7"
__version__ = "1.1.0"

Copilot uses AI. Check for mistakes.
6 changes: 3 additions & 3 deletions app/api/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def root() -> dict:

epoch = int(time.time() * 1000)
meta = {
"title": "Product List",
"description": "from the products Postgres table",
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

The new description value ("from the products Postgres table") is user-facing API metadata but it exposes an internal implementation detail and is oddly lowercased. Consider using a consumer-oriented description that doesn't couple the API contract to the storage layer.

Suggested change
"description": "from the products Postgres table",
"description": "List of available products",

Copilot uses AI. Check for mistakes.
"version": __version__,
"base_url": base_url,
"time": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()),
"epoch": epoch,
"time": epoch,
"severity": "success",
"message": f"{len(products)} products"
}
Comment on lines 41 to 48
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

meta.time changes from a human-readable timestamp string (and separate epoch) to an epoch-milliseconds integer, and meta.message is removed. If this API is consumed externally, this is a response-shape breaking change; consider either providing a transition period (e.g., keep the old fields for one release) or bumping the version in a way that clearly signals incompatibility to API consumers.

Copilot uses AI. Check for mistakes.
return {"meta": meta, "data": products}
8 changes: 4 additions & 4 deletions app/api/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ def root() -> dict:
base_url = os.getenv("BASE_URL", "http://localhost:8000")
epoch = int(time.time() * 1000)
meta = {
"base_url": base_url,
"title": "NX-AI says hi",
"description": "This is the base_url",
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

The new description value ("This is the base_url") reads like a placeholder and is grammatically/semantically unclear as API metadata (it doesn't actually describe the endpoint/service). Consider replacing it with a meaningful description (and/or using "base URL" instead of the variable name base_url).

Suggested change
"description": "This is the base_url",
"description": "Root endpoint for the NX-AI API; returns service metadata and the base URL for key endpoints.",

Copilot uses AI. Check for mistakes.
"version": __version__,
"time": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()),
"epoch": epoch,
"base_url": base_url,
"time": epoch,
"severity": "success",
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Removing the meta.message field is a breaking change for the existing test suite: tests/test_routes.py::test_root_returns_welcome_message currently asserts json_data["meta"]["message"] exists and contains "NX AI". Either update the tests to match the new meta schema or keep a backward-compatible message field for now.

Suggested change
"severity": "success",
"severity": "success",
"message": "Welcome to NX AI",

Copilot uses AI. Check for mistakes.
"message": f"NX AI says hello",
}
endpoints = [
{"docs": "docs", "url": f"{base_url}/docs"},
Expand Down
Loading