• Mustafa Emre Acer's avatar
    Revert "Support grdp files in translation screenshot presubmit" · 36eaad53
    Mustafa Emre Acer authored
    This reverts commit 2308d074.
    
    Reason for revert: This broke `git cl upload` with string changes.
    
    Original change's description:
    > Support grdp files in translation screenshot presubmit
    > 
    > Translation screenshots project requires Chrome devs to upload UI
    > screenshots along with string changes in .grd and .grdp files. These
    > are XML files containing all user visible strings in Chrome.
    > 
    > Translation screenshots has a presubmit checks that extracts the
    > list of modified strings, looks for image files associated with these
    > strings and warns the developer to add them if they are missing.
    > 
    > This presubmit parses .grds to extract the list of modified strings but
    > it skips <part> tags which are used to reference .grdp files. As a
    > result, the presubmit currently ignores string changes in .grdp files.
    > .grdp files contain the majority of UI strings in Chrome, so the lack of
    > presubmit checks for them results in low translation screenshot coverage.
    > 
    > This CL changes how .grdp files are loaded in the presubmit: Previously,
    > they were written in a temporary directory alongside a fake .grd file
    > that referenced the loaded .grdp file. The code loaded the fake .grd file
    > which resulted in loading the strings in the actual .grdp file. However,
    > test mocks override all os.path methods which in turn breaks temporary
    > directory creation. As a result, it was not possible to properly test
    > the .grdp loading code, so we skipped <part> tags as a workaround.
    > 
    > The new loading code writes a temporary copy of the .grdp file and wraps
    > its contents with proper tags so that it can be loaded as a .grd file
    > instead. This avoids the need to create a temporary directory and is
    > fully testable.
    > 
    > The end result is that Translation Screenshots presubmit will now ask
    > Chrome devs to upload screenshots for changes in .grdp files. This should
    > significantly increase the coverage of strings with translation screenshots,
    > leading to better quality in string localizations.
    > 
    > Bug: 924652
    > Change-Id: Iae7933e8147cefdabc15ef21d2b6daa43d5002bc
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875554
    > Reviewed-by: anthonyvd <anthonyvd@chromium.org>
    > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
    > Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#714550}
    
    TBR=meacer@chromium.org,anthonyvd@chromium.org,jochen@chromium.org
    
    Change-Id: I1a6ee198b1dd76e84bcf962cd2396f4d00c5c126
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 924652
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913564Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
    Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#714712}
    36eaad53
PRESUBMIT.py 170 KB