Skip to content

feat: support actor_path on Actor version create and update - #1187

Draft
DaveHanns wants to merge 9 commits into
masterfrom
feat/actor-version-actor-path
Draft

DaveHanns wants to merge 9 commits into
masterfrom
feat/actor-version-actor-path

Conversation

@DaveHanns

@DaveHanns DaveHanns commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an actor_path argument to ActorVersionCollectionClient.create and ActorVersionClient.update, sync and async. The client sends it as actorPath: the Actor's directory inside the uploaded source of a SOURCE_FILES or TARBALL version, such as actors/my-actor. With it, a monorepo Actor can be built from an upload of the whole repository.

Closes #1186

Changes

  • actor_path: str | None = None sits after github_gist_url in all four methods. It's left out of the request when not passed.
  • The argument goes into the actor_path field of the generated CreateVersionRequest and UpdateVersionRequest models, like the other source-location arguments. The returned version exposes it as Version.actor_path.
  • The docstrings list the path rules the API enforces, such as the length of 1 to 255 characters, and say the argument works only for SOURCE_FILES and TARBALL versions.
  • The update docstring says how the stored path is removed. An update that sends source_type, source_files, or tarball_url without actor_path removes it, and actor_path=None alone keeps it.

Tests

  • New unit tests in tests/unit/test_actor_version_fields.py capture the request body. They check that actorPath is sent on create and update and that the returned Version.actor_path reads it back. They also check that actorPath is absent when the argument is not passed. Each test runs sync and async on both HTTP transports.
  • A new integration test in tests/integration/test_actor_version.py covers the round trip on the API. It creates a version with a path, checks that a build_tag update keeps it, and checks that a new upload and a source_type update each remove it.
  • With models generated locally from the API specification plus docs(api): describe actorPath on multi-file and zip Actor versions apify-docs#3084, uv run poe check-code passes: lint, type check, docstring check, and 2,462 unit tests (1 skipped, as on master). The integration suite wasn't run locally, since it calls the real API.

Notes for reviewers

  • Merge only after all three of these happen:
  • Until the regenerated models are on master, CI fails on purpose. With the current models, 8 of the 16 new unit test cases fail because the client sends actor_path instead of actorPath, and the type check reports that Version has no actor_path.
  • Merging publishes a beta release and a changelog entry right away.
  • There's no separate way to send null. In this client, None means "not passed", and every update method drops None from the payload. A new upload without actor_path already removes the path, and so does an update with only the current source_type. Explicit null in update() methods is tracked in Let update() methods clear a field by sending null #1135.
  • There's no new page in docs/02_concepts/. Those pages explain how the client works, such as retries and pagination, and a new argument on two methods doesn't fit one. The docstrings document the argument, and they feed the API reference.

🤖 Generated with Claude Code

Add an `actor_path` argument to `ActorVersionCollectionClient.create` and
`ActorVersionClient.update`, sync and async. It's sent as `actorPath`: the
Actor's directory inside the uploaded source of a `SOURCE_FILES` or `TARBALL`
version, so a monorepo Actor can be built from an upload of the whole
repository.

The OpenAPI spec doesn't describe `actorPath` yet, so the client passes it to
the request models as an extra field under its API name. The integration test
for the round trip stays skipped until the API accepts the field.
The `actor_path` docstrings now list the path rules the API enforces: at
most 255 characters, no leading, trailing, or repeated `/`, and no `.` or
`..` segment. They also say the argument works only for `SOURCE_FILES` and
`TARBALL` versions.

The `update` docstring now says that `actor_path=None` alone keeps the
stored path, because the client never sends `None`. To remove the path
without a new upload, pass the current `source_type` again.
The skipped integration test now also sets the path again with an update
and checks that an update with only the current `source_type` removes it.
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 1, 2026
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.66%. Comparing base (cbed860) to head (cec4a61).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1187   +/-   ##
=======================================
  Coverage   95.66%   95.66%           
=======================================
  Files          61       61           
  Lines        6461     6461           
=======================================
  Hits         6181     6181           
  Misses        280      280           
Flag Coverage Δ
integration 91.05% <ø> (-0.02%) ⬇️
unit 90.54% <ø> (+0.18%) ⬆️

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.

@DaveHanns DaveHanns changed the title feat: support actor_path on Actor version create and update feat: support actor_path on Actor version create and update Nov 2, 2026
The regenerated `CreateVersionRequest` and `UpdateVersionRequest` models
describe `actorPath`, so the version clients pass `actor_path` by its field
name like the other source-location arguments, instead of adding
`actorPath` to the models' extra fields.

This needs the models regenerated from an API specification that includes
`actorPath` on master first.
The Apify API accepts `actorPath` by the time this lands, so the test is no
longer skipped. It reads the path from the regenerated `Version.actor_path`
field instead of dumping the model by alias.
The API and the regenerated request models reject an empty `actor_path`,
so the docstrings give the full length range instead of only the maximum.
The tests that send `actor_path` now also check that the returned version
reads `actorPath` from the response, so the read side is covered without
the live API.
@DaveHanns

Copy link
Copy Markdown
Contributor Author

Don't merge yet. This PR depends on:

  1. apify/apify-core#31479, merged and deployed.
  2. docs(api): describe actorPath on multi-file and zip Actor versions apify-docs#3084, merged and published to docs.apify.com.
  3. The nightly chore: Regenerate models from the published OpenAPI spec PR that picks up the docs change, merged to master.

Until then, CI fails on purpose: the code passes actor_path to the regenerated request models, and the integration test needs the deployed API. After step 3, merge master into this branch, and CI should pass.

@DaveHanns
DaveHanns requested a review from vdusek November 3, 2026 11:33
@DaveHanns
DaveHanns marked this pull request as ready for review November 3, 2026 11:33
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Nov 3, 2026
@vdusek
vdusek marked this pull request as draft November 3, 2026 14:52
@vdusek

vdusek commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

I'll convert this to draft, please make it ready for a review once this has green CI (requirements in other repos are merged).

This branch has not been deployed

No deployments
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. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support actorPath on Actor version create and update

3 participants