BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5343a65b
Commit
5343a65b
authored
Feb 18, 2017
by
Jacob Schatz
Committed by
Felipe Artur
Mar 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'add-additional-checks-to-ca-data' into 'master'
Small improvements for Cycle Analytics See merge request !9153
parent
3fd818ad
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
161 additions
and
25 deletions
+161
-25
cycle_analytics_bundle.js.es6
...javascripts/cycle_analytics/cycle_analytics_bundle.js.es6
+2
-2
cycle_analytics_store.js.es6
.../javascripts/cycle_analytics/cycle_analytics_store.js.es6
+22
-17
default_event_objects.js.es6
.../javascripts/cycle_analytics/default_event_objects.js.es6
+98
-0
text_utility.js
app/assets/javascripts/lib/utils/text_utility.js
+9
-1
wikis.js.es6
app/assets/javascripts/wikis.js.es6
+1
-5
analytics_stage_entity.rb
app/serializers/analytics_stage_entity.rb
+1
-0
code_stage.rb
lib/gitlab/cycle_analytics/code_stage.rb
+4
-0
issue_stage.rb
lib/gitlab/cycle_analytics/issue_stage.rb
+4
-0
plan_stage.rb
lib/gitlab/cycle_analytics/plan_stage.rb
+4
-0
production_stage.rb
lib/gitlab/cycle_analytics/production_stage.rb
+4
-0
review_stage.rb
lib/gitlab/cycle_analytics/review_stage.rb
+4
-0
staging_stage.rb
lib/gitlab/cycle_analytics/staging_stage.rb
+4
-0
test_stage.rb
lib/gitlab/cycle_analytics/test_stage.rb
+4
-0
No files found.
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6
View file @
5343a65b
...
...
@@ -97,7 +97,7 @@ $(() => {
}
this.isLoadingStage = true;
cycleAnalyticsStore.setStageEvents([]);
cycleAnalyticsStore.setStageEvents([]
, stage
);
cycleAnalyticsStore.setActiveStage(stage);
cycleAnalyticsService
...
...
@@ -107,7 +107,7 @@ $(() => {
})
.done((response) => {
this.isEmptyStage = !response.events.length;
cycleAnalyticsStore.setStageEvents(response.events);
cycleAnalyticsStore.setStageEvents(response.events
, stage
);
})
.error(() => {
this.isEmptyStage = true;
...
...
app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6
View file @
5343a65b
/* eslint-disable no-param-reassign */
require('../lib/utils/text_utility');
const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
...
...
@@ -34,11 +38,12 @@
});
newData.stages.forEach((item) => {
const stage
Name = item.title.toLowerCase(
);
const stage
Slug = gl.text.dasherize(item.title.toLowerCase()
);
item.active = false;
item.isUserAllowed = data.permissions[stageName];
item.emptyStageText = EMPTY_STAGE_TEXTS[stageName];
item.component = `stage-${stageName}-component`;
item.isUserAllowed = data.permissions[stageSlug];
item.emptyStageText = EMPTY_STAGE_TEXTS[stageSlug];
item.component = `stage-${stageSlug}-component`;
item.slug = stageSlug;
});
newData.analytics = data;
return newData;
...
...
@@ -58,10 +63,10 @@
this.deactivateAllStages();
stage.active = true;
},
setStageEvents(events) {
this.state.events = this.decorateEvents(events);
setStageEvents(events
, stage
) {
this.state.events = this.decorateEvents(events
, stage
);
},
decorateEvents(events) {
decorateEvents(events
, stage
) {
const newEvents = [];
events.forEach((item) => {
...
...
@@ -76,18 +81,18 @@
eventItem.author.avatarUrl = eventItem.author.avatar_url;
}
if (
item.created_at) item.createdAt = i
tem.created_at;
if (
item.short_sha) item.shortSha = i
tem.short_sha;
if (
item.commit_url) item.commitUrl = i
tem.commit_url;
if (
eventItem.created_at) eventItem.createdAt = eventI
tem.created_at;
if (
eventItem.short_sha) eventItem.shortSha = eventI
tem.short_sha;
if (
eventItem.commit_url) eventItem.commitUrl = eventI
tem.commit_url;
delete
i
tem.author.web_url;
delete
i
tem.author.avatar_url;
delete
i
tem.total_time;
delete
i
tem.created_at;
delete
i
tem.short_sha;
delete
i
tem.commit_url;
delete
eventI
tem.author.web_url;
delete
eventI
tem.author.avatar_url;
delete
eventI
tem.total_time;
delete
eventI
tem.created_at;
delete
eventI
tem.short_sha;
delete
eventI
tem.commit_url;
newEvents.push(
i
tem);
newEvents.push(
eventI
tem);
});
return newEvents;
...
...
app/assets/javascripts/cycle_analytics/default_event_objects.js.es6
0 → 100644
View file @
5343a65b
module.exports = {
issue: {
created_at: '',
url: '',
iid: '',
title: '',
total_time: {},
author: {
avatar_url: '',
id: '',
name: '',
web_url: '',
},
},
plan: {
title: '',
commit_url: '',
short_sha: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
code: {
title: '',
iid: '',
created_at: '',
url: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
test: {
name: '',
id: '',
date: '',
url: '',
short_sha: '',
commit_url: '',
total_time: {},
branch: {
name: '',
url: '',
},
},
review: {
title: '',
iid: '',
created_at: '',
url: '',
state: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
staging: {
id: '',
short_sha: '',
date: '',
url: '',
commit_url: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
branch: {
name: '',
url: '',
},
},
production: {
title: '',
created_at: '',
url: '',
iid: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
};
app/assets/javascripts/lib/utils/text_utility.js
View file @
5343a65b
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len */
require
(
'vendor/latinise'
);
(
function
()
{
(
function
(
w
)
{
var
base
;
...
...
@@ -164,8 +166,14 @@
gl
.
text
.
pluralize
=
function
(
str
,
count
)
{
return
str
+
(
count
>
1
||
count
===
0
?
's'
:
''
);
};
return
gl
.
text
.
truncate
=
function
(
string
,
maxLength
)
{
gl
.
text
.
truncate
=
function
(
string
,
maxLength
)
{
return
string
.
substr
(
0
,
(
maxLength
-
3
))
+
'...'
;
};
gl
.
text
.
dasherize
=
function
(
str
)
{
return
str
.
replace
(
/
[
_
\s]
+/g
,
'-'
);
};
gl
.
text
.
slugify
=
function
(
str
)
{
return
str
.
trim
().
toLowerCase
().
latinise
();
};
})(
window
);
}).
call
(
this
);
app/assets/javascripts/wikis.js.es6
View file @
5343a65b
/* eslint-disable no-param-reassign */
/* global Breakpoints */
require('vendor/latinise');
require('./breakpoints');
require('vendor/jquery.nicescroll');
((global) => {
const dasherize = str => str.replace(/[_\s]+/g, '-');
const slugify = str => dasherize(str.trim().toLowerCase().latinise());
class Wikis {
constructor() {
this.bp = Breakpoints.get();
...
...
@@ -34,7 +30,7 @@ require('vendor/jquery.nicescroll');
if (!this.newWikiForm) return;
const slugInput = this.newWikiForm.querySelector('#new_wiki_path');
const slug = slugify(slugInput.value);
const slug =
gl.text.
slugify(slugInput.value);
if (slug.length > 0) {
const wikisPath = slugInput.getAttribute('data-wikis-path');
...
...
app/serializers/analytics_stage_entity.rb
View file @
5343a65b
...
...
@@ -2,6 +2,7 @@ class AnalyticsStageEntity < Grape::Entity
include
EntityDateHelper
expose
:title
expose
:legend
expose
:description
expose
:median
,
as: :value
do
|
stage
|
...
...
lib/gitlab/cycle_analytics/code_stage.rb
View file @
5343a65b
...
...
@@ -13,6 +13,10 @@ module Gitlab
:code
end
def
legend
"Related Merge Requests"
end
def
description
"Time until first merge request"
end
...
...
lib/gitlab/cycle_analytics/issue_stage.rb
View file @
5343a65b
...
...
@@ -14,6 +14,10 @@ module Gitlab
:issue
end
def
legend
"Related Issues"
end
def
description
"Time before an issue gets scheduled"
end
...
...
lib/gitlab/cycle_analytics/plan_stage.rb
View file @
5343a65b
...
...
@@ -14,6 +14,10 @@ module Gitlab
:plan
end
def
legend
"Related Commits"
end
def
description
"Time before an issue starts implementation"
end
...
...
lib/gitlab/cycle_analytics/production_stage.rb
View file @
5343a65b
...
...
@@ -15,6 +15,10 @@ module Gitlab
:production
end
def
legend
"Related Issues"
end
def
description
"From issue creation until deploy to production"
end
...
...
lib/gitlab/cycle_analytics/review_stage.rb
View file @
5343a65b
...
...
@@ -13,6 +13,10 @@ module Gitlab
:review
end
def
legend
"Relative Merged Requests"
end
def
description
"Time between merge request creation and merge/close"
end
...
...
lib/gitlab/cycle_analytics/staging_stage.rb
View file @
5343a65b
...
...
@@ -14,6 +14,10 @@ module Gitlab
:staging
end
def
legend
"Relative Deployed Builds"
end
def
description
"From merge request merge until deploy to production"
end
...
...
lib/gitlab/cycle_analytics/test_stage.rb
View file @
5343a65b
...
...
@@ -13,6 +13,10 @@ module Gitlab
:test
end
def
legend
"Relative Builds Trigger by Commits"
end
def
description
"Total test time for all commits/merges"
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