Commit fb70724e authored by Stan Hu's avatar Stan Hu

Fix gitlab:*:check Rake tasks

Since code isn't eager loaded in Rake tasks, running `gitlab-rake
gitlab:artifacts:check` would result in:

```
NoMethodError: private method `logger' called for Google::Apis:Module
```

To ensure the Google API logger is available, we explicitly require it
in the `fix_google_api_logger` method.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/225845
parent ef2ce0f3
---
title: Fix gitlab:*:check Rake tasks
merge_request: 35944
author:
type: fixed
...@@ -71,9 +71,8 @@ module Gitlab ...@@ -71,9 +71,8 @@ module Gitlab
# It's already set to Logger::INFO, but acts as if it is set to # It's already set to Logger::INFO, but acts as if it is set to
# Logger::DEBUG, and this fixes it... # Logger::DEBUG, and this fixes it...
def fix_google_api_logger def fix_google_api_logger
if Object.const_defined?('Google::Apis') require 'google/apis'
Google::Apis.logger.level = Logger::INFO Google::Apis.logger.level = Logger::INFO
end
end end
# This should return an ActiveRecord::Relation suitable for calling #in_batches on # This should return an ActiveRecord::Relation suitable for calling #in_batches on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment