Skip to content

feat: convention-based serving from contract/generated/#1105

Open
fyzanshaik-atlan wants to merge 1 commit intonative_routesfrom
native_contract_toolkit
Open

feat: convention-based serving from contract/generated/#1105
fyzanshaik-atlan wants to merge 1 commit intonative_routesfrom
native_contract_toolkit

Conversation

@fyzanshaik-atlan
Copy link
Copy Markdown
Contributor

Summary

  • SDK auto-serves configmap and manifest from contract/generated/ directory
  • Apps with PKL contracts no longer need get_configmap() or get_manifest() overrides
  • Fully backward compatible — falls back to existing behavior when directory doesn't exist

Changes

  • handlers/__init__.py: get_configmap() scans contract/generated/ for {config_map_id}.json
  • application/__init__.py: get_manifest() reads contract/generated/manifest.json
  • metadata_extraction/sql.py: get_manifest() calls super() first so contract takes priority over hardcoded Python DAG
  • server/fastapi/__init__.py: new GET /configmaps list endpoint for contract discovery

Fallback chain

configmap: contract/generated/{id}.json → handler override → {}
manifest:  contract/generated/manifest.json → Python get_manifest() → None

Depends on

Test plan

  • App without contract/generated/ behaves identically to before
  • App with contract/generated/ serves configmap and manifest from files
  • SQL app's hardcoded manifest is overridden when contract file exists
  • GET /configmaps returns list of available configmap IDs

- Handler: get_configmap() checks contract/generated/{id}.json first
- Application: get_manifest() checks contract/generated/manifest.json first
- SQL app: get_manifest() defers to contract file before hardcoded DAG
- Server: add GET /configmaps list endpoint for contract discovery

Fallback chain:
  configmap: contract/generated/{id}.json → handler override → {}
  manifest:  contract/generated/manifest.json → Python get_manifest() → None
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@snykgituser
Copy link
Copy Markdown

snykgituser commented Mar 14, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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