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 摘要。