Commit Graph

19606 Commits

Author SHA1 Message Date
cyrillefr
5ec6337d47 Add new GraphQL types for budget investments
- added 2 new types
- modified the models to get data through graphQL
- modified the corresponding spec
- also testing that hidden comments do not show up
- modified comments specs bc now it returns comments on budget
  investments
2024-09-30 11:14:01 +02:00
Javi Martín
5a45049273 Merge pull request #5700 from consuldemocracy/dependabot/bundler/google-protobuf-4.27.5
Bump google-protobuf from 4.26.0 to 4.27.5
2024-09-25 11:43:01 +02:00
Javi Martín
b00dcda1c4 Merge pull request #5704 from consuldemocracy/dependabot/bundler/webrick-1.8.2
Bump webrick from 1.8.1 to 1.8.2
2024-09-25 11:40:15 +02:00
Javi Martín
7db38c50d2 Merge pull request #5699 from consuldemocracy/multitenancy_docs
Update multitenancy documentation
2024-09-24 19:12:31 +02:00
dependabot[bot]
a3b3421fd6 Bump google-protobuf from 4.26.0 to 4.27.5
Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf) from 4.26.0 to 4.27.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: google-protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 16:56:00 +00:00
dependabot[bot]
b92c0daff0 Bump webrick from 1.8.1 to 1.8.2
Bumps [webrick](https://github.com/ruby/webrick) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/ruby/webrick/releases)
- [Commits](https://github.com/ruby/webrick/compare/v1.8.1...v1.8.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 16:53:51 +00:00
Javi Martín
0a8870ef7d Merge pull request #5701 from consuldemocracy/dependabot/bundler/puma-5.6.9
Bump puma from 5.6.8 to 5.6.9
2024-09-24 18:53:02 +02:00
Javi Martín
08cceceed8 Update multitenancy documentation
Most of it was up-to-date, except for the fact that Consul Democracy
already uses Rails 7.0 and that it's possible to use different languages
per tenant since commit 6de4737b7.
2024-09-24 18:47:13 +02:00
Javi Martín
32d9118d1e Fix typos in multitenancy documentation 2024-09-24 18:47:13 +02:00
Javi Martín
53c7d19b8b Merge pull request #5689 from consuldemocracy/remotely_translatable_test
Directly select language in remotely translatable tests
2024-09-24 17:51:24 +02:00
Javi Martín
3e44eeaee0 Directly select language in remotely translatable tests
The test "request a translation of an already translated text" was
failing sometimes on our CI since August 29, maybe due to a change in
GitHub Actions since the test had been passing for a year and a half and
we didn't change any code around that time (we were updating the
documentation). While the root cause is unknown, debugging shows that
sometimes (usually the first time this test is executed on our CI, and
only the first time, since running it 600 tests in a row also resulted
in only one failure) the request done by clicking on "Traducir página"
is done with a user session where the locale is in English.

This doesn't make much sense, since both user sessions are already in
Spanish (and we had either explicit or implicit expectations to confirm
that), and debugging shows that the session is indeed in Spanish during
the previous request.

In any case, we're solving it by never using English during the test,
since it wasn't necessary; it was only done that way because all the
tests on this file used the language selector to get to the Spanish
pages. We're simplifying some of the other tests the same way.

The test failure was:

```
Failure/Error: expect(page).to have_content "Se han solicitado
correctamente las traducciones"
expected to find text "Se han solicitado correctamente las traducciones"
in
"Idioma: \n
\nEnglish\nDeutsch\nEspañol\nFrançais\nNederlands\nPortuguês
brasileiro\n中文\n
Entrar\nRegistrarse\nDebates\nPropuestas\nVotaciones\nLegislación
colaborativa\nPresupuestos participativos\nODS\nAyuda\n×\nTranslations
have been correctly requested.\nPropuestas más activas\nAhora mismo no
hay propuestas\nDebates más activos\nndfrrqufrp\nVer todos los
debates\nProcesos abiertos\nAhora mismo no hay procesos
abiertos\nGobierno abierto\nEste portal usa la aplicación CONSUL
DEMOCRACY que es software de código abierto.\nParticipación\nDecide cómo
debe ser la ciudad que quieres.\nCONSUL DEMOCRACY, 2024 Política de
privacidad Condiciones de uso Accesibilidad"
```

Note that most of the text is in Spanish (as expected) but the flash
message itself is in English.
2024-09-24 16:54:02 +02:00
Javi Martín
314019bee7 Remove database expectations in remotely translatable tests
In the past, having this kind of expectations after the process running
the browser has started has resulted in flaky issues with the database
connection.

In one case, we're removing the test because there are controller tests
covering the same scenario and a system test checking what happens from
the user perspective.

In the other case, we're replacing the expectations with expectations
from the user's point of view.
2024-09-24 16:54:02 +02:00
Javi Martín
3ab9fb1d27 Simplify similar remotely translatable tests
We were using the same setup in these tests, and we were only changing
the expectations or adding an extra step.

Note we're also using `refresh` to simplify the code and because we were
using `select "Español", from: "Idioma:"` when that language was already
selected.
2024-09-24 16:54:02 +02:00
Javi Martín
95dc70acee Remove parentheses in remove translatable expectations
So it's consistent with both the rest of the file and what we usually
do.
2024-09-24 16:53:53 +02:00
Javi Martín
d636f1fe75 Add missing expectations in remotely translatable tests
After changing the language, we were checking that certain content isn't
there.

However, the content wasn't there before changing the language either,
so the test will pass even if the request to change the language hasn't
finished.

Although this is probably OK because we aren't changing the language
using an AJAX request, and so Capybara will correctly wait until the
request is finished before finishing the test, confirming that the page
has changed after a request is something we try to do in every test.
2024-09-24 16:53:45 +02:00
dependabot[bot]
d7457e8821 Bump puma from 5.6.8 to 5.6.9
Bumps [puma](https://github.com/puma/puma) from 5.6.8 to 5.6.9.
- [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.8...v5.6.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-20 19:31:00 +00:00
Javi Martín
8277336a7e Merge pull request #5697 from consuldemocracy/recommendation_docs
Update recommendations documentation
2024-09-20 14:32:27 +02:00
Javi Martín
d5fd7b77fd Merge pull request #5693 from consuldemocracy/docker_docs
Update Docker installation documentation
2024-09-19 16:17:28 +02:00
Javi Martín
d86299f44d Add documentation to run tests with Docker 2024-09-19 15:41:32 +02:00
Javi Martín
b3facb39bf Don't use an image to show the results of docker ps
The alternative text of the image was useless, and we were depending on
an external server in order to display it. Furthermore, the text inside
the image was pretty small.

So we're displaying the output of the command as plain text.
2024-09-19 15:20:38 +02:00
Javi Martín
d88ea7f26d Use build+create in Docker installation instructions
There was a typo where we said we were creating the containers but we
were building the image.

While none of these commands are necessary because they're run
automatically when first running the `db:create` rake task, I think it's
better to show them separately, since the `build` command might be used
to rebuild the image, and running the `create` command separately makes
it easier to know what's going on.

We're also removing the "start database service" step, since it's
automatically started because the app service depends on it.

Finally, we're updating one command for macOS.
2024-09-19 15:20:38 +02:00
Javi Martín
2f5ddfd77e Simplify documentation to install Docker
Docker and Docker Compose are included in most Linux distributions, and
we don't know whether the windows error we talked about is still
relevant in 2024. In any case, the Docker documentation to install
windows is a better resource for that than our documentation.

We're also using the same Docker commands for every operating system.
2024-09-19 15:20:14 +02:00
Javi Martín
148ff3c2be Move Docker documentation to the local installation section
Having it under the production installation section was confusing, since
it contains instructions for local development.
2024-09-19 15:18:06 +02:00
Javi Martín
9f37547f4b Merge pull request #5694 from consuldemocracy/basic_configuration_docs
Update basic configuration guides
2024-09-19 14:59:11 +02:00
Javi Martín
ad98a6a86f Merge pull request #5631 from consuldemocracy/dependabot/bundler/mini_magick-4.13.2
Bump mini_magick from 4.12.0 to 4.13.2
2024-09-19 14:38:01 +02:00
Javi Martín
333108374b Merge pull request #5687 from consuldemocracy/knapsack7
Exclude irrelevant Consul Democracy tests in knapsack
2024-09-19 14:37:26 +02:00
Javi Martín
9342ad757b Update links to user documentation and guides 2024-09-19 14:33:41 +02:00
Javi Martín
f133bc14a8 Add documentation to change the admin credentials
This is something really important, and we weren't mentioning it.
2024-09-19 14:33:41 +02:00
Javi Martín
71da9f4cda Update basic configuration guide
Other than checking typos and styling, we're removing references to
"Main URL" (which isn't used since commit f87165851), and updating the
process to configure the map.
2024-09-19 14:33:38 +02:00
dependabot[bot]
d26cc9aa20 Bump mini_magick from 4.12.0 to 4.13.2
Bumps [mini_magick](https://github.com/minimagick/minimagick) from 4.12.0 to 4.13.2.
- [Release notes](https://github.com/minimagick/minimagick/releases)
- [Commits](https://github.com/minimagick/minimagick/compare/v4.12.0...v4.13.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-19 11:39:51 +00:00
Javi Martín
6d6a57636f Exclude irrelevant Consul Democracy tests in knapsack
In a fork of Consul Democracy, people can use the `:consul` task on a
test that is relevant in the original Consul Democracy but doesn't apply
to them due to their custom changes. So we're excluding tests with this
tag when running the test suite.

Knapsack 7, which we adopted in commit 070cb3185, changed the way to
exclude these tags in RSpec when using Queue Mode [1]. It now ignores
the `filter_run_excluding` option, so we have to pass the argument
directly to the knapsack task.

We're still keeping the `filter_run_excluding` option so it's used when
running the tests on a development machine. The downside, of course, is
that now we have duplicate code.

[1] https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md#700
2024-09-19 13:38:31 +02:00
Javi Martín
a693258e41 Update recommendations documentation
No big changes here, other than adding proper alternative texts in
Spanish.
2024-09-19 13:35:58 +02:00
Javi Martín
307d1c75fe Merge pull request #5692 from consuldemocracy/env_dockerfile
Fix environment variables and version warnings in Docker
2024-09-18 16:37:46 +02:00
Javi Martín
4a1615accb Remove version attribute in docker-compose
Using a recent version of Docker Compose, we were getting a warning:

```
docker-compose.yml: the attribute `version` is obsolete, it will be
ignored, please remove it to avoid potential confusion
```

This attribute is obsolete since Docker Compose 1.27, released in 2020,
so most developers won't be affected by this change. Developers using
really old versions of Docker Compose might have to upgrade their Docker
Compose.
2024-09-18 15:59:39 +02:00
Javi Martín
9a17fe740c Correctly declare environment variables in Dockerfile
We were getting warnings in our CI:

> Legacy key/value format with whitespace separator should not be used
> LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy
> "ENV key value" format

So we're updating the code as mentioned in the Docker documentation [1]

[1] https://docs.docker.com/reference/build-checks/legacy-key-value-format/
2024-09-18 15:59:39 +02:00
Javi Martín
a8ea917c10 Merge pull request #5691 from consuldemocracy/update_docker_postgres
Use a maintained version of PostgreSQL in Docker
2024-09-18 15:59:03 +02:00
Javi Martín
1c68ad3a2a Use a maintained PostgreSQL version in Docker
We're using version 13 because it's the one included in Debian Bullseye,
which is the operating system we currently use in our Dockerfile.

For consistency, we're using the same version in GitHub Actions.

Note this image requires setting a password. Otherwise we get an error:

> Database is uninitialized and superuser password is not specified.
> You must specify POSTGRES_PASSWORD to a non-empty value for the
> superuser. For example, "-e POSTGRES_PASSWORD=password" on
> "docker run".

Since now we're setting a password in the postgres service, we also need
to provide the `PGPASSWORD` environment variable (or to specify the
password in the `database.yml` file, which we do for GitLab since it
uses a separate database configuration file). Otherwise we get an error:

```
PG::ConnectionBad: connection to server at "::1", port 5432 failed:
fe_sendauth: no password supplied (PG::ConnectionBad)
```
2024-09-18 15:44:50 +02:00
Javi Martín
0163ca88c3 Remove unneeded POSTGRES_HOST option in CI workflows
Not sure whether it was needed when we included it, but everything is
working fine without it.
2024-09-18 15:35:14 +02:00
Javi Martín
da672e2dd4 Merge pull request #5690 from consuldemocracy/fix_docker_npm
Don't overwrite node_modules with Docker Compose
2024-09-18 15:33:47 +02:00
Javi Martín
40d82037d1 Don't overwrite node_modules with Docker Compose
When creating the Dockerfile, we run `npm install`, which creates a
`node_modules` folder inside the working directory.

However, when using docker-compose, we overwrite the contents of that
working directory (/var/www/consul) with the contents of the host
machine's working directory. This means that, unless the `npm install`
command is run on the host machine to create a `node_modules` folder on
the host machine (which would pretty much defeat the point of using
Docker), the container won't have a `node_modules` folder and the
application won't run.

So we're defining a volume in docker-compose.yml to make sure we keep
the container's `node_modules` folder.
2024-09-18 15:01:59 +02:00
Javi Martín
18dfa643f0 Merge pull request #5686 from consuldemocracy/delayed_job_bundle_exec
Use bundle exec to run delayed jobs on reboot
2024-09-18 14:29:15 +02:00
Javi Martín
3cdf7194a0 Use bundle exec to run delayed jobs on reboot
When running delayed_job on reboot using Consul Democracy 2.2.0, we were
getting an error:

```
`require': cannot load such file -- sassc-embedded (LoadError)
from <internal:rubygems/core_ext/kernel_require.rb>:86:in `require'
from config/application.rb:1:in
```

No idea why this gem isn't detected when running `bin/delayed_job`.
When deploying with Capistrano, we use `bundle exec bin/delayed_job`,
and that works fine, so we're using it here as well.

We had already fixed this issue in the Cosul Democracy installer [1],
but forgot to configure the Cron job to do the same.

[1] https://github.com/consuldemocracy/installer/commit/3dc69eb6
2024-09-18 14:13:22 +02:00
Javi Martín
ddfe723e25 Merge pull request #5688 from consuldemocracy/proposal_ui_tests
Make "show proposal" tests pass on GitHub Actions
2024-09-17 15:57:40 +02:00
Javi Martín
ec0bcd4277 Use a more realistic size for small window tests
The resolution of most devices is at least 640 pixels in at least one of
their dimensions. Since we need the width to be smaller than 640 pixels,
having a height of 479px wasn't realistic.

Doing so caused the tests checking the sticky "support proposal" tests
to fail because on 480px-high devices the sticky message covers the
whole screen.

This is a usability issue, but since I'm not sure how many people use
such a small window when browsing the web, for now I'm simply changing
the tests.

We're changing the width to 320px since it's the width required by the
Web Content Accessibility Guidelines 2.2. Quoting these guidelines [1]:

> Content can be presented without loss of information or functionality,
> and without requiring scrolling in two dimensions for:

> * Vertical scrolling content at a width equivalent to 320 CSS pixels;
> * Horizontal scrolling content at a height equivalent to 256 CSS
>   pixels.

Note that, using a height of 256px, the sticky message would make the
application unusable, though. IMHO we'll have to get rid of the sticky
message sooner or later.
2024-09-17 15:09:21 +02:00
Javi Martín
bedcb5bca2 Don't include videos in proposal factories
Since August 29, probably due to a change in the browser used by GitHub
Actions (since branches whose code we didn't change were suddenly
affected that day), many tests related to proposals are failing on
GitHub Actions. Although every time the test suite is run different
tests fail, on each run at least half a dozen tests fail.

Most tests have one thing in common: they click on an element on the
`proposals#show` page, and the click isn't done correctly.

One possible explanation is that the video included on the page causes
the page to scroll at the exact same time that Capybara is clicking on a
link, which results in a misclick.

I haven't been able to reproduce the issue on my machine, so I'm not
sure whether giving the video element a fixed height using CSS (so the
page doesn't scroll when the iframe is loaded) could solve the issue.
But, after using proposals without videos in the tests (except the tests
testing the videos themselves), all these tests are passing in the test
suite.

So, for now, we're simply removing the videos in the proposal factories.

Note this issue wasn't caused by the "no cookie" changes done in commit
ee64efe659, since running the tests in Cosul Democracy 2.1.1 (which
didn't contain those changes) also fails on GitHub Actions.
2024-09-17 15:09:17 +02:00
Javi Martín
3c6631d436 Merge pull request #5661 from consuldemocracy/dependabot/npm_and_yarn/micromatch-4.0.8
Bump micromatch from 4.0.7 to 4.0.8
2024-09-12 01:02:29 +02:00
Sebastia
6991bf08df Merge pull request #5655 from consuldemocracy/getting-started-docs
Update getting started instructions
2024-09-11 16:24:55 +02:00
taitus
d6efd4edb3 Update communication instructions 2024-09-11 14:13:11 +02:00
taitus
0a83661e95 Update 'Keep your fork updated' instructions 2024-09-11 14:13:11 +02:00
taitus
e858e226cd Update configuration instructions 2024-09-11 14:13:11 +02:00