Commit 93f38f7e authored by Mike Greiling's avatar Mike Greiling

Merge branch 'leipert-improve-bundle-size-analysis' into 'master'

Webpack bundle size analysis: Use Job ID

See merge request gitlab-org/gitlab!32712
parents 5622b30d 058f186c
/* eslint-disable func-names, guard-for-in, no-restricted-syntax, no-lonely-if, no-continue */ /* eslint-disable func-names, no-continue */
/* global CommentsStore */ /* global CommentsStore */
import $ from 'jquery'; import $ from 'jquery';
...@@ -42,13 +42,13 @@ const JumpToDiscussion = Vue.extend({ ...@@ -42,13 +42,13 @@ const JumpToDiscussion = Vue.extend({
}, },
lastResolvedId() { lastResolvedId() {
let lastId; let lastId;
for (const discussionId in this.discussions) { Object.keys(this.discussions).forEach(discussionId => {
const discussion = this.discussions[discussionId]; const discussion = this.discussions[discussionId];
if (!discussion.isResolved()) { if (!discussion.isResolved()) {
lastId = discussion.id; lastId = discussion.id;
} }
} });
return lastId; return lastId;
}, },
}, },
...@@ -95,12 +95,10 @@ const JumpToDiscussion = Vue.extend({ ...@@ -95,12 +95,10 @@ const JumpToDiscussion = Vue.extend({
if (unresolvedDiscussionCount === 1) { if (unresolvedDiscussionCount === 1) {
hasDiscussionsToJumpTo = false; hasDiscussionsToJumpTo = false;
} }
} else { } else if (unresolvedDiscussionCount === 0) {
// If there are no unresolved discussions on the diffs tab at all, // If there are no unresolved discussions on the diffs tab at all,
// there are no discussions to jump to. // there are no discussions to jump to.
if (unresolvedDiscussionCount === 0) { hasDiscussionsToJumpTo = false;
hasDiscussionsToJumpTo = false;
}
} }
} else if (activeTab !== 'show') { } else if (activeTab !== 'show') {
// If we are on the commits or builds tabs, // If we are on the commits or builds tabs,
......
...@@ -22,7 +22,7 @@ analyze_cmd = [ ...@@ -22,7 +22,7 @@ analyze_cmd = [
# from master that was merged into for the merged pipeline. # from master that was merged into for the merged pipeline.
comparison_cmd = [ comparison_cmd = [
"webpack-compare-reports", "webpack-compare-reports",
"--from-sha #{gitlab.mr_json["diff_refs"]["start_sha"]}", "--job #{ENV["CI_JOB_ID"]}",
"--to-file #{analysis_result}", "--to-file #{analysis_result}",
"--html ./bundle-size-review/comparison.html", "--html ./bundle-size-review/comparison.html",
"--markdown #{markdown_result}" "--markdown #{markdown_result}"
......
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