Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c2d38e98
Commit
c2d38e98
authored
May 10, 2021
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log when build is dropped due to CI minutes exceeded
Changelog: added
parent
877dc25a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
ee/app/services/ci/minutes/track_live_consumption_service.rb
ee/app/services/ci/minutes/track_live_consumption_service.rb
+7
-0
ee/changelogs/unreleased/log-job-failures-when-ci-minutes-exceeded.yml
.../unreleased/log-job-failures-when-ci-minutes-exceeded.yml
+5
-0
ee/spec/services/ci/minutes/track_live_consumption_service_spec.rb
...ervices/ci/minutes/track_live_consumption_service_spec.rb
+10
-0
No files found.
ee/app/services/ci/minutes/track_live_consumption_service.rb
View file @
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
})
...
...
ee/changelogs/unreleased/log-job-failures-when-ci-minutes-exceeded.yml
0 → 100644
View file @
c2d38e98
---
title
:
Log when build is dropped due to CI minutes exceeded
merge_request
:
61381
author
:
type
:
added
ee/spec/services/ci/minutes/track_live_consumption_service_spec.rb
View file @
c2d38e98
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment