Bug 868736

Summary: copyTrans should only happen when pushing source strings
Product: [Retired] Zanata Reporter: Ding-Yi Chen <dchen>
Component: Component-MavenAssignee: Carlos Munoz <camunoz>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: unspecified    
Version: developmentCC: sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.8.0-SNAPSHOT (20121023-0030) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-07 06:19:09 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 Ding-Yi Chen 2012-10-22 01:51:09 UTC
Description of problem:
In present version, 
pushType source implies copyTrans on, while pushType=both or trans implies copyTrans off.

However, "[INFO] Copy previous translations: true" still appears even when pushType=trans. 
This message is misleading. Please either
1) Hide copyTrans status unless it is given in command line of setting files.
or
2) Actually contact server and return whether server is going to do the copyTrans

1) should be a simpler fix, and "copyTrans is not specified" implies "use server default", thus no further change is needed even when server default changed.

2) should give the users the clear message that how server actually behave, but need to consider the behavior changes in different server versions.


Version-Release number of selected component (if applicable):
Zanata version 1.8.0-SNAPSHOT (20121019-1428)
INFO] client API version: 1.8.0-SNAPSHOT, server API version: 1.8.0-SNAPSHOT 

How reproducible:
Always 

Steps to Reproduce:
1. Assume a project and version is created
2. mvn -e zanata:push -Dzanata.pushType=both
  
Actual results:
"[INFO] Copy previous translations: true" still appears even when pushType=trans. 

Expected results:
1) Hide copyTrans status unless it is given in command line of setting files.
or
2) Actually contact server and return whether server is going to do the copyTrans

Comment 1 Sean Flanigan 2012-10-22 02:04:34 UTC
> pushType source implies copyTrans on, while pushType=both or trans implies copyTrans off

Not quite, but copyTrans only makes sense when pushing source strings.

If the source is being pushed (ie pushType=both or pushType=source), copyTrans should be enabled.  If only the translations are pushed, copyTrans is irrelevant.

When pushType=trans, we should (a) not ask the server to perform copyTrans, and (b) the log message should say something like "Copy previous translations: disabled since pushType=trans".  

This will make the copyTrans behaviour similar to Zanata 1.7, which only requests copyTrans when pushing source documents (since copyTrans used to be an option of putTranslations, not a separate REST API feature).

Comment 2 Carlos Munoz 2012-10-22 03:49:34 UTC
Copy trans should only happen now when pushing source files (pushType = 'source' or 'both').

In case the copy Trans option is specified, but only translations are pushed, the client will disable copy trans and will inform the user in the initial confirmation message.

See:
https://github.com/zanata/zanata-client/commit/5079efb86b1fada007d7df22f5cf8856550b9c7e

Comment 3 Ding-Yi Chen 2012-10-23 01:02:54 UTC
VERIFIED with Zanata version 1.8.0-SNAPSHOT (20121023-0030)
client API version: 1.8.0-SNAPSHOT, server API version: 1.8.0-SNAPSHOT

Comment 4 Sean Flanigan 2012-11-07 06:19:09 UTC
Fix released in Zanata 2.0.