Commit Graph

19531 Commits

Author SHA1 Message Date
Javi Martín
497c542082 Upgrade Ruby to version 3.2.5
So get the latest fixes in the 3.2.x series.

We're also updating the parser gem so we don't get any warnings.
2024-08-19 16:04:38 +02:00
Sebastia
888d1c9fad Merge pull request #5652 from consuldemocracy/ubuntu-installation-docs
Update local installation instructions
2024-08-07 17:00:13 +02:00
taitus
e46fc35d31 Update macOS local installation instructions 2024-08-07 16:46:07 +02:00
Javi Martín
996885b8c8 Fix typos in local installation instructions 2024-08-07 16:34:41 +02:00
Javi Martín
37f737192e Add Docker as an option to develop using windows
For some people, this is easier than installing a virtual machine.
2024-08-07 15:48:50 +02:00
Javi Martín
b686489652 Update Debian local installation instructions
So now we install a specific version of Node.js and use the packages
required for Debian Bookworm.

For consistency, we're also making them similar to the Ubuntu
instructions and installing rbenv instead of RVM. Since we now suggest
rbenv in both cases as well as in the macOS instructions, we're also
listing rbenv as the first option in the generic local installation
instructions.
2024-08-07 15:48:50 +02:00
taitus
7845c7f78d Update ubuntu local installation instructions
So now we install a specific version of Node.js and use the packages
required for Ubuntu 24.04.
2024-08-07 15:48:50 +02:00
Javi Martín
0a3cabd8c8 Add rspec note to local installation instructions
This note was already present in the README, and it makes sense that we
mention it again in the other place where we recommend running the test
suite.
2024-08-07 15:48:50 +02:00
Javi Martín
9f5f0b3cf4 Remove UTF-8 PostgreSQL configuration instructions
Modern systems already use UTF-8 and so these instructions aren't
necessary.
2024-08-07 15:48:50 +02:00
Javi Martín
5b50040995 Simplify instructions to install rbenv
Some of these steps are no longer necessary since the rbenv installer
automatically configures the `~/.bashrc` file.
2024-08-07 15:48:50 +02:00
Javi Martín
9e3bbfd3aa Simplify wget command in Ubuntu instructions 2024-08-07 15:48:50 +02:00
Javi Martín
97c59afb0e Update instructions to install Node.js
We're using a specific version of Node.js since commit 55ed40e18.
2024-08-07 15:48:47 +02:00
Javi Martín
e666c28c5c Update instructions for the bin/setup command
This command simplifies some of the steps. However, there's a gotcha: it
might fail if the database requires username and password and they
haven't been configured before executing it.
2024-08-07 15:48:21 +02:00
Javi Martín
1b61e8e2e0 Add a more specific link for local installation docs
On our regular README, this link used to point to the documentation
site, which made sense because the documentation used to be on a
different repository. Now that the documentation is on this repository
as well, we can directly link to that file.

And, on the documentation README, we can also link to the local
installation instructions, just like we do in other places.
2024-08-06 15:48:14 +02:00
Javi Martín
4c5e446d02 Remove step to install the bundler gem
Bundler is included in Ruby since Ruby 2.6, so we don't have to
manually install the gem since commit 8e64d6c1a.
2024-08-06 15:48:14 +02:00
Javi Martín
5d9f02ae30 Fix typo in Spanish README 2024-08-06 15:48:14 +02:00
Javi Martín
13d31b8668 Add ImageMagick to prerequisites
We include ImageMagick in the local installation instructions as well as
in the installer, but we forgot to add it to the list of prerequisites
in the README.
2024-08-06 15:47:46 +02:00
Javi Martín
5f20b5baac Remove dependency on shared-mime-info
We don't use mimemagic since commit 7212657c0, so we don't need
shared-mime-info anymore.
2024-08-06 12:46:49 +02:00
Javi Martín
1a05529ab8 Merge pull request #5650 from consuldemocracy/dependabot/bundler/rexml-3.3.3
Bump rexml from 3.3.2 to 3.3.3
2024-08-02 13:32:32 +02:00
dependabot[bot]
a50067f29c Bump rexml from 3.3.2 to 3.3.3
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.2...v3.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-02 02:12:55 +00:00
Javi Martín
94628575bd Merge pull request #5629 from consuldemocracy/dependabot/bundler/rexml-3.3.2
Bump rexml from 3.3.1 to 3.3.2
2024-07-22 20:32:01 +02:00
Javi Martín
88aaf6a361 Merge pull request #5491 from consuldemocracy/use_rails7.0_methods
Use Rails 7.0 methods to simplify code
2024-07-22 18:50:41 +02:00
Javi Martín
00c97ad587 Split polls date range validation
It was a bit strange to leave the end date blank and have a message
associated with the start date, so we're using presence validations
instead.

For the range validation, we're using the comparison validator included
in Rails 7.0.
2024-07-22 18:35:35 +02:00
Javi Martín
da86254fe5 Use comparison validation to validate dates
The `validates_comparison_of` method was added in Rails 7.0.

We aren't changing the `date_range` validation in polls yet because it's
a bit complex; we'll do it in the next commit.
2024-07-22 18:35:35 +02:00
Javi Martín
f8f6844ec3 Simplify common HTML attributes using tag.attributes
The `tag.attributes` method was introduced in Rails 7.0.
2024-07-22 18:35:35 +02:00
Javi Martín
1b18151941 Use minimum and maximum in enumerables
While the `minimum` and `maximum` methods have been available for a long
time for ActiveRecord relations, Rails 7.0 has added these methods for
enumerables as well.

This means that the `start_date` and `end_date` methods in the
ShiftsHelper can use `minimum` and `maximum` no matter whether they
receive an ActiveRecord relation or an array of polls (I think the
latter never happens, though, but I'm not 100% sure).
2024-07-22 18:35:35 +02:00
Javi Martín
38ad65605e Use excluding instead of where.not(id:
This method was added in Rails 7.0 and makes the code slihgtly more
readable.

The downside is that it generates two queries instead of one, so it
might generate some confusion when debugging SQL queries. Its impact on
performance is probably negligible.
2024-07-22 18:35:35 +02:00
Javi Martín
9841a9b03a Use in_order_of to sort translations by fallback
This method was introduced in Rails 7.0, and thanks to it we can
simplify the code that gets the translations in order.

We tried to use this method to simplify the `Randomizable` concern as
well. However, we found out that, when ordering tens of thousands of
records, the query could take several minutes, so we aren't using it in
this case. Using it for translation fallbacks is OK, since there's a
good chance we're never going to have tens of thousands of available
locales.

Note that automated security tools reported a false positive related to
SQL Injection due to the way we used `LEFT JOIN`, so now we get one less
false positive in these reports.
2024-07-22 17:50:40 +02:00
Javi Martín
a56e1bf3cf Simplify strategy to insert records in tests
Since Rails 7.0, the `insert` method automatically generates timestamps.
2024-07-22 17:50:40 +02:00
Javi Martín
6628b0f67e Merge pull request #5493 from consuldemocracy/properties_alphabetical_order
Add properties-alphabetical-order Stylelint rule
2024-07-22 17:50:12 +02:00
Javi Martín
2ccf725815 Add properties-alphabetical-order Stylelint rule
We hadn't added this rule before because there was no such rule in
scss-lint. Instead, we were following it without a linter, and so we
unintentionally broke it sometimes.

But now we're using Stylelint, so we can add the rule and let the linter
check we're still following it.
2024-07-22 17:34:08 +02:00
Javi Martín
2361efb1b5 Merge pull request #5579 from consuldemocracy/dependabot/bundler/rubocop-rspec-3.0.1
Bump rubocop-rspec from 2.27.0 to 3.0.1
2024-07-22 17:31:31 +02:00
Javi Martín
50c8409f41 Merge pull request #5619 from consuldemocracy/dependabot/github_actions/docker/setup-buildx-action-3
Bump docker/setup-buildx-action from 1 to 3
2024-07-21 23:48:05 +02:00
dependabot[bot]
b211cd759b Bump docker/setup-buildx-action from 1 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-21 21:22:31 +00:00
Javi Martín
44c7e47dd4 Merge pull request #5618 from consuldemocracy/dependabot/github_actions/docker/build-push-action-6
Bump docker/build-push-action from 2 to 6
2024-07-21 23:21:13 +02:00
Javi Martín
70f90aba33 Merge pull request #5621 from consuldemocracy/dependabot/github_actions/toshimaru/auto-author-assign-2.1.1
Bump toshimaru/auto-author-assign from 1.4.0 to 2.1.1
2024-07-21 23:20:42 +02:00
Javi Martín
140ca2feb9 Add RSpec/MissingExpectationTargetMethod rule
This rule was introduced in rubocop-rspec 3.0.0. We were already
following it. It might be helpful because during development I've made
typos prevented by this rule a couple of times.
2024-07-21 22:25:45 +02:00
Javi Martín
04eaa802cc Add RSpec/ExpectInLet rubocop rule
This rule was added in rubocop-rspec 2.30.0. We were already following
it. It might be useful to detect typos during development.
2024-07-21 22:25:45 +02:00
Javi Martín
d90b799342 Add RSpec/UndescriptiveLiteralsDescription rule
This rule was added in rubocop-rspec 2.29.0. We were already following
it.
2024-07-21 22:25:45 +02:00
Javi Martín
dea317c614 Add RSpec/EmptyOutput rubocop rule
This rule was added in rubocop-rspec 2.29.0. While we never use the
`output` matcher, it might actually be a good idea to use it in tests of
take tasks, to check the logger output.
2024-07-21 22:25:45 +02:00
dependabot[bot]
cb227e41dc Bump rubocop-rspec from 2.27.0 to 3.0.1
In this version, the RSpec Rails cops have been extracted to a new
`rubocop-rspec_rails` gem [1], and the `RSpec/Capybara/FeatureMethods`
has been removed in favor of the `RSpec/Dialect` cop.

Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.27.0 to 3.0.1.
- [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.27.0...v3.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

[1] https://docs.rubocop.org/rubocop-rspec/upgrade_to_version_3.html
[2] https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecdialect
2024-07-21 22:25:43 +02:00
dependabot[bot]
b1986ff164 Bump rexml from 3.3.1 to 3.3.2
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.1...v3.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-21 20:22:20 +00:00
Javi Martín
2b69e3c814 Merge pull request #5564 from consuldemocracy/dependabot/bundler/rubocop-1.64.1
Bump rubocop from 1.61.0 to 1.64.1
2024-07-21 22:21:33 +02:00
dependabot[bot]
3be475e582 Bump toshimaru/auto-author-assign from 1.4.0 to 2.1.1
Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 1.4.0 to 2.1.1.
- [Release notes](https://github.com/toshimaru/auto-author-assign/releases)
- [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/toshimaru/auto-author-assign/compare/v1.4.0...v2.1.1)

---
updated-dependencies:
- dependency-name: toshimaru/auto-author-assign
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-21 20:19:50 +00:00
dependabot[bot]
ca7c9f497a Bump docker/build-push-action from 2 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-21 20:19:44 +00:00
Javi Martín
5dc927abf3 Merge pull request #5611 from consuldemocracy/dependabot_github
Use dependabot to update github actions dependencies
2024-07-21 22:19:19 +02:00
Javi Martín
16315e14d2 Add and apply Style/SuperArguments rubocop rule
This rule was added in rubocop 1.64.0.

For clarity, in order to make it obvious that we're modifying the object
we received, we're excluding the Ahoy initializer, whose code was copied
from the Ahoy documentation.

We're also changing the `Types::BaseObject` class so we don't use a
variable with the same name as the parameter and we don't get a false
positive for this rule.
2024-07-09 11:23:02 +02:00
Javi Martín
46dc4a3163 Add and apply Style/MapIntoArray rubocop rule
This rule was added in rubocop 1.63.0.
2024-07-09 11:23:02 +02:00
dependabot[bot]
71d0faf237 Bump rubocop from 1.61.0 to 1.64.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.61.0 to 1.64.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.61.0...v1.64.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 11:23:00 +02:00
Javi Martín
c913b8481f Merge pull request #5598 from consuldemocracy/dependabot/bundler/rubocop-rails-2.25.1
Bump rubocop-rails from 2.23.1 to 2.25.1
2024-07-05 17:47:11 +02:00