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

Rails 7 Update #5874

Closed
wants to merge 13 commits into from
Closed

Rails 7 Update #5874

wants to merge 13 commits into from

Conversation

KludgeKML
Copy link
Contributor

@KludgeKML KludgeKML commented Apr 13, 2022

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

@govuk-ci govuk-ci temporarily deployed to smart-answer-rails-7-3qkbqftr8 April 13, 2022 14:03 Inactive
Gemfile Outdated Show resolved Hide resolved
@govuk-ci govuk-ci temporarily deployed to smart-answer-rails-7-nmepwa8ky April 14, 2022 11:06 Inactive
@govuk-ci govuk-ci temporarily deployed to smart-answer-rails-7-8akl1ewmz April 14, 2022 12:28 Inactive
@govuk-ci govuk-ci had a problem deploying to smart-answer-rails-7-hisb0v1f1 April 14, 2022 15:24 Failure
@govuk-ci govuk-ci temporarily deployed to smart-answer-rails-7-hisb0v1f1 April 14, 2022 15:26 Inactive
@govuk-ci govuk-ci had a problem deploying to smart-answer-rails-7-ol7smajcd April 14, 2022 15:40 Failure
@KludgeKML KludgeKML changed the title [DO NOT MERGE] Rails 7 Update Rails 7 Update Apr 20, 2022
Copy link
Contributor

@edwardkerry edwardkerry left a comment

Choose a reason for hiding this comment

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

This looks OK to me - a couple of questions but not blockers.
I notice the heroku app has failed to deploy but think that is a Heroku issue. Has it been deployed/tested on Integration?

@@ -2,7 +2,8 @@
"srcDir": "public/assets",
"srcFiles": [
"**/*.js",
"!express/**/*.js"
"!express/**/*.js",
"!**/visualise-*.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a note or card somewhere to remind us to add this back when possible?

tags: TAGS,
comment: { body: body },
})
self.class.client.zendesk_client.tickets.create!(payload)
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be undoing a change from the Fix deprecation notices commit. Is it possible to remove the change from that commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's... not quite undoing it (you'll see that the end result is slightly different), but yeah, I might be able to tinker with the commits to go straight from the original version to this, let me see if I can do that.

Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Excuse my drive by review - I get email notifications as I think I already commented. I thought I'd offer some suggestions having worked on a few JS testing and sprockets things.

Comment on lines +1 to +13
//= link accessible-autocomplete/dist/accessible-autocomplete.min.css
//= link application.css
//= link print.css
//= link joint.css
//= link visualise.css
//= link accessible-autocomplete/dist/accessible-autocomplete.min.js
//= link application.js
//= link dagre.js
//= link joint.layout.DirectedGraph.js
//= link joint.js
//= link joint.patch.js
//= link test-dependencies.js
//= link visualise.js
Copy link
Member

Choose a reason for hiding this comment

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

I imagine you can simplify this a little:

//= link_directory ./stylesheets
//= link joint.css
//= link application.js
//= link dagre.js
//= link joint.layout.DirectedGraph.js
//= link joint.js
//= link joint.patch.js
//= link test-dependencies.js
//= link visualise.js

You should also remove the assets_precompile stuff from

Rails.application.config.assets.precompile += %w[
test-dependencies.js
accessible-autocomplete/dist/accessible-autocomplete.min.js
accessible-autocomplete/dist/accessible-autocomplete.min.css
]
and
config.assets.precompile += %w[
joint.patch.js
joint.js
joint.layout.DirectedGraph.js
joint.css
print.css
dagre.js
visualise.js
visualise.css
]

A couple of suggestions that could make this part of the update a little easier are:

  • Do the sprockets update as part of the dependabot PR: Bump govuk_publishing_components from 28.9.2 to 29.5.0 #5879 (which updates Sprockets) so you can separate it out from the Rails 7 stuff
    • Perhaps use asset-pipeline to require the various joint.* js files from visualise.js, I don't think they're used anywhere else.

@@ -7,7 +7,10 @@
"scripts": {
"lint": "yarn run lint:js && yarn run lint:scss",
"lint:js": "standardx 'app/assets/javascripts/**/*.js' 'spec/javascripts/**/*.js'",
"lint:scss": "stylelint app/assets/stylesheets/"
"lint:scss": "stylelint app/assets/stylesheets/",
"jasmine:prepare": "bundle exec rake assets:precompile",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"jasmine:prepare": "bundle exec rake assets:precompile",
"jasmine:prepare": "RAILS_ENV=test bundle exec rails assets:clobber assets:precompile",",

This brings it into convention with our other apps. The clobber is needed otherwise the same JS files will get included twice if a JS file is changed :(

"lint:scss": "stylelint app/assets/stylesheets/"
"lint:scss": "stylelint app/assets/stylesheets/",
"jasmine:prepare": "bundle exec rake assets:precompile",
"jasmine:ci": "yarn run jasmine:prepare && PATH=~/.webdrivers:$PATH yarn run jasmine-browser-runner runSpecs",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"jasmine:ci": "yarn run jasmine:prepare && PATH=~/.webdrivers:$PATH yarn run jasmine-browser-runner runSpecs",
"jasmine:ci": "yarn run jasmine:prepare && yarn run jasmine-browser-runner runSpecs",

This suggestion is for consistency with our other apps: https://github.com/alphagov/content-publisher/blob/6511019bc2313b1cea3f1fcd7f5e77aef6913368/package.json#L12

This app doesn't have the webdrivers gem (it was removed from GOV.UK test) alphagov/govuk_test#43

Comment on lines +3 to +6
"srcFiles": [
"**/*.js",
"!express/**/*.js",
"!**/visualise-*.js"
Copy link
Member

Choose a reason for hiding this comment

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

I reckon you could change this to be:

Suggested change
"srcFiles": [
"**/*.js",
"!express/**/*.js",
"!**/visualise-*.js"
"srcFiles": [
"test-dependencies-*.js",
"application-*.js"

As I think they are the only JS files involved in testing (all the visualise and joint stuff seem to be separate libraries for one distinct page)

@KludgeKML
Copy link
Contributor Author

Superceded by: #5892

@KludgeKML KludgeKML closed this May 5, 2022
@KludgeKML KludgeKML deleted the rails-7 branch February 2, 2023 15:14
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.

4 participants