Commit 2107e6a7 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-11-12

parents 8809a09b 21a3a3e1
......@@ -40,10 +40,8 @@ export default {
failed: __('Failed to deploy to'),
},
data() {
const features = window.gon.features || {};
return {
isStopping: false,
enableCiEnvironmentsStatusChanges: features.ciEnvironmentsStatusChanges,
};
},
computed: {
......@@ -74,10 +72,7 @@ export default {
: '';
},
shouldRenderDropdown() {
return (
this.enableCiEnvironmentsStatusChanges &&
(this.deployment.changes && this.deployment.changes.length > 0)
);
return this.deployment.changes && this.deployment.changes.length > 0;
},
},
methods: {
......
......@@ -16,9 +16,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :set_issuables_index, only: [:index]
before_action :authenticate_user!, only: [:assign_related_issues]
before_action :check_user_can_push_to_source_branch!, only: [:rebase]
before_action do
push_frontend_feature_flag(:ci_environments_status_changes)
end
def index
@merge_requests = @issuables
......
......@@ -142,7 +142,7 @@ class MergeRequestDiff < ActiveRecord::Base
end
def commits_by_shas(shas)
return [] unless shas.present?
return MergeRequestDiffCommit.none unless shas.present?
merge_request_diff_commits.where(sha: shas)
end
......
......@@ -37,7 +37,7 @@ class EnvironmentStatusEntity < Grape::Entity
es.deployment.try(:formatted_deployment_time)
end
expose :changes, if: ->(*) { Feature.enabled?(:ci_environments_status_changes, project) }
expose :changes
private
......
......@@ -174,57 +174,13 @@ describe('Deployment component', () => {
});
});
describe('with `features.ciEnvironmentsStatusChanges` enabled', () => {
beforeEach(() => {
window.gon = window.gon || {};
window.gon.features = window.gon.features || {};
window.gon.features.ciEnvironmentsStatusChanges = true;
vm = mountComponent(Component, { deployment: { ...deploymentMockData } });
});
afterEach(() => {
window.gon.features = {};
});
it('renders dropdown with changes', () => {
expect(vm.$el.querySelector('.js-mr-wigdet-deployment-dropdown')).not.toBeNull();
expect(vm.$el.querySelector('.js-deploy-url-feature-flag')).toBeNull();
});
});
describe('with `features.ciEnvironmentsStatusChanges` disabled', () => {
beforeEach(() => {
window.gon = window.gon || {};
window.gon.features = window.gon.features || {};
window.gon.features.ciEnvironmentsStatusChanges = false;
vm = mountComponent(Component, { deployment: { ...deploymentMockData } });
});
afterEach(() => {
delete window.gon.features.ciEnvironmentsStatusChanges;
});
it('renders the old link to the review app', () => {
expect(vm.$el.querySelector('.js-mr-wigdet-deployment-dropdown')).toBeNull();
expect(vm.$el.querySelector('.js-deploy-url-feature-flag')).not.toBeNull();
});
});
describe('without changes', () => {
beforeEach(() => {
window.gon = window.gon || {};
window.gon.features = window.gon.features || {};
window.gon.features.ciEnvironmentsStatusChanges = true;
delete deploymentMockData.changes;
vm = mountComponent(Component, { deployment: { ...deploymentMockData } });
});
afterEach(() => {
delete window.gon.features.ciEnvironmentsStatusChanges;
});
it('renders the link to the review app without dropdown', () => {
expect(vm.$el.querySelector('.js-mr-wigdet-deployment-dropdown')).toBeNull();
expect(vm.$el.querySelector('.js-deploy-url-feature-flag')).not.toBeNull();
......
......@@ -458,10 +458,6 @@ describe('mrWidgetOptions', () => {
};
beforeEach(done => {
window.gon = window.gon || {};
window.gon.features = window.gon.features || {};
window.gon.features.ciEnvironmentsStatusChanges = true;
vm.mr.deployments.push(
{
...deploymentMockData,
......
......@@ -3079,6 +3079,10 @@ describe MergeRequest do
end
describe '#includes_any_commits?' do
it 'returns false' do
expect(subject.includes_any_commits?([])).to be_falsey
end
it 'returns false' do
expect(subject.includes_any_commits?([Gitlab::Git::BLANK_SHA])).to be_falsey
end
......
......@@ -33,14 +33,6 @@ describe EnvironmentStatusEntity do
it { is_expected.not_to include(:metrics_url) }
it { is_expected.not_to include(:metrics_monitoring_url) }
context 'when :ci_environments_status_changes feature flag is disabled' do
before do
stub_feature_flags(ci_environments_status_changes: false)
end
it { is_expected.not_to include(:changes) }
end
context 'when the user is project maintainer' do
before do
project.add_maintainer(user)
......
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