Skip to content

fix: include all supported fields for ad-hoc webhooks#855

Merged
vdusek merged 3 commits into
masterfrom
update-models-docs-pr-2640
Jun 16, 2026
Merged

fix: include all supported fields for ad-hoc webhooks#855
vdusek merged 3 commits into
masterfrom
update-models-docs-pr-2640

Conversation

@apify-service-account

@apify-service-account apify-service-account commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This PR updates the auto-generated Pydantic models and TypedDicts based on OpenAPI specification changes in apify-docs PR #2640.

On top of the regenerated models, it fixes a related bug: ad-hoc webhooks passed to start() / call() silently dropped idempotency_key, ignore_ssl_errors and do_not_retry. WebhookRepresentation declared only the four templating fields, and encode_webhooks_to_base64 keeps only declared fields, so these three never reached the platform. The platform accepts and honors all three for ad-hoc webhooks (verified in apify-core: the run-start handler feeds them into the same webhook-creation path as the create-webhook endpoint, including the idempotencyKey dedup).

What changed:

  • The regenerated models add the three fields to WebhookRepresentation and both webhook-representation typed dicts (snake_case + camelCase).
  • Reworks the WebhookCreate / dict projection in encode_webhooks_to_base64 to filter by the fields WebhookRepresentation declares, instead of hand-listing them. New ad-hoc fields now flow through automatically, so this class of silent-drop bug cannot recur.

Supersedes #854 (a manual version of the same fix).

Unblocks apify/apify-sdk-python#963, which forwards these fields from the SDK Webhook dataclass.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.37931% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.51%. Comparing base (9a953c7) to head (dbc4560).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/apify_client/_typeddicts.py 0.00% 16 Missing ⚠️
src/apify_client/_utils.py 80.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (41.37%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #855      +/-   ##
==========================================
- Coverage   94.82%   94.51%   -0.32%     
==========================================
  Files          48       48              
  Lines        5045     5069      +24     
==========================================
+ Hits         4784     4791       +7     
- Misses        261      278      +17     
Flag Coverage Δ
integration 92.91% <27.58%> (-0.29%) ⬇️
unit 83.27% <41.37%> (-0.26%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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 June 11, 2026 13:20
@vdusek vdusek changed the title [TODO]: update generated models from apify-docs PR #2640 fix: add idempotency_key, ignore_ssl_errors and do_not_retry to generated webhook models Jun 11, 2026
@vdusek vdusek closed this Jun 16, 2026
@vdusek vdusek reopened this Jun 16, 2026
@vdusek vdusek changed the title fix: add idempotency_key, ignore_ssl_errors and do_not_retry to generated webhook models fix: forward idempotency_key, ignore_ssl_errors and do_not_retry for ad-hoc webhooks Jun 16, 2026
vdusek added a commit to apify/apify-docs that referenced this pull request Jun 16, 2026
…ion (#2640)

- The `WebhookRepresentation` schema (items of the Base64-encoded
`webhooks` query parameter on the run/build endpoints) declared only
`eventTypes`, `requestUrl`, `payloadTemplate` and `headersTemplate`, but
the platform accepts and honors more fields for ad-hoc webhooks: the
run-start handler spreads each webhook object into the same
`insertWebhook` path used by the create-webhook endpoint, including the
`idempotencyKey` dedup logic.
- This adds the missing `idempotencyKey`, `ignoreSslErrors` and
`doNotRetry` properties to the schema, so generated API clients (e.g.
`apify-client-python`) stop dropping them.
- The Python client and SDK changes that build on this:
  - apify/apify-sdk-python#963
  - apify/apify-client-python#855
@vdusek vdusek marked this pull request as ready for review June 16, 2026 06:53
@vdusek vdusek changed the title fix: forward idempotency_key, ignore_ssl_errors and do_not_retry for ad-hoc webhooks fix: forward all supported fields for ad-hoc webhooks Jun 16, 2026
@vdusek vdusek changed the title fix: forward all supported fields for ad-hoc webhooks fix: include all supported fields for ad-hoc webhooks Jun 16, 2026
@vdusek vdusek merged commit 6eb267d into master Jun 16, 2026
27 checks passed
@vdusek vdusek deleted the update-models-docs-pr-2640 branch June 16, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants