Skip to content

A silent failure occurs if a file path listed in filePushOrder does not exist #984

Description

@aviflax

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

If a file path listed in filePushOrder does not exist, I would expect clasp push to fail with a clear error message.

Actual Behavior

It just skips the missing file and continues as if nothing went wrong.

Steps to Reproduce the Problem

  1. Add a path to a non-existing file to filePushOrder
  2. Run clasp push
  3. Observe that the output to stdout and stderr includes no error message about the non-existing file path
  4. Run echo $?
    1. Observe that the exit code of clasp push is 0 but should have been non-zero.

Specifications

  • Node version (node -v): v20.8.1
  • Version (clasp -v): 2.4.2
  • OS (Mac/Linux/Windows): macOS 13.6 22G120

Activity

  1. Nu11u5 commented on Nov 2, 2023

    @Nu11u5
    Contributor

    I think this could be a warning, rather than an error that cancels the push and raises the exit code. If the file is no longer part of the project, that suggests it's not needed anymore.

  2. aviflax commented on Nov 2, 2023

    @aviflax
    Author

    Could be, sure. But on the other hand, there’s the case of typos. In my case, I was trying to fix an intermittent problem with a program that seemed to be caused by race conditions in code loading. I thought it might help to have a certain file pushed first, before all the rest. So I added this key to the config file and pushed, and… no change.

    Weeks later I double checked and realized I had a missing character in the file name, the result of a typo. So my attempted fix had never actually taken effect, and since clasp had (IMO) failed silently, it took me a long time to find out about it.

    Personally I prefer tools to fail fast and fail loudly, any time they cannot accomplish exactly what I’ve asked them to do.

  3. dandv commented on Jan 30, 2025

    @dandv
    Contributor

    Still seeing this for nonexistent files in filePushOrder with v2.5.0.

  4. sqrrrl commented on Mar 12, 2025

    @sqrrrl
    Member

    Leaving as is for now. The push order isn't meant to be authoritative, rather meant as way to override the natural sort order. Think of it more of a way to hint at the priority of files -- if you want one file to always be first, just list that one file, everything else will get sorted after that.

    Making that list authoritative may lead to a worse UX such as when refactoring/renaming files. It's an extra step to have to update .clasp.json each time a file is renamed or deleted.

    Looking at adding a warning though for next release

  5. added this to the 3.0 milestone on Mar 12, 2025
  6. added theissue type on Mar 19, 2025
  7. gunjanjaswal commented on Jul 1, 2026

    @gunjanjaswal

    Opened #1159 for this. checkMissingFilesFromPushOrder already computed the missing entries but was never called and never returned them, so the missing file was silently skipped. The PR returns the list, checks it in push() before uploading, and throws with a non-zero exit when a filePushOrder path has no local file. Added a test for the missing-file case.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions