Skip to content

Bump fastapi from 0.94.1 to 0.104.1

What does this merge request do and why?

This MR bumps fastapi from 0.94.1 to 0.104.1. Also fix request body declaration as per https://github.com/tiangolo/fastapi/discussions/9287. This version of fastapi still supports Pydantic v1 so I will hold off Pydantic v2 upgrade to another MR.

How to set up and validate locally

  1. Check out to this merge request's branch.
  2. Ensure a local Docker image built successfully.
    docker buildx build --platform linux/amd64 \
      -t api-gateway:dev .
  3. Run a local service on Docker.
    docker run --platform linux/amd64 --rm \
      -p 5052:5052 \
      -e AUTH_BYPASS_EXTERNAL=true \
      -v $PWD:/app -it api-gateway:dev
  4. Ensure the app boots up correctly.
  5. Send a few test cURL requests and confirm they work.
    curl --request POST \
      --url http://localhost:5052/v2/completions \
      --header 'Content-Type: application/json' \
      --header 'X-Gitlab-Authentication-Type: oidc' \
      --data '{
      "prompt_version": 1,
      "project_path": "awesome_project",
      "project_id": 23,
      "current_file": {
        "file_name": "main.ts",
        "content_above_cursor": "\nfunction calculator(a: Number, b: Number, operation: string): number {\n    // operation can be +, -, * or /\n    \n",
        "content_below_cursor": ""
      }
    }'

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Tan Le

Merge request reports

Loading