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
9da9ed00
Commit
9da9ed00
authored
Sep 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
b15f88a6
2adc4ccf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
336 additions
and
6 deletions
+336
-6
app/assets/javascripts/jobs/components/log/line.vue
app/assets/javascripts/jobs/components/log/line.vue
+28
-0
app/assets/javascripts/jobs/components/log/line_header.vue
app/assets/javascripts/jobs/components/log/line_header.vue
+45
-0
app/assets/javascripts/jobs/components/log/line_number.vue
app/assets/javascripts/jobs/components/log/line_number.vue
+52
-0
changelogs/unreleased/66454-base-components.yml
changelogs/unreleased/66454-base-components.yml
+5
-0
changelogs/unreleased/persist-needs-error.yml
changelogs/unreleased/persist-needs-error.yml
+5
-0
config/gitlab.yml.example
config/gitlab.yml.example
+1
-0
lib/gitlab/ci/pipeline/chain/helpers.rb
lib/gitlab/ci/pipeline/chain/helpers.rb
+6
-1
lib/gitlab/ci/pipeline/chain/populate.rb
lib/gitlab/ci/pipeline/chain/populate.rb
+1
-1
spec/javascripts/jobs/components/log/line_header_spec.js
spec/javascripts/jobs/components/log/line_header_spec.js
+84
-0
spec/javascripts/jobs/components/log/line_number_spec.js
spec/javascripts/jobs/components/log/line_number_spec.js
+40
-0
spec/javascripts/jobs/components/log/line_spec.js
spec/javascripts/jobs/components/log/line_spec.js
+49
-0
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+20
-4
No files found.
app/assets/javascripts/jobs/components/log/line.vue
0 → 100644
View file @
9da9ed00
<
script
>
import
LineNumber
from
'
./line_number.vue
'
;
export
default
{
components
:
{
LineNumber
,
},
props
:
{
line
:
{
type
:
Object
,
required
:
true
,
},
path
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"line"
>
<line-number
:line-number=
"line.lineNumber"
:path=
"path"
/>
<span
v-for=
"(content, i) in line.content"
:key=
"i"
class=
"line-text"
:class=
"content.style"
>
{{
content
.
text
}}
</span>
</div>
</
template
>
app/assets/javascripts/jobs/components/log/line_header.vue
0 → 100644
View file @
9da9ed00
<
script
>
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
LineNumber
from
'
./line_number.vue
'
;
export
default
{
components
:
{
Icon
,
LineNumber
,
},
props
:
{
line
:
{
type
:
Object
,
required
:
true
,
},
isClosed
:
{
type
:
Boolean
,
required
:
true
,
},
path
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
iconName
()
{
return
this
.
isClosed
?
'
angle-right
'
:
'
angle-down
'
;
},
},
methods
:
{
handleOnClick
()
{
this
.
$emit
(
'
toggleLine
'
);
},
},
};
</
script
>
<
template
>
<div
class=
"line collapsible-line"
role=
"button"
@
click=
"handleOnClick"
>
<icon
:name=
"iconName"
class=
"arrow"
/>
<line-number
:line-number=
"line.lineNumber"
:path=
"path"
/>
<span
v-for=
"(content, i) in line.content"
:key=
"i"
class=
"line-text"
:class=
"content.style"
>
{{
content
.
text
}}
</span>
</div>
</
template
>
app/assets/javascripts/jobs/components/log/line_number.vue
0 → 100644
View file @
9da9ed00
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlLink
,
},
props
:
{
lineNumber
:
{
type
:
Number
,
required
:
true
,
},
path
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
/**
* Builds the url for each line number
*
* @returns {String}
*/
buildLineNumber
()
{
return
`
${
this
.
path
}
#
${
this
.
lineNumberId
}
`
;
},
/**
* Array indexes start with 0, so we add 1
* to create the line number
*
* @returns {Number} the line number
*/
parsedLineNumber
()
{
return
this
.
lineNumber
+
1
;
},
/**
* Creates the anchor for each link
*
* @returns {String}
*/
lineNumberId
()
{
return
`L
${
this
.
parsedLineNumber
}
`
;
},
},
};
</
script
>
<
template
>
<gl-link
:id=
"lineNumberId"
class=
"line-number"
:href=
"buildLineNumber"
>
{{
parsedLineNumber
}}
</gl-link>
</
template
>
changelogs/unreleased/66454-base-components.yml
0 → 100644
View file @
9da9ed00
---
title
:
Creates base components for the new job log
merge_request
:
author
:
type
:
added
changelogs/unreleased/persist-needs-error.yml
0 → 100644
View file @
9da9ed00
---
title
:
Persist `needs:` validation as config error
merge_request
:
author
:
type
:
fixed
config/gitlab.yml.example
View file @
9da9ed00
...
...
@@ -158,6 +158,7 @@ production: &base
# The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
# The placeholder can be omitted but if present, it must appear in the "user" part of the address (before the `@`).
# Please be aware that a placeholder is required for the Service Desk feature to work.
address: "gitlab-incoming+%{key}@gmail.com"
# Email account username
...
...
lib/gitlab/ci/pipeline/chain/helpers.rb
View file @
9da9ed00
...
...
@@ -5,7 +5,12 @@ module Gitlab
module
Pipeline
module
Chain
module
Helpers
def
error
(
message
)
def
error
(
message
,
config_error:
false
)
if
config_error
&&
command
.
save_incompleted
pipeline
.
yaml_errors
=
message
pipeline
.
drop!
(
:config_error
)
end
pipeline
.
errors
.
add
(
:base
,
message
)
end
end
...
...
lib/gitlab/ci/pipeline/chain/populate.rb
View file @
9da9ed00
...
...
@@ -26,7 +26,7 @@ module Gitlab
# Gather all runtime build/stage errors
#
if
seeds_errors
=
pipeline
.
stage_seeds
.
flat_map
(
&
:errors
).
compact
.
presence
return
error
(
seeds_errors
.
join
(
"
\n
"
))
return
error
(
seeds_errors
.
join
(
"
\n
"
)
,
config_error:
true
)
end
##
...
...
spec/javascripts/jobs/components/log/line_header_spec.js
0 → 100644
View file @
9da9ed00
import
{
mount
}
from
'
@vue/test-utils
'
;
import
LineHeader
from
'
~/jobs/components/log/line_header.vue
'
;
import
LineNumber
from
'
~/jobs/components/log/line_number.vue
'
;
describe
(
'
Job Log Header Line
'
,
()
=>
{
let
wrapper
;
const
data
=
{
line
:
{
content
:
[
{
text
:
'
Running with gitlab-runner 12.1.0 (de7731dd)
'
,
style
:
'
term-fg-l-green
'
,
},
],
lineNumber
:
0
,
},
isClosed
:
true
,
path
:
'
/jashkenas/underscore/-/jobs/335
'
,
};
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
mount
(
LineHeader
,
{
sync
:
false
,
propsData
:
{
...
props
,
},
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
describe
(
'
line
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
(
data
);
});
it
(
'
renders the line number component
'
,
()
=>
{
expect
(
wrapper
.
contains
(
LineNumber
)).
toBe
(
true
);
});
it
(
'
renders a span the provided text
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
span
'
).
text
()).
toBe
(
data
.
line
.
content
[
0
].
text
);
});
it
(
'
renders the provided style as a class attribute
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
span
'
).
classes
()).
toContain
(
data
.
line
.
content
[
0
].
style
);
});
});
describe
(
'
when isCloses is true
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
...
data
,
isClosed
:
true
});
});
it
(
'
sets icon name to be angle-right
'
,
()
=>
{
expect
(
wrapper
.
vm
.
iconName
).
toEqual
(
'
angle-right
'
);
});
});
describe
(
'
when isCloses is false
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
...
data
,
isClosed
:
false
});
});
it
(
'
sets icon name to be angle-down
'
,
()
=>
{
expect
(
wrapper
.
vm
.
iconName
).
toEqual
(
'
angle-down
'
);
});
});
describe
(
'
on click
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
(
data
);
});
it
(
'
emits toggleLine event
'
,
()
=>
{
wrapper
.
trigger
(
'
click
'
);
expect
(
wrapper
.
emitted
().
toggleLine
.
length
).
toBe
(
1
);
});
});
});
spec/javascripts/jobs/components/log/line_number_spec.js
0 → 100644
View file @
9da9ed00
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
LineNumber
from
'
~/jobs/components/log/line_number.vue
'
;
describe
(
'
Job Log Line Number
'
,
()
=>
{
let
wrapper
;
const
data
=
{
lineNumber
:
0
,
path
:
'
/jashkenas/underscore/-/jobs/335
'
,
};
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
LineNumber
,
{
sync
:
false
,
propsData
:
{
...
props
,
},
});
};
beforeEach
(()
=>
{
createComponent
(
data
);
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders incremented lineNunber by 1
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toBe
(
'
1
'
);
});
it
(
'
renders link with lineNumber as an ID
'
,
()
=>
{
expect
(
wrapper
.
attributes
().
id
).
toBe
(
'
L1
'
);
});
it
(
'
links to the provided path with line number as anchor
'
,
()
=>
{
expect
(
wrapper
.
attributes
().
href
).
toBe
(
`
${
data
.
path
}
#L1`
);
});
});
spec/javascripts/jobs/components/log/line_spec.js
0 → 100644
View file @
9da9ed00
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Line
from
'
~/jobs/components/log/line.vue
'
;
import
LineNumber
from
'
~/jobs/components/log/line_number.vue
'
;
describe
(
'
Job Log Line
'
,
()
=>
{
let
wrapper
;
const
data
=
{
line
:
{
content
:
[
{
text
:
'
Running with gitlab-runner 12.1.0 (de7731dd)
'
,
style
:
'
term-fg-l-green
'
,
},
],
lineNumber
:
0
,
},
path
:
'
/jashkenas/underscore/-/jobs/335
'
,
};
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
Line
,
{
sync
:
false
,
propsData
:
{
...
props
,
},
});
};
beforeEach
(()
=>
{
createComponent
(
data
);
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders the line number component
'
,
()
=>
{
expect
(
wrapper
.
contains
(
LineNumber
)).
toBe
(
true
);
});
it
(
'
renders a span the provided text
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
span
'
).
text
()).
toBe
(
data
.
line
.
content
[
0
].
text
);
});
it
(
'
renders the provided style as a class attribute
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
span
'
).
classes
()).
toContain
(
data
.
line
.
content
[
0
].
style
);
});
});
spec/services/ci/create_pipeline_service_spec.rb
View file @
9da9ed00
...
...
@@ -1140,10 +1140,26 @@ describe Ci::CreatePipelineService do
context
'when pipeline on feature is created'
do
let
(
:ref_name
)
{
'refs/heads/feature'
}
it
'does not create a pipeline as test_a depends on build_a'
do
expect
(
pipeline
).
not_to
be_persisted
expect
(
pipeline
.
builds
).
to
be_empty
expect
(
pipeline
.
errors
[
:base
]).
to
contain_exactly
(
"test_a: needs 'build_a'"
)
context
'when save_on_errors is enabled'
do
let
(
:pipeline
)
{
execute_service
(
save_on_errors:
true
)
}
it
'does create a pipeline as test_a depends on build_a'
do
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
).
to
be_empty
expect
(
pipeline
.
yaml_errors
).
to
eq
(
"test_a: needs 'build_a'"
)
expect
(
pipeline
.
errors
[
:base
]).
to
contain_exactly
(
"test_a: needs 'build_a'"
)
end
end
context
'when save_on_errors is disabled'
do
let
(
:pipeline
)
{
execute_service
(
save_on_errors:
false
)
}
it
'does not create a pipeline as test_a depends on build_a'
do
expect
(
pipeline
).
not_to
be_persisted
expect
(
pipeline
.
builds
).
to
be_empty
expect
(
pipeline
.
yaml_errors
).
to
be_nil
expect
(
pipeline
.
errors
[
:base
]).
to
contain_exactly
(
"test_a: needs 'build_a'"
)
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