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

Upgrade application to Rails 6.0 #919

Merged
merged 23 commits into from
Jul 23, 2020
Merged

Upgrade application to Rails 6.0 #919

merged 23 commits into from
Jul 23, 2020

Conversation

pixeltrix
Copy link
Contributor

No description provided.

@pixeltrix pixeltrix force-pushed the upgrade-to-rails-6 branch from baea7f2 to fa5339f Compare July 13, 2020 19:33
@pixeltrix pixeltrix marked this pull request as ready for review July 13, 2020 19:34
@pixeltrix pixeltrix force-pushed the upgrade-to-rails-6 branch from 57806ef to 77afe53 Compare July 16, 2020 07:12
pixeltrix added 23 commits July 23, 2020 11:13
Three specs were failing with the following error:

Mongo::Error::OperationFailure:
  uuid must be a 16-byte binary field with UUID (4) subtype (207)
Use the Gemfile.lock to manage the versions instead which should make
it easier to upgrade as it allows bundler a wider set of versions to
resolve the dependencies.

Keep the rails constraint so that the current version can be identified.
PhantomJS doesn't work with /etc/ssl/openssl.cnf on Debian Buster.
Rails 4.0 and later disable rack-cache by default.
This helps when upgrading the standard Rails config files.
The application doesn't use form_with so there's no need to change it.
Run the rake app:update command to update all the config files.
Rails detects when config.eager_load is nil and displays a warning and
when Sidekiq.server? isn't true it returns nil which is a valid falsey
value in Ruby but unfortunately not what we need.
The response methods `success?` and `missing?` are deprecated.
In Rails 4.0 the lib directory was remove from the auto/eager load paths
because it resulted in a lot of junk being eager loaded in production
without the developer often being aware of this. The recommend pattern
now is to add an app/lib directory for non-specific application code.
Using a sass css compressor causes a scss file to be processed twice
(once to build, once to compress) which breaks the usage of "unquote"
to use CSS that has same function names as SCSS such as max.
Rails 6.0 adds a host authentication middleware that limits access by
default to 0.0.0.0/0, ::/0 and localhost. This commit adds the dev.gov.uk
hosts for the application to that list. There's no need to add the hosts
in production since the middleware is primarily to prevent DNS rebinding
attacks against a Rails application running locally.
Once the app is configured to load the latest defaults there is no
need for the new defaults initializer as it only serves as a guide
whilst upgrading the application.
Use a block to render content in the govspeak publishing component
that isn't marked as HTML safe.
The Rails secrets feature has been deprecated and will be removed in
an upcoming release. Rails 6.0 will generate a secret_key_base file
in the tmp directory in development and test environments and use the
SECRET_KEY_BASE environment variable in production.
Inline with the suggestion in alphagov/govuk-rfcs#126 update the
remaining minor dependencies when doing a framework upgrade.
@pixeltrix pixeltrix force-pushed the upgrade-to-rails-6 branch from b8e4de3 to 2bd66cf Compare July 23, 2020 10:20
@pixeltrix pixeltrix merged commit 0d77291 into master Jul 23, 2020
@pixeltrix pixeltrix deleted the upgrade-to-rails-6 branch July 23, 2020 10:42
kevindew added a commit that referenced this pull request Jan 24, 2023
GOV.UK hadn't intended for this app to have the GOV.UK Content Security
Policy yet, with us first planning to roll out this to frontend app. It
looks like this was added as part of an outsourced Rails update [1],
where the dev couldn't have known about our nuanced context.

As this is an app that doesn't receive a lot of developer attention I'm
disabling this as I don't want breaking changes to the CSP [2] to end up
in this app.

[1]: #919
[2]: alphagov/govuk_app_config#279
kevindew added a commit that referenced this pull request Jan 24, 2023
GOV.UK hadn't intended for this app to have the GOV.UK Content Security
Policy yet, with us first planning to roll out this to frontend app. It
looks like this was added as part of an outsourced Rails update [1],
where the dev couldn't have known about our nuanced context.

As this is an app that doesn't receive a lot of developer attention I'm
disabling this as I don't want breaking changes to the CSP [2] to end up
in this app.

[1]: #919
[2]: alphagov/govuk_app_config#279
kevindew added a commit that referenced this pull request Jan 25, 2023
GOV.UK hadn't intended for this app to have the GOV.UK Content Security
Policy yet, with us first planning to roll out this to frontend app. It
looks like this was added as part of an outsourced Rails update [1],
where the dev couldn't have known about our nuanced context.

As this is an app that doesn't receive a lot of developer attention I'm
disabling this as I don't want breaking changes to the CSP [2] to end up
in this app.

[1]: #919
[2]: alphagov/govuk_app_config#279
kevindew added a commit that referenced this pull request Jan 25, 2023
GOV.UK hadn't intended for this app to have the GOV.UK Content Security
Policy yet, with us first planning to roll out this to frontend app. It
looks like this was added as part of an outsourced Rails update [1],
where the dev couldn't have known about our nuanced context.

As this is an app that doesn't receive a lot of developer attention I'm
disabling this as I don't want breaking changes to the CSP [2] to end up
in this app.

[1]: #919
[2]: alphagov/govuk_app_config#279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants