openfaas / openfaas/faas-cli

[Suggestion] Suppress error output when GitHub version check fails

Open
#874 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

Expected Behaviour

The faas-cli failing to check whether it is the latest version does not affect the operation of the downloaded binary. If an error is encountered encourage the user to check manually, rather than distracting them with a verbose error message.

Current Behaviour

$ faas version
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  2cec97955a254358de5443987bedf8ceee272cf8
 version: 0.13.9
Unable to find latest version online error: Head "https://github.com/openfaas/faas-cli/releases/latest": dial tcp 127.0.0.1:443: connect: connection refused

This is a forced error, so somewhat contrived, however a screenshot from a user is shown below:
image

Possible Solution

Suppress the error emitted here, or add additional detail to explain that the user can check by browsing to https://github.com/openfaas/faas-cli/releases/latest

https://github.com/openfaas/faas-cli/blob/7de6613ff8fcfa16961fec6b8a00408650a843ec/commands/version.go#L71

Context

Supporting a new user on Slack who on seeing the error thought they had encountered an error, effectively on step 1. By providing a more human message this false barrier to entry is removed.

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):
faas version
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  2cec97955a254358de5443987bedf8ceee272cf8
 version: 0.13.9
  • Docker version ( Full output from: docker version ):
    n/a
  • Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)?
    n/a
  • Operating System and version (e.g. Linux, Windows, MacOS):
    MacOS
  • Link to your project or a code example to reproduce issue:
    n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in commands/version.go at the version-checking code linked in the issue, then run faas version with the online version check failing. Done means the command no longer emits a verbose error for this non-critical failure and instead provides a clear manual-check message, if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.