Skip to content

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

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

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

Conversation

@DaveHanns

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 request models don't describe actorPath yet, so the client passes it as an extra field under its API name. No generated model is edited. After the models are regenerated, the keyword can become actor_path=.
  • The docstrings list the path rules the API enforces 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 it's 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. It's skipped until the API accepts the field.
  • uv run poe check-code passes: lint, type check, docstring check, and 2428 unit tests (1 skipped, as on master). The rest of the integration suite wasn't run locally, since it calls the real API.

Notes for reviewers

  • Merge only after apify/apify-core#31479 is deployed, or the API rejects the field. Remove the skip marker from the integration test in this PR before merging. 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.
  • Reading actorPath from a returned version comes from the generated models once docs(api): describe actorPath on multi-file and zip Actor versions apify-docs#3084 is published and the models are regenerated. Until then it's an extra field: version.model_dump(by_alias=True).get('actorPath').
  • ActorCollectionClient.create and ActorClient.update take versions as raw dicts. Until the models are regenerated, those dicts must use the actorPath key. A snake_case actor_path key is sent unchanged, and the API doesn't know it.
  • There's no concepts page in docs/. The argument is documented in the docstrings, which feed the API reference, as in earlier argument additions.

🤖 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 (6097ad3) to head (2ebafe1).
⚠️ Report is 2 commits behind head on master.

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.17% <ø> (+0.13%) ⬆️
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.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support actorPath on Actor version create and update

1 participant