Repository navigation
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
actor_pathargument toActorVersionCollectionClient.createandActorVersionClient.update, sync and async. The client sends it asactorPath: the Actor's directory inside the uploaded source of aSOURCE_FILESorTARBALLversion, such asactors/my-actor. With it, a monorepo Actor can be built from an upload of the whole repository.Closes #1186
Changes
actor_path: str | None = Nonesits aftergithub_gist_urlin all four methods. It's left out of the request when not passed.actorPathyet, 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 becomeactor_path=.SOURCE_FILESandTARBALLversions.updatedocstring says how the stored path is removed. An update that sendssource_type,source_files, ortarball_urlwithoutactor_pathremoves it, andactor_path=Nonealone keeps it.Tests
tests/unit/test_actor_version_fields.pycapture the request body. They check thatactorPathis 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.tests/integration/test_actor_version.pycovers the round trip on the API. It creates a version with a path, checks that abuild_tagupdate keeps it, and checks that a new upload and asource_typeupdate each remove it. It's skipped until the API accepts the field.uv run poe check-codepasses: 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
null. In this client,Nonemeans "not passed", and every update method dropsNonefrom the payload. A new upload withoutactor_pathalready removes the path, and so does an update with only the currentsource_type. Explicitnullinupdate()methods is tracked in Letupdate()methods clear a field by sendingnull#1135.actorPathfrom a returned version comes from the generated models once docs(api): describeactorPathon 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.createandActorClient.updatetakeversionsas raw dicts. Until the models are regenerated, those dicts must use theactorPathkey. A snake_caseactor_pathkey is sent unchanged, and the API doesn't know it.docs/. The argument is documented in the docstrings, which feed the API reference, as in earlier argument additions.🤖 Generated with Claude Code