Commit fcd62e2b authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '258206-enable-gitpod-flag-by-default' into 'master'

Enable gitpod feature flag by default

See merge request gitlab-org/gitlab!43961
parents acf5211f c84ed9be
---
title: Enable Gitpod button on file tree view
merge_request: 43961
author:
type: added
---
name: gitpod
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37985
rollout_issue_url:
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/258206
group: group::editor
type: development
default_enabled: false
\ No newline at end of file
default_enabled: true
......@@ -8,7 +8,8 @@ info: "To determine the technical writer assigned to the Stage/Group associated
# Gitpod Integration
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/228893) in GitLab 13.4.
> - It's [deployed behind a feature flag](#enable-or-disable-the-gitpod-integration), disabled by default.
> - It was [deployed behind a feature flag](#enable-or-disable-the-gitpod-integration), disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/258206) in GitLab 13.5.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#configure-your-gitlab-instance-with-gitpod). **(CORE ONLY)**
......@@ -57,19 +58,18 @@ and get your instance up and running.
## Enable or disable the Gitpod integration **(CORE ONLY)**
The Gitpod integration is under development and not ready for production use. It is deployed behind a
feature flag that is **disabled by default**.
The Gitpod integration is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md)
can enable it.
can enable or disable it.
To enable it:
To disable it:
```ruby
Feature.enable(:gitpod)
Feature.disable(:gitpod)
```
To disable it:
To enable it:
```ruby
Feature.disable(:gitpod)
Feature.enable(:gitpod)
```
......@@ -3,17 +3,13 @@
module Gitlab
class Gitpod
class << self
def feature_conditional?
feature.conditional?
end
def feature_available?
# The gitpod_bundle feature could be conditionally applied, so check if `!off?`
!feature.off?
!feature.off? || feature_enabled?
end
def feature_enabled?(actor = nil)
feature.enabled?(actor)
Feature.enabled?(:gitpod, actor, default_enabled: true)
end
def feature_and_settings_enabled?(actor = nil)
......
......@@ -4,30 +4,29 @@ require 'spec_helper'
RSpec.describe Gitlab::Gitpod do
let_it_be(:user) { create(:user) }
let(:feature_scope) { true }
before do
stub_feature_flags(gitpod: feature_scope)
end
describe '.feature_conditional?' do
subject { described_class.feature_conditional? }
context 'when feature is enabled globally' do
it { is_expected.to be_falsey }
end
describe '.feature_available?' do
subject { described_class.feature_available? }
context 'when feature is enabled only to a resource' do
let(:feature_scope) { user }
context 'when feature has not been set' do
let(:feature_scope) { nil }
it { is_expected.to be_truthy }
end
end
describe '.feature_available?' do
subject { described_class.feature_available? }
context 'when feature is disabled' do
let(:feature_scope) { false }
it { is_expected.to be_falsey }
end
context 'when feature is enabled globally' do
let(:feature_scope) { true }
it { is_expected.to be_truthy }
end
......@@ -43,7 +42,15 @@ RSpec.describe Gitlab::Gitpod do
subject { described_class.feature_enabled?(current_user) }
context 'when feature has not been set' do
let(:feature_scope) { nil }
it { is_expected.to be_truthy }
end
context 'when feature is enabled globally' do
let(:feature_scope) { true }
it { is_expected.to be_truthy }
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