Skip to content

ntk push exits successfully after an upload fails #29

Description

@next-devin

What happens now

If an upload fails during ntk push, ntk prints the API error and stops uploading files.

The command still exits with status 0. Shell scripts, CI jobs, and agents therefore treat the push as successful.

How to reproduce

  1. Run ntk push with at least two files and an invalid or expired API key.
  2. The first upload fails.
  3. The second file is not attempted.
  4. Run echo $?.

The exit status is 0 even though the push failed.

The same behavior can be reproduced in a test by returning a failed response for the first file. Only one upload is attempted, and the command finishes normally.

What should happen

Keep the current stop-on-first-failure behavior for now.

When an upload fails, ntk should:

  • stop the push;
  • print the name of the failed file;
  • print how many files were uploaded and how many were not attempted;
  • exit with a non-zero status.

If every file uploads successfully, the command should exit with status 0.

Whether ntk should continue after some types of file error is a separate decision. This issue does not change pull or watch.

Done when

  • A failed upload causes ntk push to exit with a non-zero status.
  • The output names the failed file and reports how much work was completed.
  • Files after the failed upload are not attempted.
  • A successful push still exits with status 0.
  • Tests cover successful and failed pushes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions