Expire CurrentSettings when checking job status
What does this MR do?
The status_create_self_monitoring_project
and status_delete_self_monitoring_project
APIs check the status of create & delete Sidekiq jobs respectively by checking if the self-monitoring project has been created/deleted (as well as by checking if the job has completed). The ID of the self-monitoring project is stored in the application_settings
table.
The create Sidekiq job saves the project ID into the application_settings
table and the delete job deletes it. Since the change to the application_settings
table happens in a Sidekiq job, Gitlab::CurrentSettings
in the controller might still contain the old instance_administration_project_id
.
Therefore, this MR:
-
Calls
Gitlab::CurrentSettings.expire_current_application_settings
before checking the value ofGitlab::CurrentSettings.instance_administration_project_id
. -
This MR also moves the
.in_progress?
check above the check forGitlab::CurrentSettings.instance_administration_project_id
, so that we only expire the cache once the job has completed.
Issue: #197968 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team