feat(push): add final status block and structured JSON output#1199
Conversation
Rework the end of `apify push` so agents can distinguish source-upload success from final cloud-build success (#1136). - `apify push` prints a final result block (result, upload, build, IDs, URLs, exit code, and a failure reason log tail). - `apify push --json` returns a structured result object with `ok`, `operation`, `actor`, `build`, optional `error`, and `exitCode`. - Failed, timed-out, and aborted builds return non-zero exit codes; `ok` mirrors command success. Closes #1136 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…son-output-for-agents2
…son-output-for-agents2
…son-output-for-agents2
| } else { | ||
| error({ message: 'Build failed!' }); | ||
| process.exitCode = CommandExitCodes.BuildFailed; | ||
| const lines = [ |
There was a problem hiding this comment.
Q: do we already implement same style logging in case the upload itself fails?
There was a problem hiding this comment.
not now, It is not so big change but I would like to merge this PR and do it in followup, upload fails should not be common if platform is not in some serious problems (or user is in some isolated env).
There was a problem hiding this comment.
Makes sense 👍 You can either use the same issue (in that case don't close it with this PR) or create a new one for that once you tackle it.
DaveHanns
left a comment
There was a problem hiding this comment.
Few nits and suggestions. Otherwise looks good.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…atus-and-json-output-for-agents2' into 1136-improve-apify-push-final-status-and-json-output-for-agents2
improves type clarity and maintainability. addresses #1211.
| } else { | ||
| error({ message: 'Build failed!' }); | ||
| process.exitCode = CommandExitCodes.BuildFailed; | ||
| const lines = [ |
There was a problem hiding this comment.
not now, It is not so big change but I would like to merge this PR and do it in followup, upload fails should not be common if platform is not in some serious problems (or user is in some isolated env).
…son-output-for-agents2
Covers the status-mapping contract introduced by the new push status block / JSON output
FAILED, and the unknown-status fallthrough. Plus an assertion that errorMessage is present on failures and absent on success/running.
Closes #1136