Skip to content

DTT (Staging > Test) [robo-dtt] - #51382

Merged
deploy-code-org merged 6 commits into
testfrom
staging
Apr 17, 2023
Merged

DTT (Staging > Test) [robo-dtt]#51382
deploy-code-org merged 6 commits into
testfrom
staging

Conversation

@deploy-code-org

Copy link
Copy Markdown
Contributor

No description provided.

Hamms added 6 commits March 22, 2023 13:43
Specifically to pick up ruby/rake#211, which is required for Rails 6.1 support; without it, we get `undefined method ``with_application' for Rake:Module (NoMethodError)` when trying to run any rails script.

Specifically, I implemented this by running `bundle update rake scss_lint`, to also pick up the `scss_lint` change "Relax gem dependency constraints to allow rake 12.x"

- https://github.com/sds/scss-lint/blob/master/CHANGELOG.md#0510
- https://github.com/ruby/rake/releases/tag/v12.2.0

Tested locally that this resolves for me the problems with running rake tasks on Rails 6.1

Relying on existing tests to verify that this does not otherwise result in any change to functionality.
In preparation for an update to FactoryBot 5.x (and beyond), which deprecated static attributes in favor of dynamic attributes. Update

Update applied automatically by temporarily configuring my local environment to enable the `FactoryBot/AttributeDefinedStatically` lint rule:

```diff
diff --git a/.rubocop.yml b/.rubocop.yml
index 041a14a..594b15160a3 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -6,6 +6,7 @@ inherit_from:
 require:
   - rubocop-performance
   - rubocop-rails
+  - rubocop-rspec
   - rubocop-rails-accessibility
   - './tools/customLinters/rubocop_only_allowed_characters.rb'

@@ -74,6 +75,10 @@ Style/Semicolon:
 Style/WordArray:
   MinSize: 5

+RSpec/FactoryBot/AttributeDefinedStatically:
+  Include:
+    - 'dashboard/test/factories/*.rb'
+
 # END CODE.ORG OVERRIDES

 # BEGIN BLOCKLIST: Below are rules we don't plan to enable in the forseeable
diff --git a/Gemfile b/Gemfile
index 81ed267..917649bcb73 100644
--- a/Gemfile
+++ b/Gemfile
@@ -242,6 +242,7 @@ group :development, :staging, :levelbuilder do
   gem 'rubocop-performance', require: false
   gem 'rubocop-rails', require: false
   gem 'rubocop-rails-accessibility', require: false
+  gem 'rubocop-rspec', require: false
   gem 'scss_lint', require: false
 end
```

And then running `rubocop --require rubocop-rspec --only RSpec/FactoryBot/AttributeDefinedStatically --auto-correct dashboard/test/factories/*`. I then used `rubocop --only Layout/SpaceInsideBlockBraces --auto-correct dashboard/test/factories/*.rb` to automatically fix some white space errors, and manually edited `dashboard/test/factories/foorm_factories.rb` to fix up a few more.

- https://thoughtbot.com/blog/deprecating-static-attributes-in-factory_bot-4-11
- https://docs.rubocop.org/rubocop-rspec/cops_rspec_factorybot.html#rspecfactorybotattributedefinedstatically
…eDefinedStatically

Update FactoryBot Static Attributes to Dynamic
@deploy-code-org
deploy-code-org merged commit 2449ec5 into test Apr 17, 2023
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