Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

add version to app.py routes #169

Merged
merged 13 commits into from
Nov 14, 2023
Merged

Conversation

miararoy
Copy link
Contributor

@miararoy miararoy commented Nov 12, 2023

Problem

Versioning an API is a crucial aspect of maintaining its usability and compatibility as it evolves over time. There are several approaches to API versioning but the most common is URI Versioning (Path Versioning): where the version number is included in the URL path. For example:

GET /v1/items
POST /v2/items

Solution

  • added API_VERSION const to app.py (we could think about a better place to manage this in the future
  • changed all routes
  • removed /context from chat/completions

Note: did not change /health and /shutdown

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Regression

@miararoy miararoy marked this pull request as ready for review November 13, 2023 10:44
Copy link
Contributor

@igiloh-pinecone igiloh-pinecone left a comment

Choose a reason for hiding this comment

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

@miararoy see a few suggestions

src/canopy_server/app.py Show resolved Hide resolved
src/canopy_server/app.py Show resolved Hide resolved
src/canopy_server/app.py Outdated Show resolved Hide resolved
tests/e2e/test_app.py Outdated Show resolved Hide resolved
src/canopy_server/app.py Show resolved Hide resolved
Comment on lines 532 to 533
@click.option("--host", default="localhost",
help="Hostname or address to bind the server to. Defaults to localhost")
Copy link
Contributor

Choose a reason for hiding this comment

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

This particular change wasn't tested on all OSes (passing host='localhost' to uvicorn.run()).
If you wanna merge it, we will need to test it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

does 0.0.0.0 works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on all OSs - that is

Copy link
Contributor

Choose a reason for hiding this comment

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

If that was the code in main before this PR - then yeah. I tested this code on all 3 OSes manually yesterday.

@@ -4,6 +4,8 @@

from canopy.models.data_models import Messages, Query, Document

# TODO: consider separating these into modules: Chat, Context, Application, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@igiloh-pinecone igiloh-pinecone left a comment

Choose a reason for hiding this comment

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

@miararoy LGTM, but see this comment before merging

@miararoy miararoy added this pull request to the merge queue Nov 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2023
@miararoy miararoy added this pull request to the merge queue Nov 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2023
@miararoy miararoy added this pull request to the merge queue Nov 14, 2023
@miararoy miararoy changed the title add /api and version to app.py add version to app.py routes Nov 14, 2023
Merged via the queue into pinecone-io:main with commit bf05ba3 Nov 14, 2023
10 checks passed
@miararoy miararoy deleted the verionsize-api-routes branch November 14, 2023 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants