Skip to content

fix(manifest-server): serve /health and /capabilities without 307 redirect - #1091

Draft
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785421712-manifest-server-health-no-redirect
Draft

fix(manifest-server): serve /health and /capabilities without 307 redirect#1091
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785421712-manifest-server-health-no-redirect

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

On Helm chart v2, kubelet probes hit GET /health on the manifest-server and get a 307 Temporary Redirect to /health/ (FastAPI's default redirect_slashes=True), doubling probe request volume and polluting logs/metrics with 307s. Root cause: the health router registers only the trailing-slash path (APIRouter(prefix="/health") + @router.get("/")).

Fix: register an additional no-trailing-slash route on the same handlers, hidden from the OpenAPI schema to avoid duplicate spec entries:

@router.get("", include_in_schema=False)
@router.get("/")
def health() -> Dict[str, str]: ...

The sibling capabilities router had the same prefix + "/" pattern, so it gets the identical treatment for consistency (getCapabilities operation unchanged). The manifest router's versioned paths are untouched. No change to response bodies or status codes; /health/ and /capabilities/ keep working.

Resolves https://github.com/airbytehq/oncall/issues/13203:

Upstream community report: airbytehq/airbyte#83263

Test Coverage

  • New unit_tests/manifest_server/routers/test_health.py: asserts GET /health returns 200 (with follow_redirects=False, so a 307 would fail) and GET /health/ still returns 200.
  • Extended test_capabilities.py: GET /capabilities returns 200 without redirect.
  • poetry run pytest unit_tests/manifest_server -q → 48 passed; ruff check/format and mypy clean.

Link to Devin session: https://app.devin.ai/sessions/0726083ae0bc474abb31094d82a8f933

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1785421712-manifest-server-health-no-redirect#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1785421712-manifest-server-health-no-redirect

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions

Copy link
Copy Markdown

PyTest Results (Fast)

4 161 tests  +3   4 149 ✅ +3   7m 41s ⏱️ -14s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 75eca36. ± Comparison against base commit 5ca654f.

@github-actions

Copy link
Copy Markdown

PyTest Results (Full)

4 164 tests  +3   4 152 ✅ +3   11m 53s ⏱️ -19s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 75eca36. ± Comparison against base commit 5ca654f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant