Commit 1622d29a authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch 'log-job-failures-when-ci-minutes-exceeded' into 'master'

Log when build is dropped due to CI minutes exceeded

See merge request gitlab-org/gitlab!61381
parents d91bfcda c2d38e98
......@@ -28,6 +28,13 @@ module Ci
build.drop(:ci_quota_exceeded)
metrics.ci_minutes_exceeded_builds_counter.increment
::Gitlab::AppLogger.info(
message: 'Build dropped due to CI minutes limit exceeded',
project_path: build.project.full_path,
build_id: build.id,
user_id: build.user_id
)
ServiceResponse.success(message: 'Build dropped due to CI minutes limit exceeded', payload: { current_balance: new_balance })
else
ServiceResponse.success(message: 'CI minutes limit not exceeded', payload: { current_balance: new_balance })
......
---
title: Log when build is dropped due to CI minutes exceeded
merge_request: 61381
author:
type: added
......@@ -49,6 +49,16 @@ RSpec.describe Ci::Minutes::TrackLiveConsumptionService do
expect(service.live_consumption.to_i).to eq(minutes_consumption)
end
it 'logs event' do
expect(Gitlab::AppLogger).to receive(:info).with(
message: 'Build dropped due to CI minutes limit exceeded',
project_path: project.full_path,
build_id: build.id,
user_id: build.user_id)
subject
end
end
context 'when build is not running' do
......
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