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
d2ed2685
Commit
d2ed2685
authored
May 12, 2021
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log more info when dropping jobs on CI minutes exceeded
parent
3c832e79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
ee/app/services/ci/minutes/track_live_consumption_service.rb
ee/app/services/ci/minutes/track_live_consumption_service.rb
+3
-2
ee/spec/services/ci/minutes/track_live_consumption_service_spec.rb
...ervices/ci/minutes/track_live_consumption_service_spec.rb
+5
-2
No files found.
ee/app/services/ci/minutes/track_live_consumption_service.rb
View file @
d2ed2685
...
...
@@ -30,10 +30,11 @@ module Ci
::
Gitlab
::
AppLogger
.
info
(
message:
'Build dropped due to CI minutes limit exceeded'
,
namespace:
root_namespace
.
name
,
project_path:
build
.
project
.
full_path
,
build_id:
build
.
id
,
user_id:
build
.
user_id
)
user_id:
build
.
user_id
,
username:
build
.
user
&
.
username
)
ServiceResponse
.
success
(
message:
'Build dropped due to CI minutes limit exceeded'
,
payload:
{
current_balance:
new_balance
})
else
...
...
ee/spec/services/ci/minutes/track_live_consumption_service_spec.rb
View file @
d2ed2685
...
...
@@ -5,7 +5,8 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
Minutes
::
TrackLiveConsumptionService
do
let
(
:project
)
{
create
(
:project
,
:private
,
shared_runners_enabled:
true
,
namespace:
namespace
)
}
let
(
:namespace
)
{
create
(
:namespace
,
shared_runners_minutes_limit:
100
)
}
let
(
:build
)
{
create
(
:ci_build
,
:running
,
project:
project
,
runner:
runner
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
,
:running
,
project:
project
,
runner:
runner
,
user:
user
)
}
let
(
:runner
)
{
create
(
:ci_runner
,
:instance
)
}
let
(
:service
)
{
described_class
.
new
(
build
)
}
...
...
@@ -53,9 +54,11 @@ RSpec.describe Ci::Minutes::TrackLiveConsumptionService do
it
'logs event'
do
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:info
).
with
(
message:
'Build dropped due to CI minutes limit exceeded'
,
namespace:
project
.
root_namespace
.
name
,
project_path:
project
.
full_path
,
build_id:
build
.
id
,
user_id:
build
.
user_id
)
user_id:
user
.
id
,
username:
user
.
username
)
subject
end
...
...
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