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

Merge Upstream Releases v4.1.0 and v4.1.1 #700

Merged
merged 199 commits into from
Jun 3, 2024
Merged

Conversation

aaronskiba
Copy link
Collaborator

@aaronskiba aaronskiba commented Mar 22, 2024

Changes proposed in this PR:

pengyin-shan and others added 30 commits October 3, 2022 12:21
… limit to

resetting the password.

The Rack-Attack middleware for blocking & throttling abusive requests is
being used.
https://github.com/rack/rack-attack/blob/6-stable/README.md

Changes:
- Added rack-attack version 6.6.1 gem. https://rubygems.org/gems/rack-attack/versions/6.6.1
- Added config/initializers/rack_attack.rb:
  - The rack-attack functionality is enabled with
        Rack::Attack.enabled = true
    but may be switched off
        Rack::Attack.enabled = false.
  - Password reset requests are currently throttled from from an IP address
    for POSTs to path /users/passwords and is limited 2 requests every 30 seconds.
ess
  - Login requests are throttled  from an IP address
    for POSTs to path /users/sign_in and is limited 4 requests every 30 seconds.  - A new html page public/429.html with title "Too Many Request" is added.
This code was added during commit 466d57a (there was no merge conflict to resolve).
For commit 54ba0ad, our current changes were kept within `app/assets/stylesheets/variables/_colours.scss` to maintain our styling. However, the v4.1.0 release changed `$color-seccondary-text` to `$color-secondary-text` and `$color-seccondary-background` to `$color-secondary-background`. Because the release changes the names of these variables in many other .scss files, we are applying the change here as well.
The files within this commit reference bootstrap variables, which in turn reference variables from `app/assets/stylesheets/variables/_colours.scss`.  Without these extra use statements, we could not compile the assets.
app/assets/stylesheets/application.scss
- Changed `@use "variables";` to `@use "variables" as *;` This enables our overrides to take effect when the Bootstrap stylesheets are imported.
- Changed `@use` to `@import` for blocks and utils and moved the statements to be executed after the Bootstrap imports. This enables the customisations within these files to take effect.

All app/assets/stylesheets/blocks/_x.scss files that included `@use "../../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss" as *;`
- Changed `@use "../../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss" as *;` to `@import '../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables';` The former statement was undoing our overrides specified within `app/assets/stylesheets/variables/`

app/assets/stylesheets/blocks/_navbars.scss
- Added `!optional` to `@extend .navbar-inverse;`. The removal of `@use "../../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss" as *;` necessitated this change (the same approach is being used in the following DMPRoadmap PR: DMPRoadmap#3374)

All public/tinymce/skins/oxide/ files
- These were auto-generated after executing `rake assets:clobber && rake assets:precompile`
According to https://github.com/titusfortner/webdrivers:
"If you can update to the latest version of Selenium (4.11+), please do so and stop requiring this gem."

Gemfile
- Replace webdrivers with selenium-webdriver

Gemfile.lock
- Ran `bundle install` && `bundle update selenium-webdriver`

spec/rails_helper.rb
- Only allow localhost (`allow: %w[chromedriver.storage.googleapis.com]` was only needed for the Webdrivers gem)

spec/spec_helper.rb
- Clean up code

spec/support/capybara.rb
- Remove references to removed Webdrivers gem
Without this modification, the selenium tests often trigger a 429 / Too Many Requests error. (Perhaps this should be applied to "/users/password" as well?)
:selenium_chrome_headless driver has a default window-size of (800x600). This small window-size seems to result in the following error for all features tests (because the button isn't being rendered on the screen):

Failure/Error: click_button 'Sign in'

     Selenium::WebDriver::Error::ElementClickInterceptedError:
These modifications are required so that these tests pass.
The v4.1.0 release replaced webpacker with jsbundling-rails and cssbundling-rails for the Javascript & CSS compilation. https://github.com/DMPRoadmap/roadmap/releases/tag/v4.1.0

As a result, it is necessary to remove these lines of code.
The commit 54ba0ad updated the Ruby version. This commit reflects that update.
app/controllers/plan_exports_controller.rb
- Line 125 was removed because it was essentially just a duplicate of line 127 (line 127 was added during commit 54ba0ad)

lib/tasks/export_portage.rake
- Added `rubocop:disable` to ignore these offences. However, the following GitHub issue has been created to further investigate the effects of these offences on their associated rake task. #699
Copy link

1 Warning
⚠️ This PR is too big! Consider breaking it down into smaller PRs.

Generated by 🚫 Danger

@aaronskiba aaronskiba changed the title Merge Upstream Release v4.1.0 Merge Upstream Releases v4.1.0 and v4.1.1 Apr 5, 2024
Copy link
Collaborator

@200455939-yashu 200455939-yashu left a comment

Choose a reason for hiding this comment

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

Good work 🥳👏🤝

Copy link
Collaborator

@200455939-yashu 200455939-yashu left a comment

Choose a reason for hiding this comment

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

Good work 👏

@aaronskiba aaronskiba merged commit 206edb0 into integration Jun 3, 2024
13 checks passed
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.

None yet

9 participants