Commit a4c38828 authored by Illya Klymov's avatar Illya Klymov

Merge branch '218472-feature-flag' into 'master'

Put .gitlab-ci.yml linting in IDE behind a feature flag

See merge request gitlab-org/gitlab!36539
parents 8d56c1bc e969f68d
......@@ -45,7 +45,10 @@ export default class Editor {
setupThemes();
registerLanguages(...languages);
registerSchemas(...schemas);
if (gon.features?.schemaLinting) {
registerSchemas(...schemas);
}
this.debouncedUpdate = debounce(() => {
this.updateDimensions();
......
......@@ -8,6 +8,7 @@ class IdeController < ApplicationController
before_action do
push_frontend_feature_flag(:build_service_proxy)
push_frontend_feature_flag(:schema_linting)
end
def index
......
......@@ -200,6 +200,20 @@ describe('Multi-file editor library', () => {
});
describe('schemas', () => {
let originalGon;
beforeEach(() => {
originalGon = window.gon;
window.gon = { features: { schemaLinting: true } };
delete Editor.editorInstance;
instance = Editor.create();
});
afterEach(() => {
window.gon = originalGon;
});
it('registers custom schemas defined with Monaco', () => {
expect(monacoLanguages.yaml.yamlDefaults.diagnosticsOptions).toMatchObject({
schemas: [{ fileMatch: ['*.gitlab-ci.yml'] }],
......
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