The ApplicationSetting model uses the CacheMarkdownField concern, which updates
the cached HTML when the field is updated in the database. However, in specs,
when we want to test conditions using ApplicationSetting, we stub it, because
this is accessed in different ways throughout the application.
This means that if a spec runs that caches one of the Markdown fields, and a
later spec uses `stub_application_setting` to set the raw value of that field,
the cached value was still the original one. We can work around this by ignoring
the Markdown cache in contexts where we're using `stub_application_setting`.
We could be smarter, and only do this on the Markdown fields of the model, but
this is probably fine.
Moving the check out of the general requests, makes sure we don't have
any slowdown in the regular requests.
To keep the process performing this checks small, the check is still
performed inside a unicorn. But that is called from a process running
on the same server.
Because the checks are now done outside normal request, we can have a
simpler failure strategy:
The check is now performed in the background every
`circuitbreaker_check_interval`. Failures are logged in redis. The
failures are reset when the check succeeds. Per check we will try
`circuitbreaker_access_retries` times within
`circuitbreaker_storage_timeout` seconds.
When the number of failures exceeds
`circuitbreaker_failure_count_threshold`, we will block access to the
storage.
After `failure_reset_time` of no checks, we will clear the stored
failures. This could happen when the process that performs the checks
is not running.
This commit lets a user bypass the automatic signin on the login form,
in order to login with a technical (admin, etc) account
Closes#3786
Signed-off-by: Rémy Coutable <remy@rymai.me>
There were several specs that were failing when run by themselves.
- Use the `helper` object, as per RSpec 3 standards
- Use `assign` to assign instance variables that helpers expect
- Add `StubConfiguration` support module