Project

General

Profile

Actions

action #181781

open

coordination #127031: [saga][epic] openQA for SUSE customers

coordination #80150: [epic] Scale out openQA: Easier openQA setup

Better error handling when reading API key+secret from ~/.config/openqa/client.conf - take 2

Added by okurz 20 days ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Feature requests
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Motivation

Calling openqa-cli api can fail due to various ways of missing/invalid api&key combinations all leading to a not much helpful "no api key" message. We should provide better helps to the user what could be wrong, e.g. what keys openqa-cli is looking for and which have been found, what files were found, etc.

Acceptance criteria

  • AC1: openqa-cli api has significantly better error handling for missing/wrong API key+secret combinations, not just "no api key"
  • AC2: mentions in docs/Client.asciidoc are up-to-date

Acceptance tests

  • AT1-1: Given no file ~/.config/openqa/client.conf When openqa-cli api -X post comments is called Then a clear error message is given which files have been found And pointing to missing ~/.config/openqa/client.conf
  • AT1-2: Given an unreadable file ~/.config/openqa/client.conf When openqa-cli api -X post comments is called Then a clear error message is given about the unreadable file
  • AT1-3: TBD typo in section header, e.g. "locihost" instead of "localhost"
  • AT1-4: TBD wrong keys, e.g. "apikey" instead of "key"

Suggestions

  • The error "no api key" is returned by the server so one needs to either prevent calls or handle the error after receiving. We just try to call the server when we have not found api key&secret as the client can't know if API key and secret are needed but as the client gets the error response we could parse the JSON error context and give some hints

Related issues 1 (0 open1 closed)

Copied from openQA Project (public) - action #90038: Better error handling when reading API key+secret from ~/.config/openqa/client.confResolvedmkittler2021-03-12

Actions
Actions #1

Updated by okurz 20 days ago

  • Copied from action #90038: Better error handling when reading API key+secret from ~/.config/openqa/client.conf added
Actions

Also available in: Atom PDF