Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d0c8120a
Commit
d0c8120a
authored
May 21, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the FF ci_needs_optional
It was enabled by default for 2 milestones. Changelog: other
parent
bfe2457a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
83 deletions
+8
-83
config/feature_flags/development/ci_needs_optional.yml
config/feature_flags/development/ci_needs_optional.yml
+0
-8
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+1
-27
lib/gitlab/ci/config/entry/need.rb
lib/gitlab/ci/config/entry/need.rb
+6
-16
lib/gitlab/ci/pipeline/seed/build.rb
lib/gitlab/ci/pipeline/seed/build.rb
+1
-1
spec/lib/gitlab/ci/config/entry/need_spec.rb
spec/lib/gitlab/ci/config/entry/need_spec.rb
+0
-20
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
+0
-11
No files found.
config/feature_flags/development/ci_needs_optional.yml
deleted
100644 → 0
View file @
bfe2457a
---
name
:
ci_needs_optional
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55468
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/323891
milestone
:
'
13.10'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
doc/ci/yaml/README.md
View file @
d0c8120a
...
...
@@ -2069,14 +2069,7 @@ To download artifacts from a job in the current pipeline, use the basic form of
#### Optional `needs`
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/30680) in GitLab 13.10.
> - [Deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/323891) in GitLab 13.11.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-optional-needs). **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the
**version history**
note above for details.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/323891) in GitLab 14.0.
To need a job that sometimes does not exist in the pipeline, add
`optional: true`
to the
`needs`
configuration. If not defined,
`optional: false`
is the default.
...
...
@@ -2110,25 +2103,6 @@ rspec:
optional
:
true
```
#### Enable or disable optional needs **(FREE SELF)**
Optional needs is under development but ready for production use.
It 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 opt to disable it.
To enable it:
```
ruby
Feature
.
enable
(
:ci_needs_optional
)
```
To disable it:
```
ruby
Feature
.
disable
(
:ci_needs_optional
)
```
### `tags`
Use
`tags`
to select a specific runner from the list of all runners that are
...
...
lib/gitlab/ci/config/entry/need.rb
View file @
d0c8120a
...
...
@@ -35,14 +35,9 @@ module Gitlab
end
def
value
if
::
Feature
.
enabled?
(
:ci_needs_optional
,
default_enabled: :yaml
)
{
name:
@config
,
artifacts:
true
,
optional:
false
}
else
{
name:
@config
,
artifacts:
true
}
end
{
name:
@config
,
artifacts:
true
,
optional:
false
}
end
end
...
...
@@ -66,14 +61,9 @@ module Gitlab
end
def
value
if
::
Feature
.
enabled?
(
:ci_needs_optional
,
default_enabled: :yaml
)
{
name:
job
,
artifacts:
artifacts
||
artifacts
.
nil?
,
optional:
!!
optional
}
else
{
name:
job
,
artifacts:
artifacts
||
artifacts
.
nil?
}
end
{
name:
job
,
artifacts:
artifacts
||
artifacts
.
nil?
,
optional:
!!
optional
}
end
end
...
...
lib/gitlab/ci/pipeline/seed/build.rb
View file @
d0c8120a
...
...
@@ -146,7 +146,7 @@ module Gitlab
end
@needs_attributes
.
flat_map
do
|
need
|
next
if
::
Feature
.
enabled?
(
:ci_needs_optional
,
default_enabled: :yaml
)
&&
need
[
:optional
]
next
if
need
[
:optional
]
result
=
@previous_stages
.
any?
do
|
stage
|
stage
.
seeds_names
.
include?
(
need
[
:name
])
...
...
spec/lib/gitlab/ci/config/entry/need_spec.rb
View file @
d0c8120a
...
...
@@ -25,16 +25,6 @@ RSpec.describe ::Gitlab::Ci::Config::Entry::Need do
it
'returns job needs configuration'
do
expect
(
need
.
value
).
to
eq
(
name:
'job_name'
,
artifacts:
true
,
optional:
false
)
end
context
'when the FF ci_needs_optional is disabled'
do
before
do
stub_feature_flags
(
ci_needs_optional:
false
)
end
it
'returns job needs configuration without `optional`'
do
expect
(
need
.
value
).
to
eq
(
name:
'job_name'
,
artifacts:
true
)
end
end
end
it_behaves_like
'job type'
...
...
@@ -134,16 +124,6 @@ RSpec.describe ::Gitlab::Ci::Config::Entry::Need do
it
'returns job needs configuration'
do
expect
(
need
.
value
).
to
eq
(
name:
'job_name'
,
artifacts:
true
,
optional:
true
)
end
context
'when the FF ci_needs_optional is disabled'
do
before
do
stub_feature_flags
(
ci_needs_optional:
false
)
end
it
'returns job needs configuration without `optional`'
do
expect
(
need
.
value
).
to
eq
(
name:
'job_name'
,
artifacts:
true
)
end
end
end
end
...
...
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
View file @
d0c8120a
...
...
@@ -1101,17 +1101,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
it
"does not return an error"
do
expect
(
subject
.
errors
).
to
be_empty
end
context
'when the FF ci_needs_optional is disabled'
do
before
do
stub_feature_flags
(
ci_needs_optional:
false
)
end
it
"returns an error"
do
expect
(
subject
.
errors
).
to
contain_exactly
(
"'rspec' job needs 'build' job, but it was not added to the pipeline"
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment