-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Ungarbled binary resources #1131
Conversation
Added a test that checks that the static resources returned by the server have content that matches their cacheid. This test currently fails because some binary resources (e.g. png images) are garbled by the dos2unix conversion.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1131 +/- ##
=======================================
Coverage 41.43% 41.43%
=======================================
Files 59 59
Lines 4245 4245
Branches 2323 2323
=======================================
Hits 1759 1759
Misses 990 990
Partials 1496 1496 ☔ View full report in Codecov by Sentry. |
This PR fixes the bug introduced by #1113. More importantly it provides protection (in the form of a unit test) against similar future problems. There are a few things that I don't like about this PR:
|
@kelson42 How shall we proceed with this PR without @mgautierfr? I am most interested in feedback on the proposed method of protection against bugs similar to the one being fixed. |
@veloman-yunkan We have to deal without his feedback. But I have two remarks:
|
... so that all resources have extensions and can be automatically categorized as binary or text based on extension (coming next).
Now if a static resource of a new type is added the build will fail unless the list of known file type extensions is updated.
Now when new types of resources are added that won't go unnoticed - the build will fail unless the list of known extensions is updated. |
With the newly committed change no extra difficulty regarding maintenance of static resource files is being introduced (as long as we are concerned only with things that have to be memorized). The second point in my earlier comment is just a reiteration of a (slight) problem that existed before this PR. There is a way to add a test that would mostly eliminate that issue but IMHO we shouldn't spend any effort on it until it proves to be a real rather than a hypothetical problem.
I reread the README but don't think that it needs to be updated. If the pressure to do so mounts, we better enhance our test suite as mentioned in the previous paragraph.
That may solve some of the addressed concerns (though at the cost of a significantly larger effort) but should not be considered as a substitute for what can be checked on the unit-test level.
Our mechanism for embedding resources has been significantly enhanced since when the original issue was filed. That on the one hand makes that ticket more justified since the system has become more complex and perhaps can be optimized. On the other hand the task has become more difficult too and maybe we shouldn't touch what works reasonably well until we notice that we have to spend excessive hours on solving issues rooted in the current implementation of how we deal with static resources. |
Fixes #1129