Skip to content

Fix typo in feature flag env name

Tan Le requested to merge fix-feature-flag-env-typo into main

What does this merge request do and why?

This fixes a typo in a feature flag env name that cause the app fails to boot. The bug was introduced in !706 (merged).

cp .env .env.bak
cp example.env .env
poetry run ai_gateway

❯ poetry run ai_gateway

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/tanle/.local/share/mise/installs/python/3.10.13/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/__init__.py", line 3, in <module>
    from ai_gateway import api, auth, container, experimentation, main, models
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/api/__init__.py", line 3, in <module>
    from ai_gateway.api import middleware, monitoring
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/api/middleware.py", line 29, in <module>
    from ai_gateway.instrumentators.base import Telemetry, TelemetryInstrumentator
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/instrumentators/__init__.py", line 3, in <module>
    from ai_gateway.instrumentators.base import *
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/instrumentators/base.py", line 12, in <module>
    from ai_gateway.models import SafetyAttributes
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/models/__init__.py", line 3, in <module>
    from ai_gateway.models import container, mock
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/models/container.py", line 8, in <module>
    from ai_gateway.models import mock
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/models/mock.py", line 7, in <module>
    from ai_gateway.models.base import (
  File "/Users/tanle/code/gitlab/ai-assist-api/ai_gateway/models/base.py", line 16, in <module>
    config = Config()
  File "/Users/tanle/code/gitlab/ai-assist-api/.venv/lib/python3.10/site-packages/pydantic_settings/main.py", line 84, in __init__
    super().__init__(
  File "/Users/tanle/code/gitlab/ai-assist-api/.venv/lib/python3.10/site-packages/pydantic/main.py", line 171, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Config
f.excl_post_proc
  Extra inputs are not permitted [type=extra_forbidden, input_value='[]', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden

How to set up and validate locally

  1. Check out to this merge request's branch.

  2. Verify that the example.env.

    cp .env .env.bak-2
    cp example.env .env
    poetry run ai_gateway

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