Commit Graph

20436 Commits

Author SHA1 Message Date
dependabot[bot]
663b92ba1d Bump stylelint-scss from 6.11.0 to 6.11.1
Bumps [stylelint-scss](https://github.com/stylelint-scss/stylelint-scss) from 6.11.0 to 6.11.1.
- [Release notes](https://github.com/stylelint-scss/stylelint-scss/releases)
- [Changelog](https://github.com/stylelint-scss/stylelint-scss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stylelint-scss/stylelint-scss/compare/v6.11.0...v6.11.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 13:44:41 +00:00
dependabot[bot]
39fd024b22 Bump paranoia from 3.0.0 to 3.0.1
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/rubysherpas/paranoia/releases)
- [Changelog](https://github.com/rubysherpas/paranoia/blob/core/CHANGELOG.md)
- [Commits](https://github.com/rubysherpas/paranoia/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: paranoia
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 13:25:34 +00:00
Sebastia
f607048fd0 Merge pull request #5862 from consuldemocracy/dependabot/bundler/ahoy_matey-5.3.0
Bump ahoy_matey from 5.2.0 to 5.4.0
2025-05-26 15:24:02 +02:00
Sebastia
932222f8ea Merge pull request #5837 from consuldemocracy/dependabot/bundler/caxlsx-4.2.0
Bump caxlsx from 4.1.0 to 4.2.0
2025-05-26 15:11:46 +02:00
dependabot[bot]
252780635d Bump ahoy_matey from 5.2.0 to 5.3.0
Bumps [ahoy_matey](https://github.com/ankane/ahoy) from 5.2.0 to 5.3.0.
- [Changelog](https://github.com/ankane/ahoy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/ahoy/compare/v5.2.0...v5.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 14:17:45 +00:00
Sebastia
9bad768ccb Merge pull request #5831 from consuldemocracy/dependabot/bundler/airbrake-13.0.5
Bump airbrake from 13.0.4 to 13.0.5
2025-05-23 16:12:30 +02:00
dependabot[bot]
a1f3cedb44 Bump caxlsx from 4.1.0 to 4.2.0
Bumps [caxlsx](https://github.com/caxlsx/caxlsx) from 4.1.0 to 4.2.0.
- [Changelog](https://github.com/caxlsx/caxlsx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/caxlsx/caxlsx/compare/v4.1.0...v4.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 14:06:53 +00:00
Sebastia
aa9ab0f079 Merge pull request #5804 from consuldemocracy/dependabot/bundler/delayed_job_active_record-4.1.11
Bump delayed_job_active_record from 4.1.10 to 4.1.11
2025-05-23 16:04:36 +02:00
Sebastia
87c1632950 Merge pull request #5799 from consuldemocracy/dependabot/bundler/audited-5.8.0
Bump audited from 5.7.0 to 5.8.0
2025-05-23 15:44:15 +02:00
dependabot[bot]
814a12a048 Bump delayed_job_active_record from 4.1.10 to 4.1.11
Bumps [delayed_job_active_record](https://github.com/collectiveidea/delayed_job_active_record) from 4.1.10 to 4.1.11.
- [Release notes](https://github.com/collectiveidea/delayed_job_active_record/releases)
- [Commits](https://github.com/collectiveidea/delayed_job_active_record/compare/v4.1.10...v4.1.11)

---
updated-dependencies:
- dependency-name: delayed_job_active_record
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 13:44:15 +00:00
dependabot[bot]
d35dcf4725 Bump audited from 5.7.0 to 5.8.0
Bumps [audited](https://github.com/collectiveidea/audited) from 5.7.0 to 5.8.0.
- [Changelog](https://github.com/collectiveidea/audited/blob/main/CHANGELOG.md)
- [Commits](https://github.com/collectiveidea/audited/compare/v5.7.0...v5.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 13:23:36 +00:00
Sebastia
2156fe5e27 Merge pull request #5785 from consuldemocracy/dependabot/bundler/pg-1.5.9
Bump pg from 1.5.8 to 1.5.9
2025-05-23 15:22:06 +02:00
Sebastia
32b5558bd3 Merge pull request #5939 from consuldemocracy/dependabot/bundler/view_component-3.22.0
Bump view_component from 3.11.0 to 3.23.1
2025-05-23 15:09:59 +02:00
dependabot[bot]
eac1776a1c Bump pg from 1.5.8 to 1.5.9
Bumps [pg](https://github.com/ged/ruby-pg) from 1.5.8 to 1.5.9.
- [Changelog](https://github.com/ged/ruby-pg/blob/master/History.md)
- [Commits](https://github.com/ged/ruby-pg/compare/v1.5.8...v1.5.9)

---
updated-dependencies:
- dependency-name: pg
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 12:56:14 +00:00
dependabot[bot]
56d0cbe690 Bump view_component from 3.11.0 to 3.22.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.11.0 to 3.22.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.11.0...v3.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 11:36:51 +00:00
Sebastia
d0b1f077eb Merge pull request #5769 from consuldemocracy/dependabot/bundler/wicked_pdf-2.8.2
Bump wicked_pdf from 2.8.1 to 2.8.2
2025-05-21 16:55:14 +02:00
dependabot[bot]
b930a40a4b Bump wicked_pdf from 2.8.1 to 2.8.2
Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/mileszs/wicked_pdf/releases)
- [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mileszs/wicked_pdf/commits)

---
updated-dependencies:
- dependency-name: wicked_pdf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-21 12:14:51 +00:00
Javi Martín
3e9d0c04bd Merge pull request #5916 from consuldemocracy/node20
Update Node.js from 18.20.3 to 20.19.2
2025-05-21 12:48:24 +02:00
Javi Martín
372a1dda3b Update Node.js from 18.20.3 to 20.19.2
Node 18 is reaching its end of life on April 30th, 2025, so we're
updating in order to keep using a maintained version after that date.
2025-05-20 18:17:35 +02:00
Javi Martín
1d6f69cfab Merge pull request #5915 from consuldemocracy/ruby3.3
Upgrade Ruby to version 3.3.8
2025-05-20 18:13:20 +02:00
Javi Martín
096023dffb Upgrade Ruby to version 3.3.8 2025-05-20 15:56:13 +02:00
Javi Martín
078ddb7717 Merge pull request #5496 from consuldemocracy/rails7.1
Upgrade to Rails 7.1
2025-05-20 15:54:44 +02:00
Javi Martín
5a5c0a716b Use Rails 7.1 defaults and overwrite them
We're still using YAML to serialize the legislation_annotations ranges
column. I'm not sure whether changing the serializer can have
consequences on existing data, and I'm not sure which serializer we
should provide instead. Quoting the Rails configuration guide [1]:

> Unfortunately there isn't really any suitable defaults available in
> Ruby's standard library. JSON could work as a format, but the json
> gems will cast unsupported types to strings which may lead to bugs.

[1] https://guides.rubyonrails.org/v7.1/configuring.html#config-active-record-default-column-serializer
2025-05-20 15:38:52 +02:00
Javi Martín
3432c385bc Use an HTML5 parser in test helpers
I think this doesn't affect us because we use RSpec instead of Rails
test classes. In any case, if it ever affects us, we'll get notified
when a test fails.
2025-05-20 15:38:52 +02:00
Javi Martín
140619ff00 Log exceptions as :error instead of :fatal
As mentioned in the pull request introducing this change [1]:

> FATAL is documented in the Ruby Logger docs as being for "An
> unhandleable error that results in a program crash.", which does not
> really apply to this case since DebugExceptions is handling the error.

So we're using the new default value, which makes more sense.

[1] Pull request 48575 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
Javi Martín
cbf11c2514 Use Rails::HTML5::Sanitizer when sanitizing HTML
Since we use a version of Loofah supporting HTML5 since db2d0bb80, the
`Rails::HTML::Sanitizer.best_supported_vendor` method will return the
HTML5 sanitizer. As mentioned in the pull request introducting this
change [1], the libxml2 maintainer wrote:

> it's still a bad idea to use a 20+ years old, unmaintained HTML 4
> parser to sanitize input for the modern web

So we're going with the new default sanitizer.

Note we aren't uncommenting the `action_text.sanitizer_vendor` option
because we don't use Action Text and so it doesn't affect us , and
uncommeting it will raise an error.

Also note we need to change one test because the new sanitizer handles
whitespace slightly differently.

[1] Pull request 48293 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
Javi Martín
0dec47c055 Use just the banner title as the banner link text
We were using an <a> tag wrapping the whole content of the banner in
order to make the whole banner clickable. However, that made the text of
the link less concise, affecting people using screen readers. So,
instead, we're using the `card` mixin, which we introduced in commit
f285dfcba.

We're making this change now because the HTML5 Sanitizer that we're
about to enable in the next commit was handling the whitespace inside
the banner differently, causing one test to fail, and we didn't find a
different way to fix it.
2025-05-20 15:38:52 +02:00
Javi Martín
8dcf66886e Fix broken tags in JavaScript injection tests
This was introduced in commit 5ecbe01d4, probably by accident while
copying a suggestion made in the pull request for that change [1]. This
broken tag introduces issues when sanitizing the HTML text with an HTML5
sanitizer, which we will start using in a couple of commits.

[1] https://github.com/consuldemocracy/consuldemocracy/pull/462#issuecomment-139309289
2025-05-20 15:38:52 +02:00
Javi Martín
82c3c6646d Use Rails 7.1 cache format
Just like we mentioned in commit 001eee3d6, according to the Rails
configuration guide [1], with this format, Rails serializes cache
entries more efficiently. Most importantly:

> All formats are backward and forward compatible, meaning cache entries
> written in one format can be read when using another format. This
> behavior makes it easy to migrate between formats without invalidating
> the entire cache.

[1] https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-cache-format-version
2025-05-20 15:38:52 +02:00
Javi Martín
a6e735dc4e Generate a secure token when initializing a record
This options doesn't affect us because we don't use `has_secure_token`,
so we're just using the new default value.
2025-05-20 15:38:52 +02:00
Javi Martín
e35bf97928 Commit transactions when using return inside them
It doesn't really affect us because we never use `return`, `break` or
`throw` inside transactions, since it would be confusing exactly because
it wouldn't be 100% clear whether the transaction is committed or not.

So we're using the new default value, which will be the only available
option in Rails 7.2 [1].

[1] Commit eccc6061f4 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
Javi Martín
d6b642a23d Run after_commit callbacks in order defined
This change doesn't affect us, since we don't use `after_commit`
callbacks, and, among our dependencies, AFAIK only the Devise gem uses
them, and it only defines one after_commit callback when creating a
record and another one when updating it, so we're never going to have
more than one callback being executed after a transaction is finished.
2025-05-20 15:38:52 +02:00
Javi Martín
0d0f3a48ff Use Rails 7.1 marshalling format
Enabling this option is only dangerous when deploying applications using
multiple servers. Since this isn't our case, we can enable it.
2025-05-20 15:38:52 +02:00
Javi Martín
7993f6d1ed Enable before_committed callbacks on all records
This doesn't really affect us because we don't use `before_committed`
callbacks (and neither do any of our dependencies), so we're using the
new default value.
2025-05-20 15:38:52 +02:00
Javi Martín
5ecd65b7dc Precompile filter parameters
This is done for performance reasons. Quoting the pull request
introducing this option [1]:

> A config might be overkill, but I wanted to provide an escape hatch
> for any upgraded apps that might be testing the exact value of the
> action_dispatch.parameter_filter header.

Since we don't test the exact value of action_dispatch.parameter_filter,
we can enable this option.

[1] Pull request 46452 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
Javi Martín
529b4d2a98 Don't validate foreign key in required belongs_to
Before this change, every time we saved a record, the association was
validated if we had `belongs_to :something, required: true`. After this
change [1], it's only validated if the `something_id` column is nil (or
`something_type` for polymorphic associations) or if the `something_id`
attribute has changed.

The main difference is that we no longer get validation errors if the
associated record has been deleted. Doesn't affect us much, so we're
going with the new default value.

[1] Pull request 46522 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
Javi Martín
364fa2603c Raise exceptions when assigning to attr_readonly attributes
Since we don't use attr_readonly, this option doesn't really affect us.
So we're just using the new default value.
2025-05-20 15:38:52 +02:00
Javi Martín
a1ae4651ff Simplify the way to set the maximum log size
We can use the new configuration option in Rails 7.1, so we don't have
to configure it manually.
2025-05-20 15:38:52 +02:00
Javi Martín
5db773e44f Serialize message data and metadata together
This is the new default option, and its only dangerous when deploying to
applications with multiple servers. Since this isn't our case, we can
enable it.
2025-05-20 15:38:52 +02:00
Javi Martín
e08ba7efbe Use JSON to serialize messages
The new serializer can decrypt legacy messages using the `marshal`
serializer, so there's no risk of losing data when upgrading. Since we
aren't using applications with several servers, where upgrading some
servers might cause issues on the servers that aren't upgraded yet,
we're enabling the option.

[1] See comments in pull request 42846 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
Javi Martín
36828ee86b Use SQLCommenter format to format tags in Query Logs
Don't really care about the format, so we'll use the new default one.
2025-05-20 15:38:52 +02:00
Javi Martín
9054d31ab3 Raise exceptions on invalid cache expiration time
It doesn't really affect us (unless some of our dependencies make this
mistake) because we only use `expires_in/expires_at` once and we do it
correctly, but it might be help us detect this issue if we ever
introduce it in the future.
2025-05-20 15:38:51 +02:00
Javi Martín
e45dc5d45a Use BigDecimal argument serializer in Active Job
This option won't even exist in Rails 7.2 [1], and the possibility to
disable it was only added to guarantee safe upgrades in Rails
applications with multiple replicas [2].

Since we don't have applications with multiple replicas, where one
replica could be using Active Job 7.0 and another one could be using
Active Job 7.1 while upgrading, we can enable this options.

[1] Commit 2a761d23d2 in https://github.com/rails/rails
[2] Commit bc1f323338 in https://github.com/rails/rails
2025-05-20 15:38:51 +02:00
Javi Martín
2bedfacf3b Disable deprecated singular association names
This doesn't affect us (since luckily we never use them), and, since
doing something like `Budget::Investment.where(budgets: 1)` would be
very confusing, getting an error when writing this code is IMHO better
than just getting a warning, which was the default before Rails 7.1 [1].

[1] https://guides.rubyonrails.org/v7.1/configuring.html#config-active-record-allow-deprecated-singular-associations-name
2025-05-20 15:38:51 +02:00
Javi Martín
c0bc9bd027 Use Rails 7.1 default options for SQLite
It doesn't really affect us because we don't use SQLite.
2025-05-20 15:38:51 +02:00
Javi Martín
6eebe4e984 Don't run commit callbacks on first saved instances in transaction
It probably doesn't directly affect us, since we don't use
`after_commit` callbacks, and, among our dependencies, AFAIK only the
Devise gem uses them, to send the email with confirmation/reconfirmation
instructions.

The reasons for this change are explained in the guide to configure
Rails [1], while the pull request introducing the change has a couple of
great examples in its description [2].

[1] https://guides.rubyonrails.org/v7.1/configuring.html#config-active-record-run-commit-callbacks-on-first-saved-instances-in-transaction
[2] Pull request 45280 in https://github.com/rails/rails
2025-05-20 15:38:51 +02:00
Javi Martín
fbb40d701b Encrypt Active Record data using SHA256
Since we weren't encrypting any data, we can disable the
support_sha1_for_non_deterministic_encryption option, which should only
be enabled on existing applications that were encrypting data using
SHA1 [1].

[1] https://guides.rubyonrails.org/v7.1/upgrading_ruby_on_rails.html#active-record-encryption-algorithm-changes
2025-05-20 15:38:51 +02:00
Javi Martín
994d86ce2c Don't make ActionController::Parameters equivalent to Hash
The comparison equality was supposed to be deprecated since 2016 [1],
and completely deprecated in Rails 7.1 [2]. This options won't even
exist in the next version of Rails [3].

[1] Pull request 23733 in https://github.com/rails/rails
[2] Pull request 44812 in https://github.com/rails/rails
[3] https://github.com/rails/rails/commit/43e42c1ea
2025-05-20 15:38:51 +02:00
Javi Martín
402b64291c Use the new default headers
The only change between these headers and the ones sent by Rails 7.0
application is that the `"X-Download-Options" => "noopen"` is no longer
sent. Only Internet Explorer used that header, and uploading, previewing
and downloading attachments still works fine on Internet Explorer 11
after this change.

[1] Pull request 43968 in https://github.com/rails/rails
2025-05-20 15:38:51 +02:00
Javi Martín
77d113d640 Don't add autoload_paths to load_path
Quoting the Rails configuration guide [1]:

> applications running in :zeitwerk mode do not need require_dependency,
> so models, controllers, jobs, etc. do not need to be in $LOAD_PATH.
> Setting this to false saves Ruby from checking these directories when
> resolving require calls with relative paths, and saves Bootsnap work
> and RAM, since it does not need to build an index for them.

[1] https://guides.rubyonrails.org/v7.1/configuring.html#config-add-autoload-paths-to-load-path
2025-05-20 15:38:51 +02:00