Commit 118f63ba authored by Allison Browne's avatar Allison Browne

Move Badge under Ci namespace

Gitlab::Badge => Gitlab::Ci::Badge
parent 1252d865
......@@ -9,7 +9,7 @@ class Projects::BadgesController < Projects::ApplicationController
feature_category :continuous_integration
def pipeline
pipeline_status = Gitlab::Badge::Pipeline::Status
pipeline_status = Gitlab::Ci::Badge::Pipeline::Status
.new(project, params[:ref], opts: {
ignore_skipped: params[:ignore_skipped],
key_text: params[:key_text],
......@@ -20,7 +20,7 @@ class Projects::BadgesController < Projects::ApplicationController
end
def coverage
coverage_report = Gitlab::Badge::Coverage::Report
coverage_report = Gitlab::Ci::Badge::Coverage::Report
.new(project, params[:ref], opts: {
job: params[:job],
key_text: params[:key_text],
......
......@@ -145,8 +145,8 @@ module Projects
def define_badges_variables
@ref = params[:ref] || @project.default_branch || 'master'
@badges = [Gitlab::Badge::Pipeline::Status,
Gitlab::Badge::Coverage::Report]
@badges = [Gitlab::Ci::Badge::Pipeline::Status,
Gitlab::Ci::Badge::Coverage::Report]
@badges.map! do |badge|
badge.new(@project, @ref).metadata
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
class Base
def entity
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
module Coverage
##
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
module Coverage
##
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
module Coverage
##
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
##
# Abstract class for badge metadata
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
module Pipeline
##
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
module Pipeline
##
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
module Pipeline
##
......
# frozen_string_literal: true
module Gitlab
module Gitlab::Ci
module Badge
##
# Abstract template class for badges
......
# frozen_string_literal: true
require 'spec_helper'
require 'lib/gitlab/badge/shared/metadata'
require 'lib/gitlab/ci/badge/shared/metadata'
RSpec.describe Gitlab::Badge::Coverage::Metadata do
RSpec.describe Gitlab::Ci::Badge::Coverage::Metadata do
let(:badge) do
double(project: create(:project), ref: 'feature', job: 'test')
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Badge::Coverage::Report do
RSpec.describe Gitlab::Ci::Badge::Coverage::Report do
let_it_be(:project) { create(:project) }
let_it_be(:success_pipeline) { create(:ci_pipeline, :success, project: project) }
let_it_be(:running_pipeline) { create(:ci_pipeline, :running, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Badge::Coverage::Template do
RSpec.describe Gitlab::Ci::Badge::Coverage::Template do
let(:badge) { double(entity: 'coverage', status: 90.00, customization: {}) }
let(:template) { described_class.new(badge) }
......
# frozen_string_literal: true
require 'spec_helper'
require 'lib/gitlab/badge/shared/metadata'
require 'lib/gitlab/ci/badge/shared/metadata'
RSpec.describe Gitlab::Badge::Pipeline::Metadata do
RSpec.describe Gitlab::Ci::Badge::Pipeline::Metadata do
let(:badge) { double(project: create(:project), ref: 'feature') }
let(:metadata) { described_class.new(badge) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Badge::Pipeline::Status do
RSpec.describe Gitlab::Ci::Badge::Pipeline::Status do
let(:project) { create(:project, :repository) }
let(:sha) { project.commit.sha }
let(:branch) { 'master' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Badge::Pipeline::Template do
RSpec.describe Gitlab::Ci::Badge::Pipeline::Template do
let(:badge) { double(entity: 'pipeline', status: 'success', customization: {}) }
let(:template) { described_class.new(badge) }
......
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