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
Update rails to 6.1 #8411
Update rails to 6.1 #8411
Conversation
ebf445c
to
335f9ea
Compare
@leio10 , all the checks have passed. Please note the commit 335f9ea can be removed, as it adds required things to make the generators pass. I see there is a small drop regarding the coverage metric, and I suspect this is caused by the excluded controller suite, which fails due to some errors in routing. I will try to address that in a separate PR. |
2103a1c
to
597c4e6
Compare
@leio10 , i have checked the test suite, and the |
0caadc5
to
e777fe8
Compare
e777fe8
to
bebad55
Compare
@andreslucena we've found an issue in ActiveStorage and Rails 6.0 that gets fixed in Rails 6.1, which prevents creating public urls for attachments. With Rails 6.0.x AS attachments generate only signed urls, which can be a problem if attachments urls are copied and pasted. It'd be good to include this PR in 0.25 branch once it gets merged, do you think that could be possible? |
@ferblape , I would push a bit faster a decidim 0.26 that would actually contain the Rails 6.1 upgrade. |
I think I was bitten by this one in Metadecidim, but I didn't have time to review it in deep and wasn't sure that I miss copied the URL. Do you have a step by step on how to reproduce this? Also, it'd be possible to only fix and backport this bug?
We will not backport this to v0.25. We only backport fixes to stable releases. IMHO this is too big.
👍🏽 Also for your info, we've talked with @alecslupu that as we're low in maintenance resources we will wait until February to review and merge this one, but I was thinking that there wouldn't be any need to merge this before. |
We've just discovered that the So, in Rails 6.0.x the links to attachments are private, which means that they expire, and they should include a key that signs the parameters. While the links are generated by the application it doesn't matter, because Rails renews the parameters without noticing. The problem is when you copy and paste the link into a document, because you copy the link to the S3 object instead of the Rails URL. That link to the S3 object contains the parameters that expire. |
431d900
to
aecad3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!! 👏🏽 👏🏽
There are a couple comments and things to discuss.
We should try to fix all the deprecation warnings that appear when running the spec suite, I'll add it in a comment
About the deprecation warnings:
Addressed in core by : #8608
There are a couple still there: $ grep -ri create_after_upload decidim*/
decidim-assemblies/spec/commands/update_assembly_member_spec.rb: ActiveStorage::Blob.create_after_upload!(
decidim-assemblies/spec/commands/update_assembly_member_spec.rb: ActiveStorage::Blob.create_after_upload!(
decidim-assemblies/spec/commands/create_assembly_member_spec.rb: ActiveStorage::Blob.create_after_upload!(
decidim-assemblies/spec/commands/create_assembly_member_spec.rb: ActiveStorage::Blob.create_after_upload!(
decidim-assemblies/spec/presenters/decidim/assembly_member_presenter_spec.rb: ActiveStorage::Blob.create_after_upload!(
decidim-core/spec/models/decidim/editor_image_spec.rb: file: ActiveStorage::Blob.create_after_upload!(
These are the main ones that I've found. I'd said that the biggest one for sure is the PaperTrail version compatibility, the rest we could fix them in other PRs after merging this one (although it'd be great to fix them as it doesn't seem difficult to fix) |
401b3f1
to
b7c9718
Compare
b7c9718
to
325509d
Compare
@ahukkanen I have made the test suite Green again. To make it easier to review, i have reduced the number of files changed (by reverting method calls that are yielding deprecation warnings). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one small thing I still noticed.
Otherwise LGTM, nice work again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great work!
@andreslucena Do you want to merge this first and then change the branch names in the generators in another PR after this? Or should those be changed first before merging?
I believe that if we change them before merging the generator tests will fail in this PR. but they would be green after merging.
I don't know what has been the convention regarding this before, so which way you prefer?
@ahukkanen, in the previous MRs where I had this operation, the changes related to branch name were done before merging. Once @andreslucena says that we are okay with it, I will commit those reverts. |
At the moment we've done what @alecslupu said, doing it in the same branch, so it's always pointing to this same repository. This means that we'll have the CI in red when merging this 🤷🏽♂️ (If you guys have any proposal on how to improve this flow, let me know!!) Also, great news that we'll be merging this 🚀!! |
@andreslucena I think this is fine. I think it's better than a separate PR to fix that. Can you also approve this PR @andreslucena to give signal for @alecslupu to revert those generator changes, after which we can finally merge? 🥳 |
I have just pushed d283ec4, which reverts the generator changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @alecslupu for your time and effort with this issue!
🎩 What? Why?
This is the rails 6.1 upgrade of the decidim.
Please note, at the moment the controller specs are being disabled due to an error, that i could not yet get my head around, but I am searching for a way to fix those as well.