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
{{ message }}
Repository navigation
Automate PR creation when OpenAPI spec is updated #618
As part of the effort to introduce fully typed & generated API clients (apify/apify-core#25186), the Python client will generate Pydantic models and type annotations from the OpenAPI specification (see #481).
Once the generation pipeline is in place, we need a mechanism to keep the generated code in sync with the OpenAPI spec automatically, so that changes to the API are promptly reflected in the client without manual intervention.
Goal
Set up a CI/CD automation (e.g. GitHub Actions workflow) that:
Detects changes to the OpenAPI specification (e.g. via a scheduled check, a webhook/dispatch from apify-docs, or by polling https://docs.apify.com/api/openapi.json).
Re-runs the code generation pipeline to produce updated models/types.
Opens a PR automatically in apify-client-python with the regenerated code, so it can be reviewed and merged.
Considerations
The trigger mechanism needs to be decided — options include:
A repository_dispatch event sent from the apify-docs repo (or wherever the OpenAPI spec is maintained) whenever the spec changes.
A scheduled workflow (e.g. daily cron) that fetches the latest spec, compares it against the currently used version, and opens a PR if there are differences.
A webhook from the API deployment pipeline.
The PR should include a clear diff of generated changes and ideally reference which OpenAPI spec version/commit triggered the update.
Consider running linting, type checking, and tests as part of the PR to catch breaking changes early.
Activity
ci: add workflow to regenerate models from OpenAPI spec (#694)
ci: trigger Python client model regeneration on OpenAPI spec changes (a…