{{ message }}
Repository navigation
Conversation
8 tasks
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
apify pushuploads the Actor folder, so an Actor whose.actor/actor.jsonsetsdockerContextDirto a directory above that folder (a monorepo Actor, as in apify/actor-monorepo-example) uploads a context the platform cannot build, and--forcereplaces a working Git source with that broken upload. This PR makesapify pushreaddockerContextDirright afteractor.jsonand stop before any Actor read or write when the Actor is a monorepo Actor, with a message that points at the tracking Epic and at the Git source workaround. A context that is not a string, does not exist, lies outside the Git repository, or (outside Git) does not contain the Actor folder is reported as an invalidactor.json.Part of #595 (stage 1) and apify/apify-core#28685.
Changes
src/lib/docker-context.tswithresolveDockerContext,getContextFilePaths,readGitProvenance, theDockerContextResolutiontype,monorepoUnsupportedMessage, and the Epic URL constant, lifted from theactor-runtimebranch.apify pushruns the resolver after readingactor.jsonand before the Actor lookup, the Git source prompt, and any write:invalid: the message on stderr, exit code 5 (InvalidActorJson).context: the refusal message on stderr, exit code 255 (NotImplemented).none(no field, or a context at or below the Actor folder): an ordinary push.--json, stdout stays clean and the message goes to stderr, as the other preflight failures do.docs/is unchanged (pnpm run update-docsproduces no diff).Tests
test/local/lib/docker-context.test.ts(new): the resolver in a temp Git repository (undefined,"",..,., and../srcarenone;../../..iscontextwith the repository root andactors/x; a sibling directory in the repository iscontext; a context outside the repository, a missing directory, and a non-string value areinvalidwith the exact messages) and outside Git (a context containing the Actor iscontext; a sibling directory and a missing directory areinvalid), including theresolve('/repo')drive-letter technique for Windows.test/local/lib/docker-context-files.test.ts(new): tracked plus untracked-not-ignored files, a locally deleted file skipped,node_modulesandstoragedropped from untracked files only,.actorignorenot applied inside Git, symlinks kept, and the no-Git fallback throughgetActorLocalFilePathswith a mockednode:child_process.test/local/commands/push-monorepo.test.ts(new): a temp Git repository shaped like apify/actor-monorepo-example with a mocked client; the monorepo Actor stops with exit 255, the message on stderr, and no Actor get, version create or update, or key-value store call;--jsonkeeps stdout clean; a context outside the repository stops with exit 5;../srcpushes the Actor folder's files as usual.pnpm run lint,pnpm run format, andpnpm run buildpass;pnpm run update-docsproduces no diff.pnpm run test:local: 749 tests pass; the only failures are the two[python]fixture tests, which need Python 3.11 or higher and the machine has Python 3.9.6 (unrelated to this change).pnpm run test:api(needsTEST_USER_TOKEN); no API-facing code changed.Notes for reviewers
actor-runtimebranch (feat: Add local Actor runtime (apify runtime) #1496) rather than waiting for a split, so that branch should mergemasterafterward (never rebase) and drop its copy ofsrc/lib/runtime/source-context.tsin favor of this module. The runtime-only parts (pushActorRuntimeSourceContext,monorepoOutdatedRuntimeMessage, andcreateContextTarball) stay on that branch...,.,../src) is an ordinary push, because the platform accepts it. The branch returnedinvalidfor a context below the Actor folder. The branch also skipped the existence check outside Git; here a missing context isinvalideverywhere.contextwith the repository root as the source, so it exits 255 rather than 5; the platform clone holds the whole repository, and stage 2 uploads that root either way. Outside Git, such a context isinvalid(exit 5) as the issue says. The refusal message keeps the branch's text but replaces its last line (the runtime clause) with the Apify Console Git source hint,<repository URL>#<branch>:<folder>, instead of dropping it.readGitProvenanceandgetContextFilePathsare not called byapify pushyet; they land now so that stage 2 and theactor-runtimebranch share one module.actorPath) follows in a stacked PR once the platform acceptsactorPathonSOURCE_FILESandTARBALLversions (apify/apify-core#31473).voltapin is 24.21.0, which is not installed here).🤖 Generated with Claude Code