Bug 1002396

Summary: Some minor usability issues in zanata-cli pull
Product: [Retired] Zanata Reporter: Damian Jansen <djansen>
Component: Component-zanata-client-ivyAssignee: Sean Flanigan <sflaniga>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-31 01:21:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Damian Jansen 2013-08-29 06:13:23 UTC
1. zanata-cli --help pull doesn't indicate src-dir is required
2. it should - if possible - validate the required parameters before checking dependencies, to fail fast
3. Are you sure? (y/n) - the n should be N as it's the default

Comment 1 Sean Flanigan 2013-08-29 07:16:50 UTC
Regarding #1, with the latest version of client (3.1.1) there is actually a very subtle hint that --src-dir (-s) is required: unlike most of the other options, it is not surrounded by square brackets on the usage line at the top.  But I agree that it is not enough!

We could probably do something with reflection to enhance the option descriptions and make it clearer which options are required, but honestly we would probably be better off making all of our options actually optional.  After all, there is no reason to force the user to specify src-dir unless we are pulling source documents.

Also, getting useful help when a required option is missing is difficult with Args4j due to https://java.net/jira/browse/ARGS4J-14   We have a workaround, but there are some cases we don't handle.  If the options weren't required, we wouldn't need the workaround.

Damian, can you expand on #2?

Comment 2 Damian Jansen 2013-08-30 00:30:19 UTC
Re #2 - it takes a good few seconds to check the ivy dependencies before failing with "you forgot option x". It can be a tad annoying to do this a couple of times.

If the script can immediately recognise that the user has omitted an necessary switch then it can just bail out before the wait.

Comment 3 Sean Flanigan 2013-09-02 02:37:17 UTC
(In reply to Damian Jansen from comment #2)
> Re #2 - it takes a good few seconds to check the ivy dependencies before
> failing with "you forgot option x". It can be a tad annoying to do this a
> couple of times.

A good few seconds?  It runs faster than I expected, but perhaps that's just because I expected it to take a little while.  It's definitely slower than I would prefer.  (And the first invocation of the day isn't as fast as the subsequent runs.)
 
> If the script can immediately recognise that the user has omitted an
> necessary switch then it can just bail out before the wait.

It can't really do that, because those dependencies (some of them, and we can't be selective) are needed to execute the Java code which checks the options.

I have changed the shell script so that it lets Ivy cache the resolution results.   The first invocation should be a little faster, assuming the dependencies have been fetched before.  Try zanata-cli-3.1.1-ivy-2.

Comment 4 Zanata Migrator 2015-07-31 01:21:19 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-450