Skip to content

fix(check-update): always show error when check-update fails

Jay McCure requested to merge jmc-show-update-err into main

Description

This MR does two things:

  1. If check_update is configured to true it will run after every command. If it failed the error was previously hidden, this MR changes the behaviour so the error is always displayed. For example, in #1336, a user could not connect to gitlab.com but check_update was always running after each command and would silently failing after 30 seconds due to a timeout. This is intended to help self-managed users diagnose this problem when they cannot connect to gitlab.com. Since the error is hidden it just seems like glab is very slow.
  2. No longer runs check-update if check-update was explicitly run by the user. #1277 (closed)

Related Issues

Resolves #1277 (closed)

Related to #1336

How has this been tested?

check_update=true & glab is not the latest version

Before After
Screenshot_2023-06-06_at_16.18.08 Screenshot_2023-06-06_at_16.15.07

check_update=true & glab is the latest version (no change)

Before After
Screenshot_2023-06-07_at_16.01.16 Screenshot_2023-06-07_at_15.57.56

check_update=true & no connection to gitlab.com

Before - freezes for 5 seconds and no error After - freezes for 5 seconds and error
Screenshot_2023-06-06_at_16.22.33 Screenshot_2023-06-06_at_16.22.13

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Jay McCure

Merge request reports