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
80e1ade0
Commit
80e1ade0
authored
Jul 20, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This fixes the line numbers for the collapsible sections
parent
510b8752
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
app/assets/javascripts/jobs/store/utils.js
app/assets/javascripts/jobs/store/utils.js
+8
-8
No files found.
app/assets/javascripts/jobs/store/utils.js
View file @
80e1ade0
...
...
@@ -132,7 +132,7 @@ export const logLinesParserLegacy = (lines = [], accumulator = []) =>
);
export
const
logLinesParser
=
(
lines
=
[],
previousTraceState
=
{},
prevParsedLines
=
[])
=>
{
let
currentLine
=
previousTraceState
?.
prevLineCount
??
0
;
let
currentLine
Count
=
previousTraceState
?.
prevLineCount
??
0
;
let
currentHeader
=
previousTraceState
?.
currentHeader
;
let
isPreviousLineHeader
=
previousTraceState
?.
isPreviousLineHeader
??
false
;
const
parsedLines
=
prevParsedLines
.
length
>
0
?
prevParsedLines
:
[];
...
...
@@ -141,27 +141,27 @@ export const logLinesParser = (lines = [], previousTraceState = {}, prevParsedLi
for
(
let
i
=
0
;
i
<
lines
.
length
;
i
+=
1
)
{
const
line
=
lines
[
i
];
// First run we can use the current index, later runs we have to retrieve the last number of lines
currentLine
=
previousTraceState
?.
prevLineCount
?
currentLine
+
1
:
i
+
1
;
currentLine
Count
=
previousTraceState
?.
prevLineCount
?
currentLineCount
+
1
:
i
+
1
;
if
(
line
.
section_header
&&
!
isPreviousLineHeader
)
{
// If there's no previous line header that means we're at the root of the log
isPreviousLineHeader
=
true
;
parsedLines
.
push
(
parseHeaderLine
(
line
,
currentLine
));
parsedLines
.
push
(
parseHeaderLine
(
line
,
currentLine
Count
));
currentHeader
=
{
index
:
parsedLines
.
length
-
1
};
}
else
if
(
line
.
section_header
&&
isPreviousLineHeader
)
{
// If there's a current section, we can't push to the parsedLines array
sectionsQueue
.
push
(
currentHeader
);
currentHeader
=
parseHeaderLine
(
line
,
currentLine
);
// Let's parse the incoming header line
currentHeader
=
parseHeaderLine
(
line
,
currentLine
Count
);
// Let's parse the incoming header line
}
else
if
(
line
.
section
&&
!
line
.
section_duration
)
{
// We're inside a collapsible section and want to parse a standard line
if
(
currentHeader
?.
index
)
{
// If the current section header is only an index, add the line as part of the lines
// array of the current collapsible section
parsedLines
[
currentHeader
.
index
].
lines
.
push
(
parseLine
(
line
,
currentLine
));
parsedLines
[
currentHeader
.
index
].
lines
.
push
(
parseLine
(
line
,
currentLine
Count
));
}
else
{
// Otherwise add it to the innermost collapsible section lines array
currentHeader
.
lines
.
push
(
parseLine
(
line
,
currentLine
));
currentHeader
.
lines
.
push
(
parseLine
(
line
,
currentLine
Count
));
}
}
else
if
(
line
.
section
&&
line
.
section_duration
)
{
// NOTE: This marks the end of a section_header
...
...
@@ -187,7 +187,7 @@ export const logLinesParser = (lines = [], previousTraceState = {}, prevParsedLi
currentHeader
=
previousSection
;
}
}
else
{
parsedLines
.
push
(
parseLine
(
line
,
currentLine
));
parsedLines
.
push
(
parseLine
(
line
,
currentLine
Count
));
}
}
...
...
@@ -197,7 +197,7 @@ export const logLinesParser = (lines = [], previousTraceState = {}, prevParsedLi
isPreviousLineHeader
,
currentHeader
,
sectionsQueue
,
prevLineCount
:
lines
.
length
,
prevLineCount
:
currentLineCount
,
},
};
};
...
...
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