Repository navigation
Conversation
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 pushat the root of a repository with Actors in subfolders (such asapify/actor-monorepo-example) stopped withA valid Actor could not be foundand exit code 4, so pushing several Actors meant one invocation per folder. Now, when the resolved directory has no Actor config of its own but directories below it do, the command lists them and pushes what the user chose, one ordinary push per Actor, in sequence. A directory with its own config is pushed exactly as before.Closes #1499. Part of apify/apify-core#28685.
Stacked on the preflight PR (#1502, branch
feat/push-monorepo-preflight), so the per-Actor push it wraps already contains thedockerContextDirresolver.Changes
src/commands/actors/push.ts: the single-Actor body moved intopushActor(dir)unchanged (same checks, exit codes, and--jsonenvelope);run()enters selection mode only when the existing exit-4 check would fail andfindActorDirsfinds Actors below.--all, or a repeatable--actor-dir <path>relative to the root (exclusive with--all). With neither flag, a multi-select prompt on stderr when stdin is a TTY andci-infodetects no CI; otherwise the listing (path andname) goes to stderr withChoose what to push: --all, or --actor-dir <path> for each Actor.and the command exits 4 before the login check, even for one Actor.actorIdwith more than one selected Actor exits 5 (InvalidInput). Pushes run in path order; a failure does not stop the rest, and the exit code is that of the first failed Actor.--version,--build-tag, and the other flags apply to every push.--jsonfrom a root without its own config prints one document{ok, operation: "push", results: [{dir, ...single push result}], exitCode?}; an Actor that stopped before a build gets{dir, ok: false, exitCode}. Nothing else reaches stdout.src/lib/find-actor-dirs.ts: finds every directory below the root with.actor/actor.json, sorted by path with/separators, skipping the hard-coded ignores ofgetActorLocalFilePaths(now exported asACTOR_FILES_HARDCODED_IGNORE) and never descending below a found Actor.src/lib/utils/inquirer/checkboxImpl.tsanduseMultiSelectFromList: a multi-select prompt built on@inquirer/corenext toconfirmImpl.ts, wrapped bystdinCheckWrapper. No new dependency, so no install-size change.Flags.string({ multiple: true })keeps every value of a repeated flag asstring[]; other flags still getcan only be specified once.docs/reference.mdregenerated withpnpm run update-docs.Tests
test/local/commands/push-select.test.ts(mocked client, modeled onpush-git-source.test.ts): every acceptance criterion of the issue,--versionand--build-tagreaching each version payload, oneFAILEDbuild amongSUCCEEDEDones (exit 1, per-entryexitCode), an Actor that throws before its build (the rest still pushed), a mocked prompt returning an empty selection, a root without Actors below keeping the exit-4 behavior, and a single-folder Actor unchanged in--json.test/local/lib/find-actor-dirs.test.ts: skipped folders, no descent below an Actor, sort order, names, and/separators.test/local/lib/command-framework/multiple-flag.test.ts: repeated, single, and omitted values of amultipleflag, and the unchanged rejection for a plain flag.test/e2e/commands/push-select.test.tsthroughdist/apify.js: the listing with exit 4 and no token,--actor-dirto a non-Actor folder with exit 4, and--actor-dirto a folder outside the root with exit 4 and an empty stdout under--json.pnpm run lint,pnpm run format,pnpm run build, andpnpm run test:local(777 passed). The two failures are the[python]fixtures (python_supportcreates no.venv,spaces in path to actorwrites noOUTPUT), which fail the same way on the base branch in this environment, so they are unrelated.results: [], exit 0).[api]case from the issue (two single-folder Actors with--all --json) needsTEST_USER_TOKEN, so it is not included; it is a follow-up for thetest/api/commands/push.test.tssuite.Notes for reviewers
.actor/actor.json,actor.json, or the legacyapify.json), so a root that has its own config never enters selection mode, and a root without Actors below keeps today's error.--actor-dirvalues are normalized (./actors/a/becomesactors/a) and deduplicated; a value that resolves outside the root (../other, an absolute path elsewhere) or without a readable.actor/actor.jsonexits 4 before the login check.readdirentries that are directories, so a symlink to a directory is not followed (no cycles); such an Actor can still be named with--actor-dir.--jsonmode (no choice made, bad--actor-dir) nothing is printed on stdout, matching the single-Actor behavior for failures before a push. The results document is printed whenever a selection was made, including an empty one from the prompt.exitCode: 1and the loop continues; a single up-front check would have changed the--jsonoutput of that case.multipleis meant for plain string flags; it is not combined withchoicesanywhere, and the choices check does not handle arrays..nvmrcpins 24.21.0;enginesis>=22).🤖 Generated with Claude Code