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
a69f7d55
Commit
a69f7d55
authored
Jun 11, 2021
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Master-to-main in the CI schema extension
Updating the references in the code
parent
55bedf39
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js
...ets/javascripts/editor/extensions/editor_ci_schema_ext.js
+2
-2
app/assets/javascripts/pipeline_editor/components/editor/text_editor.vue
...scripts/pipeline_editor/components/editor/text_editor.vue
+2
-2
spec/frontend/editor/editor_ci_schema_ext_spec.js
spec/frontend/editor/editor_ci_schema_ext_spec.js
+4
-3
No files found.
app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js
View file @
a69f7d55
...
...
@@ -14,9 +14,9 @@ export class CiSchemaExtension extends EditorLiteExtension {
* @param {Object} opts
* @param {String} opts.projectNamespace
* @param {String} opts.projectPath
* @param {String?} opts.ref - Current ref. Defaults to ma
ster
* @param {String?} opts.ref - Current ref. Defaults to ma
in
*/
registerCiSchema
({
projectNamespace
,
projectPath
,
ref
=
'
master
'
}
=
{})
{
registerCiSchema
({
projectNamespace
,
projectPath
,
ref
}
=
{})
{
const
ciSchemaPath
=
Api
.
buildUrl
(
Api
.
projectFileSchemaPath
)
.
replace
(
'
:namespace_path
'
,
projectNamespace
)
.
replace
(
'
:project_path
'
,
projectPath
)
...
...
app/assets/javascripts/pipeline_editor/components/editor/text_editor.vue
View file @
a69f7d55
...
...
@@ -9,8 +9,8 @@ export default {
components
:
{
EditorLite
,
},
inject
:
[
'
ciConfigPath
'
,
'
projectPath
'
,
'
projectNamespace
'
,
'
defaultBranch
'
],
mixins
:
[
glFeatureFlagMixin
()],
inject
:
[
'
ciConfigPath
'
,
'
projectPath
'
,
'
projectNamespace
'
],
inheritAttrs
:
false
,
data
()
{
return
{
...
...
@@ -34,7 +34,7 @@ export default {
editorInstance
.
registerCiSchema
({
projectPath
:
this
.
projectPath
,
projectNamespace
:
this
.
projectNamespace
,
ref
:
this
.
commitSha
,
ref
:
this
.
commitSha
||
this
.
defaultBranch
,
});
}
},
...
...
spec/frontend/editor/editor_ci_schema_ext_spec.js
View file @
a69f7d55
...
...
@@ -4,6 +4,8 @@ import { EXTENSION_CI_SCHEMA_FILE_NAME_MATCH } from '~/editor/constants';
import
EditorLite
from
'
~/editor/editor_lite
'
;
import
{
CiSchemaExtension
}
from
'
~/editor/extensions/editor_ci_schema_ext
'
;
const
mockRef
=
'
AABBCCDD
'
;
describe
(
'
~/editor/editor_ci_config_ext
'
,
()
=>
{
const
defaultBlobPath
=
'
.gitlab-ci.yml
'
;
...
...
@@ -75,8 +77,6 @@ describe('~/editor/editor_ci_config_ext', () => {
});
it
(
'
with an schema uri that contains project and ref
'
,
()
=>
{
const
mockRef
=
'
AABBCCDD
'
;
instance
.
registerCiSchema
({
projectNamespace
:
mockProjectNamespace
,
projectPath
:
mockProjectPath
,
...
...
@@ -95,10 +95,11 @@ describe('~/editor/editor_ci_config_ext', () => {
instance
.
registerCiSchema
({
projectNamespace
:
mockProjectNamespace
,
projectPath
:
mockProjectPath
,
ref
:
mockRef
,
});
expect
(
getConfiguredYmlSchema
()).
toEqual
({
uri
:
`
${
TEST_HOST
}
/
${
mockProjectNamespace
}
/
${
mockProjectPath
}
/-/schema/
master
/
${
EXTENSION_CI_SCHEMA_FILE_NAME_MATCH
}
`
,
uri
:
`
${
TEST_HOST
}
/
${
mockProjectNamespace
}
/
${
mockProjectPath
}
/-/schema/
${
mockRef
}
/
${
EXTENSION_CI_SCHEMA_FILE_NAME_MATCH
}
`
,
fileMatch
:
[
'
another-ci-filename.yml
'
],
});
});
...
...
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