Commit 39a7103d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Implement pipeline activity and size limits

parent 599ba42d
module EE
module Gitlab
module Ci
module Pipeline
module Chain
class Activity < ::Gitlab::Ci::Pipeline::Chain::Base
include ::Gitlab::Ci::Pipeline::Chain::Helpers
def initialize(*)
super
@limit = Pipeline::Quota::Activity
.new(project.namespace, pipeline.project)
end
def perform!
return unless @limit.exceeded?
return unless @command.save_incompleted
# TODO, add failure reason
# TODO, add validation error
@pipeline.drop
end
def break?
@limit.exceeded?
end
end
end
end
end
end
end
module EE
module Gitlab
module Ci
module Pipeline
module Chain
class Size < ::Gitlab::Ci::Pipeline::Chain::Base
include ::Gitlab::Ci::Pipeline::Chain::Helpers
def initialize(*)
super
@limit = Pipeline::Quota::Size
.new(project.namespace, pipeline)
end
def perform!
return unless @limit.exceeded?
return unless @command.save_incompleted
# TODO, add failure reason
# TODO, add validation error
@pipeline.drop
end
def break?
@limit.exceeded?
end
end
end
end
end
end
end
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