CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
407 stars 232 forks source link

Suppress errors on local execute for configuration features unsupported in local mode #263

Open philoserf opened 5 years ago

philoserf commented 5 years ago

There are other related issues. Most seem to request a new feature to support these unsupported actions. This issue is different in that it requests that the error be suppressed on local execute.

Do you want to request a feature or report a bug?: feature

What is the current behavior?: circleci local execute exits with a none zero exit code and logs an error when encountering configuration features that are not supported in local mode.

Can you provide an example?

With file `.circleci/config.yaml having the following content:

version: 2.0
jobs:
  test:
    docker:
      - image: example
    steps:
      - checkout
      - run: mkdir test-results
      - store_test_results:
          path: test-results

workflows:
  version: 2
  test:
    jobs:
      - test

run circleci local execute --job test

The results of the failing store_test_results step are as follows:

====>> Uploading test results
Archiving the following test results
  * /root/project/test-results

Error: Failed uploading test results directory
Error &errors.errorString{s:"not supported"}

{"Runner":true,"level":"error","msg":"Can't add file ///root/project/test-results to tar: io: read/write on closed pipe","task-id":"localbuild-1546999351","time":"2019-01-09T02:03:07Z"}

and the process exits with a non-zero exit code.

What is the expected behavior?

With the same configuration file content running circleci local execute --job test would resulting in something simular to the following:

====>> Uploading test results
Archiving the following test results
  * /root/project/test-results

Warning: Failed uploading test results directory. This configuration is not supported in local mode.
Warning &errors.errorString{s:"not supported"}

{"Runner":true,"level":"warning","msg":"Can't add file ///root/project/test-results to tar: io: read/write on closed pipe","task-id":"localbuild-1546999351","time":"2019-01-09T02:03:07Z"}

Which version of the CLI and OS are you using? Did this work in previous versions?

circleci version: 0.1.4786 macos version: 10.14.2

Please provide the output of circleci version and circleci diagnostic.

$ circleci diagnostic

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/mark/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API...
Ok.

If you have any questions, feel free to ping us at @CircleCI-Public/dx-clients.

philoserf commented 5 years ago

The same warning/exit-code zero should apply to other artifact handling actions that are not supported in local mode.

eric-hu commented 5 years ago

Thank you for filing this issue! Converting the errors to warnings is a very reasonable request. I've created an internal ticket for us to track this work.

(Link for CircleCI devs: https://circleci.atlassian.net/browse/CIRCLE-15697 )

marcomorain commented 4 years ago

cc @KunalJain