Commit Graph

20028 Commits

Author SHA1 Message Date
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
Javi Martín
b42d4115cb Merge pull request #5685 from consuldemocracy/customization_docs
Update documentation to customize the application
2024-09-11 13:46:25 +02:00
Javi Martín
9d818b4ec2 Make it easier to add custom routes
Until now, people had to edit the original route files in order to add
custom routes.

This was inconsistent with the other customizations, since we use custom
folders or files for customizing controllers, components, views, ...
(which you usually customize as well when adding a new route).

So now we're providing a file for custom routes, which will make it
easier to know which routes are not present in Consul Democracy by
default.
2024-09-11 13:27:48 +02:00
Javi Martín
ee089a5209 Update customization docs introduction 2024-09-11 13:27:48 +02:00
Javi Martín
136edb97e9 Update documentation to customize translations 2024-09-11 13:27:48 +02:00
taitus
6f692abdf8 Update getting started and create instructions 2024-09-11 09:47:56 +02:00
Javi Martín
3a01e171b8 Add documentation about tests customization 2024-09-10 14:54:20 +02:00
Javi Martín
64d6460215 Update documentation to customize images 2024-09-10 14:54:20 +02:00
Javi Martín
9b08a73156 Update documentation for CSS customization 2024-09-10 14:29:51 +02:00
Javi Martín
ced834200a Update documentation to customize JavaScript
Note that, while it doesn't really affect the way the application
behaves (as long as the JavaScript code doesn't rely on the order it's
loaded) we're requiring `app/assets/javascripts/custom.js` after
requiring any files in the `app/assets/javascripts/custom/` folder. This
is done for consistency, since we load the content of
`app/assets/javascripts/application.js` after requiring everything else.
2024-09-10 14:29:51 +02:00
Javi Martín
a8250a6f46 Fix typos in gemfile customization docs 2024-09-10 14:07:43 +02:00
Javi Martín
58a5b7e627 Add documentation to customize other Ruby classes 2024-09-10 14:07:43 +02:00
Javi Martín
19e12d9053 Update documentation to customize components 2024-09-10 14:07:43 +02:00
Javi Martín
7a1f78ddf3 Update documentation to customize views 2024-09-10 14:07:43 +02:00
Javi Martín
a4063d0ec0 Update documentation to customize the application config 2024-09-09 16:44:51 +02:00
Javi Martín
0b928e52b1 Add documentation to customize controllers 2024-09-09 16:41:08 +02:00
Javi Martín
fce300a11a Update models customization documentation 2024-09-09 16:41:08 +02:00
Javi Martín
d3fa99332c Update files and folders used to customize the application 2024-09-04 13:20:00 +02:00
Javi Martín
f45ad68407 Move user translations docs to the features section
The documentation of user content translations doesn't really belong in
the customization introduction.
2024-09-02 15:18:13 +02:00
Javi Martín
8663778245 Add missing folders for custom code
We were loading these folders in `application.rb`, but they didn't exist
by default.
2024-09-02 15:03:24 +02:00
dependabot[bot]
c047a2d279 Bump micromatch from 4.0.7 to 4.0.8
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.7...4.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-29 15:25:59 +00:00
Javi Martín
e0ae3832ec Merge pull request #5658 from consuldemocracy/dependabot/bundler/rexml-3.3.6
Bump rexml from 3.3.3 to 3.3.6
2024-08-29 17:25:11 +02:00
Javi Martín
1addd96fde Merge pull request #5660 from consuldemocracy/custom_locales_order
Fix custom locales not taking precedence
2024-08-29 17:22:23 +02:00
Javi Martín
75ebc1bd98 Fix custom locales not taking precedence
When we upgraded to Rails 7 in commit 8596f1539, we broke the custom
locales since now all nested folders in `config/locales/` are loaded by
default [1]. This meant that the custom folder was now loaded before any
languages whose code alphabetically goes after the word "custom".

As a workaround, we're overwriting the default locales paths so they
don't include the custom folder. We're doing this step before the
`add_locales` initializer; that is, before the default locales paths are
used.

Unfortunately, I haven't found a way to add a test for this behavior,
since we would need to add a file in `config/locales/custom` that
overwrites an internationalization key for an existing language, but
only during a specific test, and the i18n load path is evaluated when
the application starts up.

[1] See pull request 41872 in https://github.com/rails/rails/
2024-08-28 14:34:12 +02:00
dependabot[bot]
9a98843e4b Bump rexml from 3.3.3 to 3.3.6
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.3 to 3.3.6.
- [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.3...v3.3.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 20:51:58 +00:00
Javi Martín
77452fc48d Merge pull request #5651 from consuldemocracy/ruby3.2.5
Upgrade Ruby to version 3.2.5
2024-08-19 17:11:54 +02:00
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