Skip to content

Conversation

@jonpspri
Copy link
Contributor

@jonpspri jonpspri commented Oct 13, 2025

Summary

Remove deprecated env=... parameters from Pydantic Field definitions in config.py. Pydantic automatically infers environment variable names from field names, making the explicit env= parameter unnecessary and deprecated.

Changes

  • Remove env="PORT", env="JWT_SECRET_KEY", env="AUTH_ENCRYPTION_SECRET"
  • Remove env parameters from security and CORS settings (SECURE_COOKIES, COOKIE_SAMESITE, etc.)
  • Remove env="LOG_LEVEL", env="ENVIRONMENT", env="APP_DOMAIN"
  • Remove env="FEDERATION_PEERS", env="SSO_ISSUERS"

All environment variables continue to work as before through Pydantic's automatic inference based on field names.

Test plan

  • Configuration loading works correctly without env= parameters
  • All environment variables are still recognized by Pydantic
  • No functional changes to application behavior

Generated with Claude Code

Copilot AI review requested due to automatic review settings October 13, 2025 15:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR performs configuration cleanup and migrates the project to use uv for dependency management. The changes modernize the build system, remove deprecated Pydantic configurations, fix type hints, and improve CI workflows.

  • Remove deprecated env=... parameters from Pydantic Field definitions
  • Migrate pytest workflows and Makefile from pip to uv for better dependency management
  • Fix type annotations for keep_alive parameter in translate.py functions
  • Reorganize pyproject.toml dependency structure and resolve conflicts

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/integration/test_translate_echo.py Modernized test code with proper type hints, improved assertions, and pytest fixture usage
pyproject.toml Restructured dependencies from optional-dependencies to dependency-groups and removed conflicts
mcpgateway/translate.py Fixed type hints for keep_alive parameters from int to float
mcpgateway/config.py Removed deprecated env= parameters from Pydantic Field definitions
docs/docs/manage/observability/observability.md Enhanced documentation with detailed backend comparison guide
Makefile Updated to use uv/uvx for test execution and semgrep scanning
.github/workflows/pytest.yml Migrated CI workflow from pip to uv for dependency management

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Pydantic automatically infers environment variable names from field names,
making the explicit env= parameter unnecessary and deprecated. This change
removes all env= parameters from Field definitions in config.py to align
with current Pydantic best practices.

Changes:
- Remove env="PORT", env="JWT_SECRET_KEY", env="AUTH_ENCRYPTION_SECRET"
- Remove env parameters from security and CORS settings
- Remove env="LOG_LEVEL", env="ENVIRONMENT", env="APP_DOMAIN"
- Remove env="FEDERATION_PEERS", env="SSO_ISSUERS"

All environment variables continue to work as before through Pydantic's
automatic inference based on field names.

Signed-off-by: Jonathan Springer <[email protected]>
@jonpspri jonpspri force-pushed the chore/clean_config_deprications branch from ab3a986 to 3624e7f Compare October 13, 2025 15:11
@jonpspri jonpspri changed the title chore: Clean up configuration deprecations and migrate to uv fix: Remove deprecated 'env=...' parameters in config.py Oct 13, 2025
@crivetimihai crivetimihai merged commit c4ff12a into IBM:main Oct 14, 2025
35 checks passed
@jonpspri jonpspri deleted the chore/clean_config_deprications branch October 15, 2025 08:29
p4yl04d3r pushed a commit to p4yl04d3r/mcp-context-forge that referenced this pull request Nov 19, 2025
Pydantic automatically infers environment variable names from field names,
making the explicit env= parameter unnecessary and deprecated. This change
removes all env= parameters from Field definitions in config.py to align
with current Pydantic best practices.

Changes:
- Remove env="PORT", env="JWT_SECRET_KEY", env="AUTH_ENCRYPTION_SECRET"
- Remove env parameters from security and CORS settings
- Remove env="LOG_LEVEL", env="ENVIRONMENT", env="APP_DOMAIN"
- Remove env="FEDERATION_PEERS", env="SSO_ISSUERS"

All environment variables continue to work as before through Pydantic's
automatic inference based on field names.

Signed-off-by: Jonathan Springer <[email protected]>
Signed-off-by: p4yl04d3r <[email protected]>
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