Improve asset routing logic#9403
Merged
andreslucena merged 15 commits intodecidim:developfrom Jun 16, 2022
Merged
Conversation
After the image URLs were fixed, the PDF creation "jams" because the server is busy doing something else when it's trying to request the images, so those requests will never finish which causes the tests to timeout (conference tests particularly).
ahukkanen
commented
Jun 10, 2022
decidim-dev/lib/decidim/dev/test/rspec_support/wicked_pdf_assets_mock.rb
Show resolved
Hide resolved
andreslucena
previously approved these changes
Jun 15, 2022
Member
andreslucena
left a comment
There was a problem hiding this comment.
I've just gave it a quick spin locally, and everything works as expected: I could see the image on a newsletter in the admin panel and also on letter_opener.
Overall, great work as usual! Just a couple of changes regarding the hosts and the use of example.org or .test in the specs, that I want to hear your feedback, but I can live with it too.
Contributor
Author
|
Thanks @andreslucena, comments resolved. |
andreslucena
pushed a commit
that referenced
this pull request
Jul 6, 2022
* Refactor the asset routing in the ApplicationUploader * Fix the application uploader spec * Add a spec for the asset router * Do not modify the ENV vars during the application uploader test * Fix the correct port expectations in the routing related specs * Fix generators tests after moving the protocol options from the uploader * Fix correct expected URL ports in specs * Disable the images for the PDFs in tests due to jamming After the image URLs were fixed, the PDF creation "jams" because the server is busy doing something else when it's trying to request the images, so those requests will never finish which causes the tests to timeout (conference tests particularly). * Move the URL default options generation to another class * Add specs for the UrlOptionResolver * Refactor the MultitenantAssetHost to use UrlOptionResolver DRY * Change the CDN url to example.org * Allow other calls to the secrets dig * Change the production URL to production.decidim.test
This was referenced Jul 21, 2022
eliegaboriau
pushed a commit
to eliegaboriau/decidim
that referenced
this pull request
Oct 25, 2022
* Refactor the asset routing in the ApplicationUploader * Fix the application uploader spec * Add a spec for the asset router * Do not modify the ENV vars during the application uploader test * Fix the correct port expectations in the routing related specs * Fix generators tests after moving the protocol options from the uploader * Fix correct expected URL ports in specs * Disable the images for the PDFs in tests due to jamming After the image URLs were fixed, the PDF creation "jams" because the server is busy doing something else when it's trying to request the images, so those requests will never finish which causes the tests to timeout (conference tests particularly). * Move the URL default options generation to another class * Add specs for the UrlOptionResolver * Refactor the MultitenantAssetHost to use UrlOptionResolver DRY * Change the CDN url to example.org * Allow other calls to the secrets dig * Change the production URL to production.decidim.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
This is a slight refactor as a continuation for ##9285.
When implementing the short URLs at #9383 I realized we also have the
Decidim::EngineRouterclass which can be utilized to create the local URLs. This PR:Decidim::EngineRouterfor correct separation of concernsDecidim::AssetRouterwhich is a proxy class for generating the asset URLs and its sole purpose is to decide whether the routing should be done to the local server or to a remote CDN.📌 Related Issues
Testing
See #9285 and #9154.
📋 Checklist
docs/.