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
f73dd5b8
Commit
f73dd5b8
authored
Oct 14, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed :monaco_ci flag
Removed all instances and conditions for the flag from both HAML and JS files.
parent
57a7d29d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
129 deletions
+70
-129
app/assets/javascripts/pages/projects/ci/lints/ci_lint_editor.js
...ets/javascripts/pages/projects/ci/lints/ci_lint_editor.js
+13
-29
app/views/projects/ci/lints/show.html.haml
app/views/projects/ci/lints/show.html.haml
+3
-9
config/feature_flags/development/monaco_ci.yml
config/feature_flags/development/monaco_ci.yml
+0
-7
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+0
-1
spec/features/projects/ci/lint_spec.rb
spec/features/projects/ci/lint_spec.rb
+54
-83
No files found.
app/assets/javascripts/pages/projects/ci/lints/ci_lint_editor.js
View file @
f73dd5b8
import
createFlash
from
'
~/flash
'
;
import
{
BLOB_EDITOR_ERROR
}
from
'
~/blob_edit/constants
'
;
import
EditorLite
from
'
~/editor/editor_lite
'
;
export
default
class
CILintEditor
{
constructor
()
{
const
monacoEnabled
=
window
?.
gon
?.
features
?.
monacoCi
;
this
.
clearYml
=
document
.
querySelector
(
'
.clear-yml
'
);
this
.
clearYml
.
addEventListener
(
'
click
'
,
this
.
clear
.
bind
(
this
));
return
monacoEnabled
?
this
.
initEditorLite
()
:
this
.
initAc
e
();
return
this
.
initEditorLit
e
();
}
clear
()
{
...
...
@@ -15,34 +13,20 @@ export default class CILintEditor {
}
initEditorLite
()
{
import
(
/* webpackChunkName: 'monaco_editor_lite' */
'
~/editor/editor_lite
'
)
.
then
(({
default
:
EditorLite
})
=>
{
const
editorEl
=
document
.
getElementById
(
'
editor
'
);
const
fileContentEl
=
document
.
getElementById
(
'
content
'
);
const
form
=
document
.
querySelector
(
'
.js-ci-lint-form
'
);
const
editorEl
=
document
.
getElementById
(
'
editor
'
);
const
fileContentEl
=
document
.
getElementById
(
'
content
'
);
const
form
=
document
.
querySelector
(
'
.js-ci-lint-form
'
);
const
rootEditor
=
new
EditorLite
();
const
rootEditor
=
new
EditorLite
();
this
.
editor
=
rootEditor
.
createInstance
({
el
:
editorEl
,
blobPath
:
'
.gitlab-ci.yml
'
,
blobContent
:
editorEl
.
innerText
,
});
form
.
addEventListener
(
'
submit
'
,
()
=>
{
fileContentEl
.
value
=
this
.
editor
.
getValue
();
});
})
.
catch
(()
=>
createFlash
({
message
:
BLOB_EDITOR_ERROR
}));
}
initAce
()
{
this
.
editor
=
window
.
ace
.
edit
(
'
ci-editor
'
);
this
.
textarea
=
document
.
getElementById
(
'
content
'
);
this
.
editor
=
rootEditor
.
createInstance
({
el
:
editorEl
,
blobPath
:
'
.gitlab-ci.yml
'
,
blobContent
:
editorEl
.
innerText
,
});
this
.
editor
.
getSession
().
setMode
(
'
ace/mode/yaml
'
);
this
.
editor
.
on
(
'
input
'
,
()
=>
{
this
.
textarea
.
value
=
this
.
editor
.
getSession
().
getValue
();
form
.
addEventListener
(
'
submit
'
,
()
=>
{
fileContentEl
.
value
=
this
.
editor
.
getValue
();
});
}
}
app/views/projects/ci/lints/show.html.haml
View file @
f73dd5b8
-
page_title
_
(
"CI Lint"
)
-
page_description
_
(
"Validate your GitLab CI configuration file"
)
-
unless
Feature
.
enabled?
(
:monaco_ci
,
default_enabled:
true
)
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'lib/ace.js'
)
%h2
.pt-3.pb-3
=
_
(
"Validate your GitLab CI configuration"
)
...
...
@@ -17,12 +14,9 @@
.file-holder
.js-file-title.file-title.clearfix
=
_
(
"Contents of .gitlab-ci.yml"
)
-
if
Feature
.
enabled?
(
:monaco_ci
,
default_enabled:
true
)
.file-editor.code
.js-edit-mode-pane.qa-editor
#editor
{
data:
{
'editor-loading'
:
true
}
}
<
%pre
.editor-loading-content
=
params
[
:content
]
-
else
#ci-editor
.ci-editor
=
@content
.file-editor.code
.js-edit-mode-pane.qa-editor
#editor
{
data:
{
'editor-loading'
:
true
}
}
<
%pre
.editor-loading-content
=
params
[
:content
]
=
text_area_tag
(
:content
,
@content
,
class:
'hidden form-control span1'
,
rows:
7
,
require:
true
)
.col-sm-12
.float-left.gl-mt-3
...
...
config/feature_flags/development/monaco_ci.yml
deleted
100644 → 0
View file @
57a7d29d
---
name
:
monaco_ci
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23666
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/249137
group
:
group::editor
type
:
development
default_enabled
:
true
lib/gitlab/gon_helper.rb
View file @
f73dd5b8
...
...
@@ -44,7 +44,6 @@ module Gitlab
# Initialize gon.features with any flags that should be
# made globally available to the frontend
push_frontend_feature_flag
(
:monaco_blobs
,
default_enabled:
true
)
push_frontend_feature_flag
(
:monaco_ci
,
default_enabled:
true
)
push_frontend_feature_flag
(
:webperf_experiment
,
default_enabled:
false
)
push_frontend_feature_flag
(
:snippets_binary_blob
,
default_enabled:
false
)
push_frontend_feature_flag
(
:usage_data_api
,
default_enabled:
false
)
...
...
spec/features/projects/ci/lint_spec.rb
View file @
f73dd5b8
...
...
@@ -8,117 +8,88 @@ RSpec.describe 'CI Lint', :js do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
shared_examples
'correct ci linting process'
do
describe
'YAML parsing'
do
shared_examples
'validates the YAML'
do
before
do
stub_feature_flags
(
ci_lint_vue:
false
)
click_on
'Validate'
end
let
(
:content_selector
)
{
'.content .view-lines'
}
context
'YAML is correct'
do
let
(
:yaml_content
)
do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
)
)
end
before
do
stub_feature_flags
(
ci_lint_vue:
false
)
project
.
add_developer
(
user
)
sign_in
(
user
)
it
'parses Yaml and displays the jobs'
do
expect
(
page
).
to
have_content
(
'Status: syntax is correct'
)
visit
project_ci_lint_path
(
project
)
editor_set_value
(
yaml_content
)
within
"table"
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
'Job - rspec'
)
expect
(
page
).
to
have_content
(
'Job - spinach'
)
expect
(
page
).
to
have_content
(
'Deploy Job - staging'
)
expect
(
page
).
to
have_content
(
'Deploy Job - production'
)
end
end
end
end
wait_for
(
'YAML content'
)
do
find
(
content_selector
).
text
.
present?
end
end
context
'YAML is incorrect'
do
let
(
:yaml_content
)
{
'value: cannot have :'
}
describe
'YAML parsing'
do
shared_examples
'validates the YAML'
do
before
do
stub_feature_flags
(
ci_lint_vue:
false
)
click_on
'Validate'
end
it
'displays information about an error'
do
expect
(
page
).
to
have_content
(
'Status: syntax is incorrect'
)
expect
(
page
).
to
have_selector
(
content_selector
,
text:
yaml_content
)
end
context
'YAML is correct'
do
let
(
:yaml_content
)
do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
end
it_behaves_like
'validates the YAML'
it
'parses Yaml and displays the jobs'
do
expect
(
page
).
to
have_content
(
'Status: syntax is correct'
)
context
'when Dry Run is checked'
do
before
do
check
'Simulate a pipeline created for the default branch'
within
"table"
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
'Job - rspec'
)
expect
(
page
).
to
have_content
(
'Job - spinach'
)
expect
(
page
).
to
have_content
(
'Deploy Job - staging'
)
expect
(
page
).
to
have_content
(
'Deploy Job - production'
)
end
end
end
it_behaves_like
'validates the YAML'
end
describe
'YAML revalidate
'
do
let
(
:yaml_content
)
{
'
my yaml content
'
}
context
'YAML is incorrect
'
do
let
(
:yaml_content
)
{
'
value: cannot have :
'
}
it
'loads previous YAML content after validation'
do
expect
(
page
).
to
have_field
(
'content'
,
with:
'my yaml content'
,
visible:
false
,
type:
'textarea'
)
it
'displays information about an error'
do
expect
(
page
).
to
have_content
(
'Status: syntax is incorrect'
)
expect
(
page
).
to
have_selector
(
content_selector
,
text:
yaml_content
)
end
end
end
describe
'YAML clearing'
do
it_behaves_like
'validates the YAML'
context
'when Dry Run is checked'
do
before
do
c
lick_on
'Clear
'
c
heck
'Simulate a pipeline created for the default branch
'
end
context
'YAML is present'
do
let
(
:yaml_content
)
do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
it
'YAML content is cleared'
do
expect
(
page
).
to
have_field
(
'content'
,
with:
''
,
visible:
false
,
type:
'textarea'
)
end
end
it_behaves_like
'validates the YAML'
end
end
context
'with ACE editor'
do
it_behaves_like
'correct ci linting process'
do
let
(
:content_selector
)
{
'.ace_content'
}
describe
'YAML revalidate'
do
let
(
:yaml_content
)
{
'my yaml content'
}
before
do
stub_feature_flags
(
monaco_ci:
false
)
stub_feature_flags
(
ci_lint_vue:
false
)
project
.
add_developer
(
user
)
sign_in
(
user
)
visit
project_ci_lint_path
(
project
)
find
(
'#ci-editor'
)
execute_script
(
"ace.edit('ci-editor').setValue(
#{
yaml_content
.
to_json
}
);"
)
# Ace editor updates a hidden textarea and it happens asynchronously
wait_for
(
'YAML content'
)
do
find
(
content_selector
).
text
.
present?
end
it
'loads previous YAML content after validation'
do
expect
(
page
).
to
have_field
(
'content'
,
with:
'my yaml content'
,
visible:
false
,
type:
'textarea'
)
end
end
end
context
'with Editor Lite'
do
it_behaves_like
'correct ci linting process'
do
let
(
:content_selector
)
{
'.content .view-lines'
}
before
do
stub_feature_flags
(
monaco_ci:
true
)
stub_feature_flags
(
ci_lint_vue:
false
)
project
.
add_developer
(
user
)
sign_in
(
user
)
describe
'YAML clearing'
do
before
do
click_on
'Clear'
end
visit
project_ci_lint_path
(
project
)
editor_set_value
(
yaml_content
)
context
'YAML is present'
do
let
(
:yaml_content
)
do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
wait_for
(
'YAML content'
)
do
find
(
content_selector
).
text
.
present?
end
it
'YAML content is cleared'
do
expect
(
page
).
to
have_field
(
'content'
,
with:
''
,
visible:
false
,
type:
'textarea'
)
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