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.
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.
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.
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.
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
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.
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/
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)
```
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.
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
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.
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.
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.
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.