Skip to content

ci: add workflow to regenerate models from OpenAPI spec changes#657

Draft
vdusek wants to merge 1 commit intomasterfrom
worktree-add-ci-model-generation
Draft

ci: add workflow to regenerate models from OpenAPI spec changes#657
vdusek wants to merge 1 commit intomasterfrom
worktree-add-ci-model-generation

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Mar 3, 2026

Summary

  • Add a workflow_dispatch workflow (regenerate_models.yaml) that is triggered from apify-docs when OpenAPI specification changes in a PR
  • The workflow checks out apify-docs at the PR branch, builds the bundled OpenAPI spec, regenerates Pydantic models via datamodel-codegen, and opens a PR if models changed
  • Includes concurrency control (re-triggers for the same docs PR cancel previous runs)
  • Comments on the source apify-docs PR via the service account

How it works

PR in apify-docs (changes openapi specs)
  → openapi-ci.yaml: lint → build → validate → trigger-client-model-regeneration
    → gh workflow run regenerate_models.yaml in apify-client-python
      → Build spec from PR branch → datamodel-codegen → PR + comment on docs PR

Prerequisites

  • APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN secret must exist in this repo
  • NPM_TOKEN secret for building apify-docs dependencies
  • This workflow must be merged to master before the corresponding trigger is added to apify-docs

Related

  • apify-docs counterpart: apify/apify-docs (adds trigger job to openapi-ci.yaml)

Test plan

  • Merge this PR first
  • Then merge the apify-docs counterpart
  • Create a test PR in apify-docs that changes files in apify-api/openapi/
  • Verify the workflow is triggered and creates a PR in this repo

🤖 Generated with Claude Code

Add a workflow_dispatch workflow that is triggered from apify-docs when
OpenAPI specification changes in a PR. It checks out apify-docs at the
PR branch, builds the bundled spec, regenerates Pydantic models, and
opens a PR if models changed. Includes concurrency control and comments
on the source apify-docs PR via the service account.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Mar 3, 2026
@vdusek vdusek self-assigned this Mar 3, 2026
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Mar 3, 2026
@github-actions github-actions bot added this to the 135th sprint - Tooling team milestone Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (3fee70a) to head (971f9d0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #657      +/-   ##
==========================================
+ Coverage   96.52%   96.57%   +0.04%     
==========================================
  Files          45       45              
  Lines        4318     4318              
==========================================
+ Hits         4168     4170       +2     
+ Misses        150      148       -2     
Flag Coverage Δ
integration 94.69% <ø> (+0.13%) ⬆️
unit 78.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek marked this pull request as draft March 4, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant