Skip to content

feat: let apify push select which Actors to push in a repository with several - #1504

Open
DaveHanns wants to merge 38 commits into
masterfrom
feat/push-select-actors
Open

DaveHanns wants to merge 38 commits into
masterfrom
feat/push-select-actors

Conversation

@DaveHanns

@DaveHanns DaveHanns commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

apify push at the root of a repository with Actors in subfolders stopped with exit 4, so pushing several Actors meant one invocation per folder. Now, when the directory has no config file of its own but directories below it hold Actors, the command lists them and pushes the chosen ones, one ordinary push per Actor, in sequence. A directory with its own config is pushed as before.

Closes #1499. Part of apify/apify-core#28685. Stacked on #1502 (feat/push-monorepo-preflight).

Changes

  • Selection mode starts when none of .actor/actor.json, actor.json, or apify.json is in the directory itself; a root .actorignore or a .actor/ folder with only shared files does not count.
  • --all pushes every Actor found below the root; a repeatable --actor-dir <path> (relative to the root, exclusive with --all) pushes the named ones. Both are pushed in path order. Without a flag, a multi-select prompt opens on a TTY outside CI; otherwise the listing goes to stderr with a hint and the command exits 4 before the login check.
  • --all or --actor-dir in a directory that is an Actor itself exits 5. --actor-dir also works when discovery finds nothing (a symlinked Actor, one inside an ignored folder).
  • Discovery skips the names getActorLocalFilePaths always ignores at every depth, does not follow symlinks or descend below a found Actor, and skips directories it cannot read.
  • A failure does not stop the pushes after it; the exit code is that of the first failed Actor. A signal during a build wait aborts that build as before and then stops the loop, naming the Actors not pushed. A signal anywhere else ends the process as it does today, after naming the Actors not pushed; Ctrl+C at the Git-source question stops the loop.
  • A declined Git-source switch becomes {dir, ok: false, skipped: true} with no exit code and does not fail the run.
  • --json prints one document {ok, operation: "push", results: [{dir, ...single push result}], exitCode?} once a selection was made, also an empty one; ok is true when every entry is ok or skipped. On the exit-4 and exit-5 paths before a selection nothing is printed on stdout. The positional actorId applies to a single selected Actor only (exit 5 otherwise).
  • Telemetry records pushSelection: {selected, failed}.
  • Flags.string({ multiple: true }) keeps every value as string[], strips the short-form = from each, and validates each against choices.
  • The multi-select prompt is @inquirer/checkbox. Install size: the package adds 36 KB on disk (about 22 KB unpacked); its dependencies (@inquirer/core, ansi, figures, and type) are already installed for the select prompt.

Tests

  • Local: the gate, the flags in an Actor directory, a symlinked --actor-dir, path order, failures mid-loop, the skipped entry, a signal during and outside a build wait, Ctrl+C at a prompt, the --json contract, discovery with an unreadable subdirectory and a missing root, the = strip and choices of multiple flags.
  • E2E: the exit-4 listing, both --actor-dir rejections, --all with --actor-dir.
  • [api]: two single-folder Actors with --all --json yield two SUCCEEDED entries (runs in CI).

Notes for reviewers

  • The prompt is the upstream @inquirer/checkbox; the push tests mock it, and a pseudo-terminal run confirmed the listing, the toggle, and an empty selection exiting 0.
  • Outside a build wait the loop's listener writes the not-pushed list (and, with --json, {ok: false, operation: "push", results} with the pushes so far) synchronously, removes itself and raises the signal again, so Node's default action ends the process with the same status as today.

🤖 Generated with Claude Code

…r push

The loop-level listener kept a signal from terminating the CLI anywhere in the selection, so a Ctrl+C during an upload let the current push run on. Outside a build wait the listener now names the Actors not pushed (and, with --json, prints the results so far), removes itself and raises the signal again, so Node's default action ends the process as it does for a single Actor. During a build wait the build is still aborted and the loop stops after it.
Ctrl+C at the Git-source question rejects the prompt, which ends a single push. In the loop the error was caught and the next Actor was pushed; the loop now stops and names the Actors not pushed.
@DaveHanns
DaveHanns marked this pull request as ready for review October 26, 2026 15:18

@apify-factory apify-factory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nothing blocking.

🏭 Factory review — ℹ️ not auto-approved

This change was reviewed but cannot be auto-approved: a gate failed, so the review cannot end in an approval.

check result
Static gates ❌ 13/16 — base-branch, max-files, max-lines
Review findings ✅ none
Reviewer escalation ❌ Adds new public CLI flags and a new --json output shape for apify push, changes the shared flag parser, and re-raises interrupt signals to end the process, so a person should confirm the contract and process-lifecycle changes.
Juror 1 — claude-sonnet-5-5, adversarial ⏭️ skipped — a gate failed
Why it was not auto-approved

Failed gates:

  • base-branch: base is feat/push-monorepo-preflight, required master
  • max-files: 16 changed files, limit 10
  • max-lines: 1508 changed lines (+1467/-41), limit 200

The comments above are the review itself; this section only explains the approval decision. Push a change and request @apify-factory again to re-run it, or ask a human to review.

Reviewed 824615776 · workflow run

@apify-factory apify-factory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nothing blocking.

@DaveHanns DaveHanns linked an issue Oct 27, 2026 that may be closed by this pull request
7 tasks
Base automatically changed from feat/push-monorepo-preflight to master October 27, 2026 15:04
…tors

# Conflicts:
#	src/commands/actors/push.ts
#	src/lib/hooks/telemetry/trackEvent.ts
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 27, 2026
@apify-service-account apify-service-account added the t-builders Issues owned by the Builders team. label Oct 27, 2026

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-builders Issues owned by the Builders team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apify push: select which Actors to push in a repository with several

3 participants