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

Random failure on CI #266

Closed
tagliala opened this issue Oct 11, 2024 · 3 comments
Closed

Random failure on CI #266

tagliala opened this issue Oct 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tagliala
Copy link
Contributor

Ref: https://github.com/igorkasyanchuk/active_storage_validations/actions/runs/11288843453/job/31397452279?pr=265#step:7:141

Got it on both 7.2/vips and 7.0 mini_magick

Error:
ActiveStorageValidations::Test#test_dimensions_with_attached_StringIO:
Errno::ENOENT: No such file or directory @ rb_file_s_size - /tmp/image_1920x108020241011-2769-7xqr6w.png
    vendor/bundle/ruby/3.3.0/gems/mini_magick-5.0.1/lib/mini_magick/image/info.rb:51:in `size'
    vendor/bundle/ruby/3.3.0/gems/mini_magick-5.0.1/lib/mini_magick/image/info.rb:51:in `block in cheap_info'
    vendor/bundle/ruby/3.3.0/gems/mini_magick-5.0.1/lib/mini_magick/image/info.rb:40:in `fetch'
    vendor/bundle/ruby/3.3.0/gems/mini_magick-5.0.1/lib/mini_magick/image/info.rb:40:in `cheap_info'
    vendor/bundle/ruby/3.3.0/gems/mini_magick-5.0.1/lib/mini_magick/image/info.rb:17:in `[]'
    vendor/bundle/ruby/3.3.0/gems/mini_magick-5.0.1/lib/mini_magick/image.rb:123:in `block in attribute'
    lib/active_storage_validations/metadata.rb:32:in `block in metadata'
    lib/active_storage_validations/metadata.rb:98:in `read_image'
    lib/active_storage_validations/metadata.rb:28:in `metadata'
    lib/active_storage_validations/dimension_validator.rb:66:in `block in validate_each'
    lib/active_storage_validations/dimension_validator.rb:65:in `each'
    lib/active_storage_validations/dimension_validator.rb:65:in `validate_each'
    vendor/bundle/ruby/3.3.0/gems/activemodel-7.0.8.4/lib/active_model/validator.rb:153:in `block in validate'
    vendor/bundle/ruby/3.3.0/gems/activemodel-7.0.8.4/lib/active_model/validator.rb:[149](https://github.com/igorkasyanchuk/active_storage_validations/actions/runs/11288843453/job/31397452279?pr=265#step:7:150):in `each'
@Mth0158
Copy link
Collaborator

Mth0158 commented Oct 13, 2024

Hi @tagliala
I have no idea yet why it's behaving this way, it could be a regression due to the latest merged PR (#256). I'll dedicate some time this week to look into it, thks for the issue!

@Mth0158 Mth0158 added the bug Something isn't working label Oct 13, 2024
@tagliala
Copy link
Contributor Author

Hi, thanks.

I think it may depend by bundle update for some reasons. I'm checking too

@Mth0158
Copy link
Collaborator

Mth0158 commented Nov 25, 2024

@tagliala FYI it was happening due to our tempfile management system inside the metadata.rb file.
It will be fixed by the following refacto PR #299

igorkasyanchuk pushed a commit that referenced this issue Dec 11, 2024
… (#299)

* [Analyzer] Refacto our image analyzers to further expand the gem (#254)

* [Analyzer] Improve tempfile usage and remove useless code

* [Analyzer] Add test for rotated image

* [Analyzer] Fix issue with tempfile (#266)

* [Analyzer] Ensure tempfile is always closed

* [Analyzer] Correct rotated image test

* [Analyzer] Do not require dependency if already defined
@Mth0158 Mth0158 closed this as completed Dec 12, 2024
igorkasyanchuk pushed a commit that referenced this issue Jan 24, 2025
* [Analyzer] Refacto our image analyzers to further expand the gem (#254)

* [Analyzer] Improve tempfile usage and remove useless code

* [Analyzer] Add test for rotated image

* [Analyzer] Fix issue with tempfile (#266)

* [Analyzer] Ensure tempfile is always closed

* [Analyzer] Correct rotated image test

* [Readme] Rework additional info section

* [Readme] Reword installation section

* [Readme] Reword title section

* [Readme] Reword validator section and its first 2 validators

* [Readme] Reword size validator section

* [Readme] Reword total_size validator section

* [Readme] Reword dimension validator section

* [Readme] Add upgrading from 1.x to 2.x section

* [Readme] Reword limit validator section

* [Readme] Reword aspect_ratio validator section

* [Readme] Reword processable_image validator section

* [Readme] Remove usage section

* [Readme] Rework contributing section

* [Readme] Rework test matchers section

* [Readme] Remove sample section

* [Readme] Rework I18n section

* [Readme] Rework content_type spoofing section

* [Readme] Add best practices for content_type validator

* [Readme] Add best practices for size validator

* [Readme] Add pending TODOs

* Fixed typo in README in test matcher section.

* [Analyzer] Add video analyzer (#255)

* [ContentSpoof] Slight refacto for open3 command

* [Analyzer] Add explicit open3 require

* [CI] Add FFmpeg install in CI

* [Validator/Matcher] Add most_common_mime_types tests for content_type validator

* [Validator] Correct failing ensure_content_types_validity

* [Validator] Add dedicated error for 'image/jpg' content type

* [Readme] Improve size validator best practices section (#317)

* [Merge] Correct merge issues

* [Merge] Correct merge issues

* [Readme] Update aspect_ratio validator part

* [Analyzer] Add audio analyzer (#301)

rb

* [Analyzer] Round video duration like audio one

* [Error] Change image_metadata_missing to media_metadata_missing

* [Error] Update aspect_ratio error messages

* [Error] Update content_type spoofed error messages

* [Error] Update content_type error messages

rb

* [Error] Update limit error messages

* [Error] Update dimension error messages

* [Error] Fix failing test for limit validator

* [Test] Change to right order for assert_equal

* [Validator] Replace processable_image validator to processable_file (#314)

* [Validator] Refacto BaseComparisonValidator

* [Validator] Add duration validator (#304)

* [Matcher] Add duration validator matcher

* [Analyzer] Fix failing test

* [Analyzer] Refacto content_type_spoof_detector into an analyzer (#334)

* [Validator] Enhance content_type spoof errors

* [Analyzer] Fix failing tests

* [Validator] Handle content_type with parameters properly

* 340 validator increase performance by leveraging activestorageblob analyzed feature (#341)

* [Validator] Update base iterable method for attachables

* [Validator] Improve performance leveraging ActiveStorage::Blob#metadata metadata (#340)

* [Validator] Refine our performance improvement

* [Validator] Add content_type spoof in blob metadata

* [Validator] Handle edge case for has_one_attached (#193)

* [Doc] Refine readme before release

* [Changes] Add v2 changes

* [Analyzer] Fix unused variable warning

* [CI] Update Github actions

---------

Co-authored-by: Andreas Dausenau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants