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
7bde505d
Commit
7bde505d
authored
Sep 04, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 'job trace' with 'job logs' in IDE code
parent
e25d35f7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
47 deletions
+47
-47
app/assets/javascripts/ide/components/jobs/detail.vue
app/assets/javascripts/ide/components/jobs/detail.vue
+2
-2
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
...ssets/javascripts/ide/stores/modules/pipelines/actions.js
+10
-10
app/assets/javascripts/ide/stores/modules/pipelines/mutation_types.js
...avascripts/ide/stores/modules/pipelines/mutation_types.js
+3
-3
app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
...ets/javascripts/ide/stores/modules/pipelines/mutations.js
+3
-3
spec/frontend/ide/components/jobs/detail_spec.js
spec/frontend/ide/components/jobs/detail_spec.js
+4
-4
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
+19
-19
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
+6
-6
No files found.
app/assets/javascripts/ide/components/jobs/detail.vue
View file @
7bde505d
...
...
@@ -43,7 +43,7 @@ export default {
this
.
getTrace
();
},
methods
:
{
...
mapActions
(
'
pipelines
'
,
[
'
fetchJob
Trace
'
,
'
setDetailJob
'
]),
...
mapActions
(
'
pipelines
'
,
[
'
fetchJob
Logs
'
,
'
setDetailJob
'
]),
scrollDown
()
{
if
(
this
.
$refs
.
buildTrace
)
{
this
.
$refs
.
buildTrace
.
scrollTo
(
0
,
this
.
$refs
.
buildTrace
.
scrollHeight
);
...
...
@@ -67,7 +67,7 @@ export default {
}
}),
getTrace
()
{
return
this
.
fetchJob
Trace
().
then
(()
=>
this
.
scrollDown
());
return
this
.
fetchJob
Logs
().
then
(()
=>
this
.
scrollDown
());
},
},
};
...
...
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
View file @
7bde505d
...
...
@@ -118,31 +118,31 @@ export const setDetailJob = ({ commit, dispatch }, job) => {
});
};
export
const
requestJob
Trace
=
({
commit
})
=>
commit
(
types
.
REQUEST_JOB_TRACE
);
export
const
receiveJob
Trace
Error
=
({
commit
,
dispatch
})
=>
{
export
const
requestJob
Logs
=
({
commit
})
=>
commit
(
types
.
REQUEST_JOB_LOGS
);
export
const
receiveJob
Logs
Error
=
({
commit
,
dispatch
})
=>
{
dispatch
(
'
setErrorMessage
'
,
{
text
:
__
(
'
An error occurred while fetching the job trace.
'
),
action
:
()
=>
dispatch
(
'
fetchJob
Trace
'
).
then
(()
=>
dispatch
(
'
setErrorMessage
'
,
null
,
{
root
:
true
})),
dispatch
(
'
fetchJob
Logs
'
).
then
(()
=>
dispatch
(
'
setErrorMessage
'
,
null
,
{
root
:
true
})),
actionText
:
__
(
'
Please try again
'
),
actionPayload
:
null
,
},
{
root
:
true
},
);
commit
(
types
.
RECEIVE_JOB_
TRACE
_ERROR
);
commit
(
types
.
RECEIVE_JOB_
LOGS
_ERROR
);
};
export
const
receiveJob
Trace
Success
=
({
commit
},
data
)
=>
commit
(
types
.
RECEIVE_JOB_
TRACE
_SUCCESS
,
data
);
export
const
receiveJob
Logs
Success
=
({
commit
},
data
)
=>
commit
(
types
.
RECEIVE_JOB_
LOGS
_SUCCESS
,
data
);
export
const
fetchJob
Trace
=
({
dispatch
,
state
})
=>
{
dispatch
(
'
requestJob
Trace
'
);
export
const
fetchJob
Logs
=
({
dispatch
,
state
})
=>
{
dispatch
(
'
requestJob
Logs
'
);
return
axios
.
get
(
`
${
state
.
detailJob
.
path
}
/trace`
,
{
params
:
{
format
:
'
json
'
}
})
.
then
(({
data
})
=>
dispatch
(
'
receiveJob
Trace
Success
'
,
data
))
.
catch
(()
=>
dispatch
(
'
receiveJob
Trace
Error
'
));
.
then
(({
data
})
=>
dispatch
(
'
receiveJob
Logs
Success
'
,
data
))
.
catch
(()
=>
dispatch
(
'
receiveJob
Logs
Error
'
));
};
export
const
resetLatestPipeline
=
({
commit
})
=>
{
...
...
app/assets/javascripts/ide/stores/modules/pipelines/mutation_types.js
View file @
7bde505d
...
...
@@ -10,6 +10,6 @@ export const TOGGLE_STAGE_COLLAPSE = 'TOGGLE_STAGE_COLLAPSE';
export
const
SET_DETAIL_JOB
=
'
SET_DETAIL_JOB
'
;
export
const
REQUEST_JOB_
TRACE
=
'
REQUEST_JOB_TRACE
'
;
export
const
RECEIVE_JOB_
TRACE_ERROR
=
'
RECEIVE_JOB_TRACE
_ERROR
'
;
export
const
RECEIVE_JOB_
TRACE_SUCCESS
=
'
RECEIVE_JOB_TRACE
_SUCCESS
'
;
export
const
REQUEST_JOB_
LOGS
=
'
REQUEST_JOB_LOGS
'
;
export
const
RECEIVE_JOB_
LOGS_ERROR
=
'
RECEIVE_JOB_LOGS
_ERROR
'
;
export
const
RECEIVE_JOB_
LOGS_SUCCESS
=
'
RECEIVE_JOB_LOGS
_SUCCESS
'
;
app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
View file @
7bde505d
...
...
@@ -66,13 +66,13 @@ export default {
[
types
.
SET_DETAIL_JOB
](
state
,
job
)
{
state
.
detailJob
=
{
...
job
};
},
[
types
.
REQUEST_JOB_
TRACE
](
state
)
{
[
types
.
REQUEST_JOB_
LOGS
](
state
)
{
state
.
detailJob
.
isLoading
=
true
;
},
[
types
.
RECEIVE_JOB_
TRACE
_ERROR
](
state
)
{
[
types
.
RECEIVE_JOB_
LOGS
_ERROR
](
state
)
{
state
.
detailJob
.
isLoading
=
false
;
},
[
types
.
RECEIVE_JOB_
TRACE
_SUCCESS
](
state
,
data
)
{
[
types
.
RECEIVE_JOB_
LOGS
_SUCCESS
](
state
,
data
)
{
state
.
detailJob
.
isLoading
=
false
;
state
.
detailJob
.
output
=
data
.
html
;
},
...
...
spec/frontend/ide/components/jobs/detail_spec.js
View file @
7bde505d
...
...
@@ -24,7 +24,7 @@ describe('IDE jobs detail view', () => {
beforeEach
(()
=>
{
vm
=
createComponent
();
jest
.
spyOn
(
vm
,
'
fetchJob
Trace
'
).
mockResolvedValue
();
jest
.
spyOn
(
vm
,
'
fetchJob
Logs
'
).
mockResolvedValue
();
});
afterEach
(()
=>
{
...
...
@@ -36,8 +36,8 @@ describe('IDE jobs detail view', () => {
vm
=
vm
.
$mount
();
});
it
(
'
calls fetchJob
Trace
'
,
()
=>
{
expect
(
vm
.
fetchJob
Trace
).
toHaveBeenCalled
();
it
(
'
calls fetchJob
Logs
'
,
()
=>
{
expect
(
vm
.
fetchJob
Logs
).
toHaveBeenCalled
();
});
it
(
'
scrolls to bottom
'
,
()
=>
{
...
...
@@ -96,7 +96,7 @@ describe('IDE jobs detail view', () => {
describe
(
'
scroll buttons
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
createComponent
();
jest
.
spyOn
(
vm
,
'
fetchJob
Trace
'
).
mockResolvedValue
();
jest
.
spyOn
(
vm
,
'
fetchJob
Logs
'
).
mockResolvedValue
();
});
afterEach
(()
=>
{
...
...
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
View file @
7bde505d
...
...
@@ -15,10 +15,10 @@ import {
fetchJobs
,
toggleStageCollapsed
,
setDetailJob
,
requestJob
Trace
,
receiveJob
Trace
Error
,
receiveJob
Trace
Success
,
fetchJob
Trace
,
requestJob
Logs
,
receiveJob
Logs
Error
,
receiveJob
Logs
Success
,
fetchJob
Logs
,
resetLatestPipeline
,
}
from
'
~/ide/stores/modules/pipelines/actions
'
;
import
state
from
'
~/ide/stores/modules/pipelines/state
'
;
...
...
@@ -324,19 +324,19 @@ describe('IDE pipelines actions', () => {
});
});
describe
(
'
requestJob
Trace
'
,
()
=>
{
describe
(
'
requestJob
Logs
'
,
()
=>
{
it
(
'
commits request
'
,
done
=>
{
testAction
(
requestJob
Trace
,
null
,
mockedState
,
[{
type
:
types
.
REQUEST_JOB_TRACE
}],
[],
done
);
testAction
(
requestJob
Logs
,
null
,
mockedState
,
[{
type
:
types
.
REQUEST_JOB_LOGS
}],
[],
done
);
});
});
describe
(
'
receiveJob
Trace
Error
'
,
()
=>
{
describe
(
'
receiveJob
Logs
Error
'
,
()
=>
{
it
(
'
commits error
'
,
done
=>
{
testAction
(
receiveJob
Trace
Error
,
receiveJob
Logs
Error
,
null
,
mockedState
,
[{
type
:
types
.
RECEIVE_JOB_
TRACE
_ERROR
}],
[{
type
:
types
.
RECEIVE_JOB_
LOGS
_ERROR
}],
[
{
type
:
'
setErrorMessage
'
,
...
...
@@ -353,20 +353,20 @@ describe('IDE pipelines actions', () => {
});
});
describe
(
'
receiveJob
Trace
Success
'
,
()
=>
{
describe
(
'
receiveJob
Logs
Success
'
,
()
=>
{
it
(
'
commits data
'
,
done
=>
{
testAction
(
receiveJob
Trace
Success
,
receiveJob
Logs
Success
,
'
data
'
,
mockedState
,
[{
type
:
types
.
RECEIVE_JOB_
TRACE
_SUCCESS
,
payload
:
'
data
'
}],
[{
type
:
types
.
RECEIVE_JOB_
LOGS
_SUCCESS
,
payload
:
'
data
'
}],
[],
done
,
);
});
});
describe
(
'
fetchJob
Trace
'
,
()
=>
{
describe
(
'
fetchJob
Logs
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
detailJob
=
{
path
:
`
${
TEST_HOST
}
/project/builds`
};
});
...
...
@@ -379,20 +379,20 @@ describe('IDE pipelines actions', () => {
it
(
'
dispatches request
'
,
done
=>
{
testAction
(
fetchJob
Trace
,
fetchJob
Logs
,
null
,
mockedState
,
[],
[
{
type
:
'
requestJob
Trace
'
},
{
type
:
'
receiveJob
Trace
Success
'
,
payload
:
{
html
:
'
html
'
}
},
{
type
:
'
requestJob
Logs
'
},
{
type
:
'
receiveJob
Logs
Success
'
,
payload
:
{
html
:
'
html
'
}
},
],
done
,
);
});
it
(
'
sends get request to correct URL
'
,
()
=>
{
fetchJob
Trace
({
fetchJob
Logs
({
state
:
mockedState
,
dispatch
()
{},
...
...
@@ -410,11 +410,11 @@ describe('IDE pipelines actions', () => {
it
(
'
dispatches error
'
,
done
=>
{
testAction
(
fetchJob
Trace
,
fetchJob
Logs
,
null
,
mockedState
,
[],
[{
type
:
'
requestJob
Trace
'
},
{
type
:
'
receiveJobTrace
Error
'
}],
[{
type
:
'
requestJob
Logs
'
},
{
type
:
'
receiveJobLogs
Error
'
}],
done
,
);
});
...
...
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
View file @
7bde505d
...
...
@@ -175,37 +175,37 @@ describe('IDE pipelines mutations', () => {
});
});
describe
(
'
REQUEST_JOB_
TRACE
'
,
()
=>
{
describe
(
'
REQUEST_JOB_
LOGS
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
detailJob
=
{
...
jobs
[
0
]
};
});
it
(
'
sets loading on detail job
'
,
()
=>
{
mutations
[
types
.
REQUEST_JOB_
TRACE
](
mockedState
);
mutations
[
types
.
REQUEST_JOB_
LOGS
](
mockedState
);
expect
(
mockedState
.
detailJob
.
isLoading
).
toBe
(
true
);
});
});
describe
(
'
RECEIVE_JOB_
TRACE
_ERROR
'
,
()
=>
{
describe
(
'
RECEIVE_JOB_
LOGS
_ERROR
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
detailJob
=
{
...
jobs
[
0
],
isLoading
:
true
};
});
it
(
'
sets loading to false on detail job
'
,
()
=>
{
mutations
[
types
.
RECEIVE_JOB_
TRACE
_ERROR
](
mockedState
);
mutations
[
types
.
RECEIVE_JOB_
LOGS
_ERROR
](
mockedState
);
expect
(
mockedState
.
detailJob
.
isLoading
).
toBe
(
false
);
});
});
describe
(
'
RECEIVE_JOB_
TRACE
_SUCCESS
'
,
()
=>
{
describe
(
'
RECEIVE_JOB_
LOGS
_SUCCESS
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
detailJob
=
{
...
jobs
[
0
],
isLoading
:
true
};
});
it
(
'
sets output on detail job
'
,
()
=>
{
mutations
[
types
.
RECEIVE_JOB_
TRACE
_SUCCESS
](
mockedState
,
{
html
:
'
html
'
});
mutations
[
types
.
RECEIVE_JOB_
LOGS
_SUCCESS
](
mockedState
,
{
html
:
'
html
'
});
expect
(
mockedState
.
detailJob
.
output
).
toBe
(
'
html
'
);
expect
(
mockedState
.
detailJob
.
isLoading
).
toBe
(
false
);
});
...
...
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