Commit Graph

18659 Commits

Author SHA1 Message Date
Javi Martín
8ba37b295a Temporarily disable a test that fails sometimes
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.
2024-03-18 15:09:17 +01:00
Javi Martín
deb8b374e7 Simplify creating a proposal poll in a test
This way we avoid variables starting with underscores, which we don't
use almost anywhere else.
2024-03-02 23:43:44 +01:00
Javi Martín
c480cdd918 Don't create records after a visit in polls tests
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.
2024-03-02 23:43:26 +01:00
Javi Martín
2af1fc72f3 Prevent Unable to autoload constant error in tests
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.
2024-03-02 22:06:25 +01:00
Javi Martín
8ac1acc5ea Merge pull request #5374 from consuldemocracy/dependabot/bundler/bullet-7.1.6
Bump bullet from 7.0.7 to 7.1.6
2024-03-02 17:31:59 +01:00
dependabot[bot]
331784e926 Bump bullet from 7.0.7 to 7.1.6
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.7 to 7.1.6.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.0.7...7.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-02 03:00:10 +00:00
Javi Martín
a6f3952c3b Merge pull request #5361 from consuldemocracy/dependabot/bundler/pdf-reader-2.12.0
Bump pdf-reader from 2.11.0 to 2.12.0
2024-03-02 03:43:06 +01:00
dependabot[bot]
ac9472cc0b Bump pdf-reader from 2.11.0 to 2.12.0
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.11.0 to 2.12.0.
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.11.0...v2.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-02 03:19:02 +01:00
Javi Martín
8ec1edca30 Merge pull request #5373 from consuldemocracy/dependabot/bundler/faker-3.2.3
Bump faker from 3.2.1 to 3.2.3
2024-03-02 03:15:19 +01:00
dependabot[bot]
518eb333b4 Bump faker from 3.2.1 to 3.2.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](https://github.com/faker-ruby/faker/compare/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] <support@github.com>
2024-03-02 02:00:07 +00:00
Javi Martín
a30917b746 Merge pull request #5356 from consuldemocracy/dependabot/bundler/factory_bot_rails-6.4.3
Bump factory_bot_rails from 6.2.0 to 6.4.3
2024-03-02 02:58:19 +01:00
dependabot[bot]
56311eeefb Bump factory_bot_rails from 6.2.0 to 6.4.3
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](https://github.com/thoughtbot/factory_bot_rails/compare/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] <support@github.com>
2024-03-02 01:21:14 +00:00
Javi Martín
70edfbe624 Merge pull request #5290 from consuldemocracy/dependabot/bundler/mdl-0.13.0
Bump mdl from 0.12.0 to 0.13.0
2024-03-02 02:15:00 +01:00
dependabot[bot]
99b9167e72 Bump mdl from 0.12.0 to 0.13.0
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](https://github.com/mivok/markdownlint/compare/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] <support@github.com>
2024-03-02 00:51:07 +00:00
Javi Martín
5624e0fead Merge pull request #5420 from consuldemocracy/update_upload_artifact_action_to_version_4
Update upload artifact action to version 4
2024-03-02 01:28:43 +01:00
Javi Martín
7ae8df8af7 Merge pull request #5362 from consuldemocracy/dependabot/bundler/rubocop-rails-2.23.1
Bump rubocop-rails from 2.21.2 to 2.23.1
2024-03-02 01:18:06 +01:00
Javi Martín
acfaada82b Update upload artifact 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/upload-artifact@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
2024-03-02 00:51:22 +01:00
dependabot[bot]
bbb4c84ddb Bump rubocop-rails from 2.21.2 to 2.23.1
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](https://github.com/rubocop/rubocop-rails/compare/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] <support@github.com>
2024-03-01 23:46:40 +00:00
Javi Martín
1fe03937f9 Merge pull request #5419 from consuldemocracy/update_setup_node_action_to_version_4
Update setup-node action to version 4
2024-03-02 00:44:33 +01:00
Javi Martín
23e54892d5 Update setup-node 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/.
2024-03-02 00:29:43 +01:00
Javi Martín
fbe46c95df Merge pull request #5415 from consuldemocracy/update_checkout_action_to_version_4
Update checkout action to version 4
2024-03-02 00:13:04 +01:00
Javi Martín
3fa16bc882 Update checkout action to version 4
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/
2024-03-01 23:46:30 +01:00
Javi Martín
dc5267320b Merge pull request #5411 from consuldemocracy/update_upload_artifact_action
Update upload artifact action to version 3
2024-03-01 23:44:55 +01:00
Javi Martín
e07650e09b Update upload artifact 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/
2024-03-01 23:11:39 +01:00
Javi Martín
e9af16f266 Merge pull request #5407 from consuldemocracy/update_checkout_action
Update checkout action to version 3
2024-03-01 23:08:21 +01:00
Javi Martín
b60d2f45b8 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/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/
2024-03-01 21:58:42 +01:00
Javi Martín
5658b6f502 Merge pull request #5378 from consuldemocracy/dependabot/bundler/capybara-3.40.0
Bump capybara from 3.39.2 to 3.40.0
2024-03-01 21:55:46 +01:00
dependabot[bot]
139da18b19 Bump capybara from 3.39.2 to 3.40.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](https://github.com/teamcapybara/capybara/compare/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] <support@github.com>
2024-03-01 19:53:06 +00:00
Javi Martín
ed24a16f61 Merge pull request #5405 from consuldemocracy/dependabot/bundler/rubocop-rspec-2.27.0
Bump rubocop-rspec from 2.24.1 to 2.27.0
2024-03-01 20:51:06 +01:00
dependabot[bot]
86b72ad7be Bump rubocop-rspec from 2.24.1 to 2.27.0
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](https://github.com/rubocop/rubocop-rspec/compare/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] <support@github.com>
2024-03-01 19:22:10 +00:00
Javi Martín
8c0c952361 Merge pull request #5385 from consuldemocracy/dependabot/bundler/rubocop-factory_bot-2.25.1
Bump rubocop-factory_bot from 2.24.0 to 2.25.1
2024-03-01 20:20:01 +01:00
dependabot[bot]
7fc40ef3d3 Bump rubocop-factory_bot from 2.24.0 to 2.25.1
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](https://github.com/rubocop/rubocop-factory_bot/compare/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] <support@github.com>
2024-03-01 18:09:55 +00:00
Javi Martín
4c4699cb31 Merge pull request #5383 from consuldemocracy/dependabot/bundler/rubocop-capybara-2.20.0
Bump rubocop-capybara from 2.19.0 to 2.20.0
2024-03-01 19:07:59 +01:00
dependabot[bot]
5772e1b14e Bump rubocop-capybara from 2.19.0 to 2.20.0
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](https://github.com/rubocop/rubocop-capybara/compare/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] <support@github.com>
2024-03-01 18:38:13 +01:00
Javi Martín
65ad1824fa Merge pull request #5401 from consuldemocracy/dependabot/bundler/rails-6.1.7.7
Bump rails from 6.1.7.6 to 6.1.7.7
2024-02-28 17:17:20 +01:00
Javi Martín
9ecab3bac6 Bump Rails to version 6.1.7.7 2024-02-28 16:04:38 +01:00
Javi Martín
07e4b8f14c Merge pull request #5365 from consuldemocracy/dependabot/bundler/puma-5.6.8
Bump puma from 5.6.7 to 5.6.8
2024-02-23 19:54:29 +01:00
dependabot[bot]
ac346573d5 Bump puma from 5.6.7 to 5.6.8
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](https://github.com/puma/puma/compare/v5.6.7...v5.6.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-23 18:06:58 +00:00
Javi Martín
435a4be7ca Merge pull request #5323 from consuldemocracy/release_2.1.0
Release version 2.1.0
2024-02-20 19:07:22 +01:00
Javi Martín
49e76a1427 Release version 2.1.0 2024-02-20 18:28:56 +01:00
Javi Martín
976384ad9a Fix typo in CHANGELOG 2024-02-20 18:28:48 +01:00
Javi Martín
90f753af98 Remove tasks to upgrade to version 2.0.0
These tasks have already been executed.
2024-02-13 18:11:24 +01:00
Javi Martín
e027f77464 Merge pull request #5387 from consuldemocracy/dependabot/bundler/nokogiri-1.16.2
Bump nokogiri from 1.15.4 to 1.16.2
2024-02-13 18:08:24 +01:00
dependabot[bot]
adca5d20f3 Bump nokogiri from 1.15.4 to 1.16.2
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.15.4 to 1.16.2.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.15.4...v1.16.2)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-13 16:16:30 +00:00
Senén Rodero
15518a6316 Merge pull request #5372 from consuldemocracy/puma_socket_activation
Puma socket activation
2024-02-13 17:01:56 +01:00
Senén Rodero
b0882a9146 Merge pull request #5328 from consuldemocracy/i18n_crowdin
Update translations from Crowdin
2024-02-12 23:01:30 +01:00
Senén Rodero Rodríguez
4c997ec0ca Enable Scottish Gaelic by default 2024-02-12 22:01:04 +01:00
Consul Bot
7490c24a10 Update translation from Crowdin 2024-02-12 22:01:04 +01:00
Senén Rodero Rodríguez
1d9d467c86 Enable puma socket activation
This gives us graceful restarts
2024-02-01 20:52:05 +01:00
Senén Rodero Rodríguez
bb20e8e2bd Disable ExecJS when running Puma and Delayed Job
By default, when starting a Rails application, ExecJS checks whether there's
a runtime available in the system. Since on production we now use FNM to
manage node versions, this meant that we had to run Puma using the
`fnm exec bundle exec puma` command.

However, this causes issues when integrating Puma with Systemd. For instance,
when using `fnm exec`, the PID for the main process is no longer the Puma
process but the FNM process, meaning that stopping and restarting Puma will
no longer behave as expected and might last 90 seconds (Systemd's timeout to
stop a service). Furthermore, using a Puma Systemd socket in order to
implement hot or phased restarts won't work either, and so we'll get 502
errors while restarting the service.

So we're using the `EXECJS_RUNTIME=Disabled` environment variable in the
Systemd service, which means we can remove the `fnm exec` prefix in the
ExecStart command (which starts Puma) and now the PID for the main process
is the Puma process, stopping/restarting the service no longer times out,
and we'll be able to implement Puma socket activation and hot restarts.

However, removing `bundle` from the list of commands which use `fnm exec`
(the `fnm_map_bins`) meant that we got a `RuntimeUnavailable` exception when
 running `bundle exec bin/delayed_job`. We tried to add `delayed_job` to the
`fnm_map_bins` variable but couldn't make it work.

Since we only need the ExecJs runtime when precompiling the assets but we
don't need it in order to start Puma or Delayed Job, we're adding
`{ EXECJS_RUNTIME: "Disabled" }` to Capistrano's default environment and
we're only using the default Runtime when `fnm exec` is used, which we've
done by setting the environment variable in the prefix of the fnm command.

This way, when running `EXECJS_RUNTIME='' fnm exec bundle exec rake assets:precompile`,
the right ExecJS Runtime will be loaded, but it won't be loaded (since it
isn't needed) when starting Puma or Delayed Job.
2024-02-01 20:46:19 +01:00