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
- Vorherrschende Sprache
- Python
- Sterne
- 26
- Forks
- 53
- Ø Merge
- 2 T. 6 Std.
- Gemergte PRs (30 T.)
- 10
Beschreibung
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)
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- build-system, ci-cd, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100