Skip to content

apify push: refuse monorepo Actors before any write #1524

Description

@DaveHanns

Problem

apify push uploads the Actor folder. An Actor whose .actor/actor.json sets dockerContextDir above that folder (a monorepo Actor, as in apify/actor-monorepo-example) needs files the upload does not carry, so the platform build fails with Actor context path "../../.." is outside of Actor root directory!. With --force, the push first replaces a working Git source with that broken upload.

What we want

apify push reads dockerContextDir right after actor.json and, before the Actor lookup, the Git source question, or any write, decides what kind of push this is.

  • No dockerContextDir: an ordinary push, unchanged.
  • A context at or below the Actor folder, such as ".." or "../src": an ordinary push. Inside or outside is judged by the path as written, because push uploads a symlink's files under the link's own name.
  • A context beyond the Actor folder, inside the Git repository: refused with exit code 255 (NotImplemented), naming the Actor, linking the monorepo Epic, and pointing to a Git source with #branch:folder.
  • A value that is not a string, or a directory that is missing, is not a directory, lies outside the Git repository, or (outside Git) does not contain the Actor folder: exit code 5 (InvalidActorJson) with the reason.
  • The Actor folder is resolved from its real path, so a symlinked --dir behaves like the folder itself.
  • Messages go to stderr, so --json keeps stdout clean.

Out of scope

How it's tested

  • test/local/lib/docker-context.test.ts: every outcome, inside and outside Git, including symlinks.
  • test/local/commands/push-monorepo.test.ts: the refusal and both exit codes through the command, with a mocked client and no platform write.

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-buildersIssues owned by the Builders team.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions