airbytehq / airbytehq/airbyte-python-cdk

Codegen drift: Poe the Poet (version 0.48.0) Error: No poe configuration found from location /home/ubuntu Usage: poe [global options] task [task arguments] Global options: -h [TASK], --help [TASK] Show this help page and exit, optionally supply a task. --version Print the version and exit -v, --verbose Increase output (repeatable) -q, --quiet Decrease output (repeatable) -d, --dry-run Print the task contents

未關閉
#1,105 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
Python
星號
26
分支
53
平均合併
2 天 6 小時
30 天內合併 PR
10

描述

Running `poetry run poe assemble` on a clean checkout of `main` produces ~350 lines of style drift in `airbyte_cdk/sources/declarative/models/declarative_component_schema.py` (e.g. `conint`/`confloat` usage, class reordering) that does not match the committed file, so contributors hand-patch the generated model instead of regenerating it.

Consequences observed while adding `UnionPartitionRouter` (https://github.com/airbytehq/airbyte-python-cdk/pull/1071):
- The YAML schema declares `minItems: 2` on `UnionPartitionRouter.partition_routers`, but the generated model has no corresponding constraint. The current codegen does not emit `min_items`, and pydantic v1 rejects a hand-added `min_items=2` on this self-referential `List[Union[...]]` field at import time ("field constraints are set but not enforced").
- There is no CI check that the committed generated file matches `poe assemble` output, so hand-maintained divergence accumulates silently.

Suggested follow-ups:
- Pin/align the datamodel-code-generator version so `poe assemble` reproduces the committed file byte-for-byte.
- Add an assemble-check CI job.
- Decide whether array constraints like `minItems` should be reflected in the generated models (may require pydantic v2 or generator options).

Requested by tolik0 in review of PR https://github.com/airbytehq/airbyte-python-cdk/pull/1071 (comment https://github.com/airbytehq/airbyte-python-cdk/pull/1071#discussion_r3719735982).

---
[Devin session](https://app.devin.ai/sessions/38753ed2d1f346e6a370888444676f4f)

貢獻指南

開啟貢獻指南

研究方向

Start by running `poetry run poe assemble` from a clean checkout and compare the output with `airbyte_cdk/sources/declarative/models/declarative_component_schema.py`. Review the code-generation configuration and existing CI setup, then determine how generated-file parity and the `minItems` behavior should be validated. Done means the intended generation and CI behavior is documented and reproducible without hand-patching.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
build-system, ci-cd, tooling
Issue 類型
缺陷
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。