Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print error when unzipping fails to save a file #235

Merged
merged 2 commits into from
Mar 3, 2022

Conversation

chapulina
Copy link
Contributor

🦟 Bug fix

Summary

While reviewing gazebosim/gz-sim#1262, some files were failing to download, but I was getting success messages. This PR just makes sure that a success message isn't printed on failure.

Before this PR we get false positives:

$ ign fuel download -v 4 --url "https://fuel.ignitionrobotics.org/1.0/jennuine/models/Monterey Bay"          
Downloading model:                                                                                                                          
  Name: monterey bay                                                                                                                          Owner: jennuine                                                                                                                           
  Server:                                                                                                                                   
    URL: https://fuel.ignitionrobotics.org                                                                                                  
    Version: 1.0                                                                                                                            
                                                                                                                                            
[Msg] Downloading model [https://fuel.ignitionrobotics.org/jennuine/models/monterey bay]                                                    
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/dem/]              
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/dem/monterey_bay_gebco_2021.tif]                                                                                                                               
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/]        
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/textures/]                                                                                                                                           
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/textures/monterey_bay_gebco_2021_colormap.png] 
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/textures/monterey_bay_gebco_2021_relief.png] 
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/model.config]                                                                                                       
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/model.sdf]                                                                                                      
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/thumbnails/]       
[Dbg] [Zip.cc:176] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/thumbnails/1.png] 

After:

$ ign fuel download -v 4 --url "https://fuel.ignitionrobotics.org/1.0/jennuine/models/Monterey Bay"
Downloading model: 
  Name: monterey bay
  Owner: jennuine
  Server:
    URL: https://fuel.ignitionrobotics.org
    Version: 1.0

[Msg] Downloading model [https://fuel.ignitionrobotics.org/jennuine/models/monterey bay]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/dem/]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/dem/monterey_bay_gebco_2021.tif]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/textures/]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/textures/monterey_bay_gebco_2021_colormap.png]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/materials/textures/monterey_bay_gebco_2021_relief.png]
[Dbg] [Zip.cc:179] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/model.config]
[Dbg] [Zip.cc:179] Created file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/model.sdf]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/thumbnails/]
[Err] [Zip.cc:175] Failed to write file [/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/jennuine/models/monterey bay/2/thumbnails/1.png]
Download succeeded.

PS: The issue downloading these files on Garden should be fixed by gazebosim/gz-common#308

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina requested a review from nkoenig as a code owner March 3, 2022 17:25
@github-actions github-actions bot added Gazebo 1️1️ Dependency of Gazebo classic version 11 🏰 citadel Ignition Citadel labels Mar 3, 2022
@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #235 (a42fd16) into ign-fuel-tools4 (ae90993) will increase coverage by 0.02%.
The diff coverage is 75.00%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           ign-fuel-tools4     #235      +/-   ##
===================================================
+ Coverage            77.90%   77.92%   +0.02%     
===================================================
  Files                   19       19              
  Lines                 2715     2718       +3     
===================================================
+ Hits                  2115     2118       +3     
  Misses                 600      600              
Impacted Files Coverage Δ
src/Zip.cc 69.87% <75.00%> (+1.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae90993...a42fd16. Read the comment docs.

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina enabled auto-merge (squash) March 3, 2022 17:51
@chapulina chapulina merged commit add1647 into ign-fuel-tools4 Mar 3, 2022
@chapulina chapulina deleted the chapulina/4/zip_err branch March 3, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel Gazebo 1️1️ Dependency of Gazebo classic version 11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants