Skip to content

Commit 953e725

Browse files
committed
Add dump output to allow the exchange of data gathered from GitLab
1 parent eb33592 commit 953e725

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

src/gtt-report.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const Output = {
1313
table: require('./output/table'),
1414
csv: require('./output/csv'),
1515
pdf: require('./output/pdf'),
16-
markdown: require('./output/markdown')
16+
markdown: require('./output/markdown'),
17+
dump: require('./output/dump')
1718
};
1819

1920
// this collects options

src/output/dump.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const Base = require('./base');
2+
const Report = require('../models/report');
3+
4+
class dump extends Base {
5+
constructor(config, report) {
6+
super(config, report);
7+
8+
config.set('url', null, true);
9+
config.set('token', null, true);
10+
config.workDir = null;
11+
config.cache = null;
12+
13+
let dump = {config};
14+
15+
['issues', 'mergeRequests'].forEach(type => {
16+
dump[type] =
17+
report[type].map(resource => {
18+
return {
19+
data: resource.data,
20+
notes: resource.notes
21+
};
22+
});
23+
});
24+
25+
this.write(JSON.stringify(dump));
26+
}
27+
28+
makeStats() {
29+
}
30+
31+
makeIssues() {
32+
}
33+
34+
makeMergeRequests() {
35+
}
36+
37+
makeRecords() {
38+
}
39+
}
40+
41+
module.exports = dump;

0 commit comments

Comments
 (0)