ncbo / ontologies_linked_data

Models and serializers for ontologies and related artifacts backed by 4store
Other
17 stars 8 forks source link

Fix gzip support #172

Closed alexskr closed 10 months ago

alexskr commented 10 months ago

follow up on https://github.com/ncbo/ontologies_linked_data/pull/144

when I upload a new submission with a .gz file I get the following error:

- Zip::Error - Zip end of central directory signature not found:
        /srv/ontoportal/ontologies_api/shared/bundle/ruby/2.7.0/gems/rubyzip-2.3.2/lib/zip/central_directory.rb:143:in `get_e_o_c_d'
 ...
        /srv/ontoportal/ontologies_api/shared/bundle/ruby/2.7.0/bundler/gems/ontologies_linked_data-e33a0e451f8a/lib/ontologies_linked_data/utils/file.rb:33:in `files_from_zip'
        /srv/ontoportal/ontologies_api/shared/bundle/ruby/2.7.0/bundler/gems/ontologies_linked_data-e33a0e451f8a/lib/ontologies_linked_data/models/ontology_submission.rb:209:in `sanity_check'
        /srv/ontoportal/ontologies_api/shared/bundle/ruby/2.7.0/bundler/gems/ontologies_linked_data-e33a0e451f8a/lib/ontologies_linked_data/models/ontology_submission.rb:146:in `valid?'
        /srv/ontoportal/ontologies_api/releases/20230908165536/helpers/ontology_helper.rb:27:in `create_submission'
        /srv/ontoportal/ontologies_api/releases/20230908165536/controllers/ontology_submissions_controller.rb:14:in `block in <class:OntologySubmissionsController>'

this PR:

codecov[bot] commented 10 months ago

Codecov Report

Merging #172 (5ddd9ae) into develop (e33a0e4) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 5ddd9ae differs from pull request most recent head 4f9fcd3. Consider uploading reports for the commit 4f9fcd3 to get more accurate results

@@           Coverage Diff            @@
##           develop     #172   +/-   ##
========================================
  Coverage    80.75%   80.75%           
========================================
  Files           63       63           
  Lines         4901     4901           
========================================
  Hits          3958     3958           
  Misses         943      943           
Flag Coverage Δ
unittests 80.75% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
lib/ontologies_linked_data/utils/file.rb 72.89% <100.00%> (ø)
alexskr commented 10 months ago

sanity_check doesn't handle gzipped files yet.

3) Error:
TestOntologySubmission#test_valid_ontology:
Zip::Error: Zip end of central directory signature not found
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/central_directory.rb:143:in `get_e_o_c_d'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/central_directory.rb:103:in `read_e_o_c_d'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/central_directory.rb:136:in `read_from_stream'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/file.rb:82:in `block in initialize'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/file.rb:81:in `open'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/file.rb:81:in `initialize'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/file.rb:111:in `new'
    /srv/ontoportal/bundle/ruby/2.7.0/gems/rubyzip-1.3.0/lib/zip/file.rb:111:in `open'
    /srv/ontoportal/ontologies_linked_data/lib/ontologies_linked_data/utils/file.rb:33:in `files_from_zip'
    /srv/ontoportal/ontologies_linked_data/lib/ontologies_linked_data/models/ontology_submission.rb:209:in `sanity_check'
    /srv/ontoportal/ontologies_linked_data/lib/ontologies_linked_data/models/ontology_submission.rb:146:in `valid?'
    /srv/ontoportal/ontologies_linked_data/test/models/test_ontology_submission.rb:36:in `test_valid_ontology'