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 CONSUL DEMOCRACY to version 2.1.1 #161

Merged
merged 62 commits into from
Apr 5, 2024
Merged

Upgrade CONSUL DEMOCRACY to version 2.1.1 #161

merged 62 commits into from
Apr 5, 2024

Conversation

microweb10
Copy link
Member

Objectives

Upgrade CONSUL DEMOCRACY to version 2.1.1 🎉

Notes

Release notes 2.1.1

coslajohn and others added 30 commits February 9, 2024 14:36
Bumps [puma](https://github.com/puma/puma) from 5.6.7 to 5.6.8.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](puma/puma@v5.6.7...v5.6.8)

---
updated-dependencies:
- dependency-name: puma
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/puma-5.6.8

Bump puma from 5.6.7 to 5.6.8
…ot/bundler/rails-6.1.7.7

Bump rails from 6.1.7.6 to 6.1.7.7
Note that this version changed the default enforced styles for
ClickLinkOrButtonStyle and NegationMatcher, so we're now specifying
them.

Bumps [rubocop-capybara](https://github.com/rubocop/rubocop-capybara) from 2.19.0 to 2.20.0.
- [Release notes](https://github.com/rubocop/rubocop-capybara/releases)
- [Changelog](https://github.com/rubocop/rubocop-capybara/blob/main/CHANGELOG.md)
- [Commits](rubocop/rubocop-capybara@v2.19.0...v2.20.0)

---
updated-dependencies:
- dependency-name: rubocop-capybara
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/rubocop-capybara-2.20.0

Bump rubocop-capybara from 2.19.0 to 2.20.0
Bumps [rubocop-factory_bot](https://github.com/rubocop/rubocop-factory_bot) from 2.24.0 to 2.25.1.
- [Release notes](https://github.com/rubocop/rubocop-factory_bot/releases)
- [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop-factory_bot@v2.24.0...v2.25.1)

---
updated-dependencies:
- dependency-name: rubocop-factory_bot
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/rubocop-factory_bot-2.25.1

Bump rubocop-factory_bot from 2.24.0 to 2.25.1
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.24.1 to 2.27.0.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop-rspec@v2.24.1...v2.27.0)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/rubocop-rspec-2.27.0

Bump rubocop-rspec from 2.24.1 to 2.27.0
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.39.2 to 3.40.0.
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](teamcapybara/capybara@3.39.2...3.40.0)

---
updated-dependencies:
- dependency-name: capybara
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/capybara-3.40.0

Bump capybara from 3.39.2 to 3.40.0
We were getting a warning with version 2:

The following actions uses node12 which is deprecated and will be forced
to run on node16: actions/checkout@v2. For more info:
https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
…heckout_action

Update checkout action to version 3
We were getting a warning with version 2:

The following actions uses node12 which is deprecated and will be forced
to run on node16: actions/upload-artifact@v2. For more info:
https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
…pload_artifact_action

Update upload artifact action to version 3
We were getting some warnings with version 3:

Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/checkout@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
…heckout_action_to_version_4

Update checkout action to version 4
We were getting a warning with version 3:

Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/setup-node@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
…etup_node_action_to_version_4

Update setup-node action to version 4
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.21.2 to 2.23.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop-rails@v2.21.2...v2.23.1)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
We were getting a warning with version 3:

Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/upload-artifact@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
…ot/bundler/rubocop-rails-2.23.1

Bump rubocop-rails from 2.21.2 to 2.23.1
…pload_artifact_action_to_version_4

Update upload artifact action to version 4
Bumps [mdl](https://github.com/mivok/markdownlint) from 0.12.0 to 0.13.0.
- [Changelog](https://github.com/markdownlint/markdownlint/blob/main/CHANGELOG.md)
- [Commits](markdownlint/markdownlint@v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: mdl
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/mdl-0.13.0

Bump mdl from 0.12.0 to 0.13.0
Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 6.2.0 to 6.4.3.
- [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases)
- [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/main/NEWS.md)
- [Commits](thoughtbot/factory_bot_rails@v6.2.0...v6.4.3)

---
updated-dependencies:
- dependency-name: factory_bot_rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ot/bundler/factory_bot_rails-6.4.3

Bump factory_bot_rails from 6.2.0 to 6.4.3
Bumps [faker](https://github.com/faker-ruby/faker) from 3.2.1 to 3.2.3.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md)
- [Commits](faker-ruby/faker@v3.2.1...v3.2.3)

---
updated-dependencies:
- dependency-name: faker
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
dependabot bot and others added 27 commits March 2, 2024 17:34
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.6.0 to 3.11.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](ViewComponent/view_component@v3.6.0...v3.11.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
The `use_helpers` method was added in ViewComponent 3.8.0, and it's
included by default in all components since version 3.11.0.

Note we sometimes delegated the `can?` method to the controller instead
of the helpers, for no particularly reason. We're unifying that code as
well.
When running these tests, under certain conditions, we get a warning
followed by an error:

```
activesupport-6.1.7.7/lib/active_support/dependencies.rb:502:
warning: already initialized constant ActiveStorage::Representations

activesupport-6.1.7.7/lib/active_support/dependencies.rb:502:
warning: previous definition of Representations was here

Failure/Error: raise LoadError, "Unable to autoload constant
'#{qualified_name}', expected #{file_path} to define it"

LoadError: Unable to autoload constant
ActiveStorage::Representations::RedirectController, expected
activestorage-6.1.7.7/app/controllers/active_storage/representations/redirect_controller.rb
to define it
```

The error seems to take place when we request a page in a test that
loads two (or more) ActiveStorage images if ActiveStorage hasn't loaded
yet, although it's a flaky error and so the test doesn't always behave
like this.

We've tested that switching to zeitwerk solves the issue but, since we
aren't switching to zeitwerk in version 2.1.1 and we'd like this version
to run all tests correctly, for now we're changing the tests so they
don't load two records with images.

On of these tests ("Polls Index Polls can be listed") fails on my
machine when run individually. I haven't been able to consistently
reproduce the other ones.
Creating records after starting the browser with the `visit` method
sometimes results in database corruption and failing tests on our CI.

Splitting some tests or merging them together solves the issue.
This way we avoid variables starting with underscores, which we don't
use almost anywhere else.
We forgot to change the `span` tag when we replaced links with buttons
in commit ba0d21b.
These texts were added in English in commit 7070b09, but we forgot to
add the texts in Spanish as well.
…spanish_translations

Add missing Spanish translations
…ot/bundler/view_component-3.11.0

Bump view_component from 3.6.0 to 3.11.0
Code Climate was failing to analyze our repo because their rubocop 1.31
doesn't support rubocop-capybara.

Since we're using rubocop 1.56.4 in our code, we're going to use
version 1.56.3 for Code Climate which, at the time of writing, is the
latest available version in Code Climate.
…ent_votes_html

Fix invalid HTML in comment votes
This test is failing often due to an "Unable to autoload constant"
error, that will be fixed after switching to zeitwerk.

Just like it happened in the the "Polls can be listed" test, the reason
seems to be accessing a page containing several ActiveStorage
attachments. However, since this test only makes sense when two or more
images are displayed on the page, we can't change the test so create
just one image.

So, for now, we're commenting the test, and we'll uncomment it again
when we enable zeitwerk in version 2.2.0.
…capybara_code_climate

Update Code Climate Rubocop version
…s_test

Prevent "Unable to autoload constant" error in tests
This link used to open in a new window, and we accidentally changed that
behavior while refactoring it in commit c2710de.

Since we're adding a test for this case, and the Proposals::NewComponent
class is similar, we're adding a test for that class too. In the case of
proposals, we need to sign in a user because the proposals form contains
fields to attach image, that currently rely on a user being signed in.
Allow whitespace between square brackets in GeoJSON polygons
Even though we're already applying this rule since commit 08b12a7,
it's very useful to have it so we don't accidentally introduce code that
won't work with Rails 7.

After upgrading to Rails 7, this rule will no longer be necessary, since
the code using the deprecated syntax will not work and so we'll notice
it immediately.
So now we know where to use the `where.missing` method which was
introduced in Rails 6.1.

Note this rule didn't detect all cases where the new method can be used.
…_rubocop_rules

Add rubocop rules affecting Rails 6.1
After commit 52ec509, we started to get a warning when running out
test suite:

```
WARNING: The #<Class:0x00007958c06fb8e0> component rendered HTML-unsafe
output. The output will be automatically escaped, but you may want to
investigate.
```

The reason is that, for security reasons, since version 3.9.0,
ViewComponent no longer renders unsafe output in the `call` method, so
we need to make sure the rendered text is safe. This is similar to what
Rails automatically does in views with `<%= %>`.

While this change doesn't affect the application (this class is only
used in a test), with it we avoid the warning.
…fe_spec_warning

Sanitize the output of a dummy component class
@microweb10 microweb10 merged commit 93d9daa into master Apr 5, 2024
12 of 13 checks passed
@microweb10 microweb10 deleted the release_2.1.1 branch April 5, 2024 10:52
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.

3 participants