Skip to content

Rails 6 upgrade#7471

Merged
mrcasals merged 193 commits intodevelopfrom
chore/rails-6-upgrade
Apr 15, 2021
Merged

Rails 6 upgrade#7471
mrcasals merged 193 commits intodevelopfrom
chore/rails-6-upgrade

Conversation

@entantoencuanto
Copy link
Copy Markdown
Contributor

@entantoencuanto entantoencuanto commented Feb 26, 2021

🎩 What? Why?

PR based on https://github.com/tremend-cofe/decidim/tree/chore/rails-6 used in #7086

This PR upgrades Decidim to use Rails 6:

  • Updates the names of some Rails classes which changes in Rails 6.
  • Changes routes in decidim_app-design to fix a double root definition.
  • Changes decidim-generator to get Gemfile.lock used in the generated application from the develop branch with the --edge option or the custom branch with the --branch option instead of the local decidim-generators/Gemfile.lock to prevent dependency errors.
  • Temporarily replaces the develop branch with this to avoid errors in decidim-generator when called with --edge or --branch mode. This change should be reverted after merging into develop
  • Fixes Rails 6 deprecation warnings.
  • Enables autoloading in Zeitwerk mode fixing remaining autoloading deprecation warnings.
  • Renames Decidim::DateCell by Decidim::DateRangeCell and includes some missing namespaces to avoid name conflicts in Zeitwerk mode.
  • Moves middlewares to /lib because they are not expected to be reloaded.
  • Encapsulates calls to classes in autoload paths from initializers with to_prepare callback to ensure correct autoloading.
  • Updates wicked_pdf gem version to fix a Rails 6 deprecation.

📌 Related Issues

Link your PR to an issue

Testing

Install a development_app with bundle exec rake development_app or install the generator and generate an application with the --edge option

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!

alecslupu and others added 30 commits October 13, 2020 10:12
Bump develop to next release version
@entantoencuanto entantoencuanto force-pushed the chore/rails-6-upgrade branch from d3ef0f8 to 00a629b Compare April 7, 2021 10:38
* develop:
  Revert "Fix single initiative type" (#7800)
  Census access codes exportation flow (#7756)
  Show attachment menu as active only when subitem is active (#7774)
  Add Voting Ballot Styles (#7779)
  Fix map accessibility issue - Map bottom position missing label (#7763)
  Update README.adoc (#7687)
  Fix single initiative type (#7667)
  Enable Proposals Cell to take into account machine translations (#7629)
  Change order by weight in subassemblies (#7620)
  Add categories parent filter to API (#7609)
  Mockup design for Remaining time in voting (#7597)
  Upgrade to Rails 5.2.5 (#7762)
  Generate votings access codes (#7704)
@entantoencuanto
Copy link
Copy Markdown
Contributor Author

It seems that Rack::Attack configuration for requests in census validation for elections is failing in this branch

def branch
return if options[:path]

@branch ||= options[:edge] ? "chore/rails-6-upgrade" : options[:branch].presence
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand we'll need to update this right after this PR is merged, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, after merging the branch should be reverted to "develop"

mrcasals
mrcasals previously approved these changes Apr 7, 2021
Copy link
Copy Markdown
Contributor

@mrcasals mrcasals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me so far, even though there are some failing specs! Super nice job!

@entantoencuanto entantoencuanto force-pushed the chore/rails-6-upgrade branch from 4d02553 to 659d548 Compare April 7, 2021 16:50
* develop:
  Let admins disable participatory space filters (#7819)
  Identify online voters (#7777)
  Restore vote tests in the elections module using the real bulletin board (#7802)
  Show initiative image in homepage (#7824)
  Let admins filter participatory space private users (#7817)
  Add Ballot Style to Census Datum (#7788)
  Show missing election component callout also for in-person votings (#7809)
  Fix canceling scope select doesnt open reveal (#7805)
  Fix: Reported users are displayed in all tenants (#7628)
  Evote - onboarding workflow (#7758)
  Add copy to clipboard feature to share links (#7697)
@mrcasals
Copy link
Copy Markdown
Contributor

@entantoencuanto please, check those failing specs! 👀

develop has been merged in this branch but the changes of this
reversion has been missed in the merge commit. This commit redoes
the rollback changes
Rack::Attack.throttle makes use of cache to store counters. If
cache_store is set to null_store the counter never reaches the limit
* develop:
  Ask again for access code (#7803)
  New Crowdin updates (#7836)
  Identify in person voters (#7828)
  CSV exporter should take into account locales from all resources (#7825)
  New Crowdin updates (#7797)
  Add missing translation for election publish_results admin log (#7835)
@mrcasals
Copy link
Copy Markdown
Contributor

@entantoencuanto I'm merging this, congratulations!!

Could you prepare a PR fixing the branch name in app_generator.rb to point back to develop, please? 😄 https://github.com/decidim/decidim/pull/7471/files/37644111a500472a12b132525134eb9a5bba85e8#diff-c3aa8c1b16983c6e079ae25eb3f0786bcc61080eff2bbdd9e1a9a5e41d891efc, discussed in #7471 (comment)

@mrcasals mrcasals merged commit e015b8d into develop Apr 15, 2021
@mrcasals mrcasals deleted the chore/rails-6-upgrade branch April 15, 2021 06:55
entantoencuanto added a commit that referenced this pull request Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to Rails 6 Migrate to Zeitwerk