Project

General

Profile

action #62600

Improve error output when calling openqa-clone-custom-git-refspec with wrong args, not just exit code

Added by tinita over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2020-01-23
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Motivation

When options like --apikey are passed as the first arguments, the script does not output anything and exits with 3:

% openqa-clone-custom-git-refspec --apikey aaaa --apisecret aaaa  https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/9407 https://openqa.suse.de/tests/3817935
% echo $?
3

That's not very helpful.

openqa-clone-custom-git-refspec should have helpful messages on error and also --help.

Acceptance criteria

  • AC1: openqa-clone-custom-git-refspec has an option --help showing help text
  • AC2: openqa-clone-custom-git-refspec shows error messages telling the user what went wrong when wrong parameters have been used

Related issues

Related to openQA Project - coordination #58184: [saga][epic][use case] full version control awareness within openQA, e.g. user forks and branches, fully versioned test schedules and configuration settingsBlocked2018-03-23

History

#1 Updated by tinita over 1 year ago

  • Description updated (diff)

#2 Updated by okurz over 1 year ago

  • Category changed from Concrete Bugs to Feature requests

that's not a regression though :) So we should regard as "Feature request".

#3 Updated by okurz over 1 year ago

  • Subject changed from Calling openqa-clone-custom-git-refspec with wrong args leads to error and no output to Improve error output when calling openqa-clone-custom-git-refspec with wrong args, not just exit code
  • Description updated (diff)
  • Target version set to future

Hi tinita, I rewrote the ticket into a feature request according to https://progress.opensuse.org/projects/openqav3/wiki#Feature-requests . I hope I have preserved your initial intention. However I see the ticket of low prio as IMHO we should not invest reasonably more effort into a script which basically serves as a proof of concept for the time being and we plan to make openQA fully VCS aware in #58184 (first).

#4 Updated by okurz over 1 year ago

  • Related to coordination #58184: [saga][epic][use case] full version control awareness within openQA, e.g. user forks and branches, fully versioned test schedules and configuration settings added

#5 Updated by okurz over 1 year ago

  • Status changed from New to Feedback
  • Assignee set to okurz

good as a weekend time GNU getopt reminder refreshment task :)

https://github.com/os-autoinst/openQA/pull/2702

#6 Updated by okurz over 1 year ago

  • Status changed from Feedback to Resolved

merged.

#7 Updated by ggardet_arm over 1 year ago

  • Status changed from Resolved to Workable

You should white list all the openqa-clone-job args (--apikey, --skip-download, etc.) as it is just a wrapper.

#8 Updated by okurz over 1 year ago

  • Status changed from Workable to Feedback

Actually the most common use case I found so far was for people manually supplying api key and secret in commands which I consider a bad practice. But anyway, https://github.com/os-autoinst/openQA/pull/2810 adds an argument which allows to pass additional arguments to the internal clone command. This I consider sufficient. I did not want to duplicate all potential parameters into the script for a "whitelist" and also I did not find a good way to simply pass all unknown parameters further so this is the approach I opted for.

#9 Updated by okurz over 1 year ago

  • Status changed from Feedback to Resolved

merged and available in packages.

Also available in: Atom PDF