Commit 40dd12c7 authored by Olivier Gonzalez's avatar Olivier Gonzalez Committed by Douwe Maan

Resolve "Deprecate Gemnasium project service"

parent f0fbdad9
......@@ -3,6 +3,7 @@ require "gemnasium/gitlab_service"
class GemnasiumService < Service
prop_accessor :token, :api_key
validates :token, :api_key, presence: true, if: :activated?
validate :deprecation_validation
def title
'Gemnasium'
......@@ -27,6 +28,18 @@ class GemnasiumService < Service
%w(push)
end
def deprecated?
true
end
def deprecation_message
"Gemnasium has been acquired by GitLab in January 2018. Since May 15, 2018, the service provided by Gemnasium is no longer available."
end
def deprecation_validation
errors[:base] << deprecation_message
end
def execute(data)
return unless supported_events.include?(data[:object_kind])
......
......@@ -253,7 +253,6 @@ class Service < ActiveRecord::Base
emails_on_push
external_wiki
flowdock
gemnasium
hipchat
irker
jira
......
---
title: Deprecate Gemnasium project service
merge_request: 18954
author:
type: deprecated
class RemoveGemnasiumService < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
disable_statement_timeout
execute("DELETE FROM services WHERE type='GemnasiumService';")
end
def down
# noop
end
end
......@@ -405,6 +405,13 @@ GET /projects/:id/services/flowdock
Gemnasium monitors your project dependencies and alerts you about updates and security vulnerabilities.
CAUTION: **Warning:**
Gemnasium service integration has been deprecated in GitLab 11.0. Gemnasium has been
[acquired by GitLab](https://about.gitlab.com/press/releases/2018-01-30-gemnasium-acquisition.html)
in January 2018 and since May 15, 2018, the service provided by Gemnasium is no longer available.
You can [migrate from Gemnasium to GitLab](https://docs.gitlab.com/ee/user/project/import/gemnasium.html)
to keep monitoring your dependencies.
### Create/Edit Gemnasium service
Set Gemnasium service for a project.
......
......@@ -34,7 +34,7 @@ Click on the service links to see further configuration instructions and details
| [Emails on push](emails_on_push.md) | Email the commits and diff of each push to a list of recipients |
| External Wiki | Replaces the link to the internal wiki with a link to an external wiki |
| Flowdock | Flowdock is a collaboration web app for technical teams |
| Gemnasium | Gemnasium monitors your project dependencies and alerts you about updates and security vulnerabilities |
| Gemnasium _(Has been deprecated in GitLab 11.0)_ | Gemnasium monitors your project dependencies and alerts you about updates and security vulnerabilities |
| [HipChat](hipchat.md) | Private group chat and IM |
| [Irker (IRC gateway)](irker.md) | Send IRC messages, on update, to a list of recipients through an Irker gateway |
| [JIRA](jira.md) | JIRA issue tracker |
......
......@@ -6759,26 +6759,6 @@
"default": false,
"wiki_page_events": true
},
{
"id": 92,
"title": "Gemnasium",
"project_id": 5,
"created_at": "2016-06-14T15:01:51.202Z",
"updated_at": "2016-06-14T15:01:51.202Z",
"active": false,
"properties": {},
"template": false,
"push_events": true,
"issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"job_events": true,
"type": "GemnasiumService",
"category": "common",
"default": false,
"wiki_page_events": true
},
{
"id": 91,
"title": "Flowdock",
......
......@@ -26,24 +26,49 @@ describe GemnasiumService do
end
end
describe "deprecated?" do
let(:project) { create(:project, :repository) }
let(:gemnasium_service) { described_class.new }
before do
allow(gemnasium_service).to receive_messages(
project_id: project.id,
project: project,
service_hook: true,
token: 'verySecret',
api_key: 'GemnasiumUserApiKey'
)
end
it "is true" do
expect(gemnasium_service.deprecated?).to be true
end
it "can't create a new service" do
expect(gemnasium_service.save).to be false
expect(gemnasium_service.errors[:base].first)
.to eq('Gemnasium has been acquired by GitLab in January 2018. Since May 15, 2018, the service provided by Gemnasium is no longer available.')
end
end
describe "Execute" do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:gemnasium_service) { described_class.new }
let(:sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
before do
@gemnasium_service = described_class.new
allow(@gemnasium_service).to receive_messages(
allow(gemnasium_service).to receive_messages(
project_id: project.id,
project: project,
service_hook: true,
token: 'verySecret',
api_key: 'GemnasiumUserApiKey'
)
@sample_data = Gitlab::DataBuilder::Push.build_sample(project, user)
end
it "calls Gemnasium service" do
expect(Gemnasium::GitlabService).to receive(:execute).with(an_instance_of(Hash)).once
@gemnasium_service.execute(@sample_data)
gemnasium_service.execute(sample_data)
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