You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add Python API client model generation pipeline to AGENTS.md (#2402)
Add a new section to AGENTS.md documenting the cross-repo CI pipeline
that automatically regenerates Pydantic models in `apify-client-python`
whenever OpenAPI specs change in this repo. Covers both the trigger flow
from `openapi-ci.yaml` and the regeneration workflow in the Python
client repo.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- On PR with changes to `apify-api/openapi/**`: lint, build, and validate the bundled spec
97
+
- Upload `static/api/openapi.{json,yaml}` as artifacts
98
+
- `trigger-client-model-regeneration`job calls `gh workflow run regenerate_models.yaml` in `apify/apify-client-python`, passing `docs_pr_number` and `docs_workflow_run_id`
99
+
- On PR close: `cleanup-client-model-pr`job closes the corresponding PR in `apify-client-python` and deletes its branch
- Triggered via `workflow_dispatch` (automatically from this repo's CI or manually from GitHub UI)
103
+
- Downloads the OpenAPI spec artifact from this repo's workflow run (or fetches from `https://docs.apify.com/api/openapi.json` for manual runs)
104
+
- Runs `datamodel-codegen` to generate Pydantic models into `src/apify_client/_models.py`
105
+
- Runs `scripts/postprocess_generated_models.py` to fix known codegen issues (e.g. camelCase discriminator fields)
106
+
- Commits to branch `update-models-docs-pr-{PR_NUMBER}`, creates/updates a PR
107
+
- Posts a cross-repo comment on the original docs PR linking to the generated client PR
108
+
109
+
Branch naming convention `update-models-docs-pr-{N}` links the two PRs.
110
+
90
111
### Theme system
91
112
92
113
Uses `@apify/docs-theme` package - a shared theme across all 6+ documentation repos. Don't modify theme files directly. Changes to the theme propagate via CI to all projects.
0 commit comments