Giter Club home page Giter Club logo

gerritstats's Introduction

MAINTENANCE

TL;DR: This tool is unmaintained.

If you need a GitHub version of this tool, go to https://github.com/holmari/repostats .

I originally built this tool in my spare time while working for Nokia, my former employer. Gerrit is an awesome code review tool, but I have not used Gerrit at work for several years.

I rewrote GerritStats in early 2021 so it works for GitHub - https://github.com/holmari/repostats . Its initial version does not have support for Gerrit, but it's designed in a way that it's easy to extend to include support for Gerrit's REST API. A bit of TypeScript needs to be written to make the data loading and analysis for Gerrit analysis and connectivity work. PRs very much accepted!

GerritStats

This project provides tools to display statistics from a Gerrit repository. It generates output in HTML format.

The tool can be useful for analysing how efficiently code reviews are implemented in an organization, and what kind of virtual teams are formed in the review process.

The tool will generate a set of HTML files that include graphs and charts, such as a proximity graph of the developers, based on how many review comments they write to each other, as well as a per-developer page that lists all their review comments and links back to the reviews.

There are two separate command-line tools:

  • GerritDownloader, which downloads JSON data from the server
  • GerritStats, which parses the json output provided by GerritDownloader, and generates HTML output.

Demo

A demo of the resulting HTML output is available at:

http://gerritstats-demo.firebaseapp.com

How to build

The tool should work fine on OS X and Linux. Windows is not supported; if it works, it's not intended.

Java 8 is required.

# Prerequisite: if using OS X, install brew from http://brew.sh

brew install npm # or, if not using OS X, install npm some other way

./gradlew assemble

How to execute

./gerrit_downloader.sh

Lists all command line options for the data download tool.

./gerrit_stats.sh

Lists all command line options for the statistics generator.

How to execute: saving data locally

Fetching data from Gerrit can take a while. Use GerritDownloader to get the JSON output from the server so that you can parse it later:

./gerrit_downloader.sh --server gerrit.instance.on.inter.nets --project YourProjectName --limit 7500 --output-dir gerrit_out/

The above command will download all data from the given Gerrit server and given project, and store the data in .json format in the given output directory.

If you have multiple projects in Gerrit and want to take a look at all the data, omit the --project argument. This will download data for all projects you have access to:

./gerrit_downloader.sh --server gerrit.instance.on.inter.nets --output-dir gerrit_out/

How to execute

Once you have the data, generate HTML output like so:

./gerrit_stats.sh -f gerrit_out/

You can also pass several other arguments, like pointing to a specific file, or including only a subset of developers.

./gerrit_stats.sh --file gerrit-json-out.txt --branches master --include [email protected],[email protected],[email protected] --list-commits-exceeding-patch-set-count 5

How to develop the UI

  1. ./gradlew assemble (or use e.g. IntelliJ to build)
  2. cd GerritStats && npm run generateData -- -f your_data_file.json
  3. npm run webpack-watch
  4. Open the output in GerritStats/out-html and start development.

Screenshots

A fully functional demo can be found at http://gerritstats-demo.firebaseapp.com but there are some screenshots below that illustrate what this tool provides.

The index page will provide you with a sortable overview table of some of the core statistics:

Overview table of all developers

In the overview page, you can also uncheck some users, like bots, so that they're excluded from the analysis.

The index page also contains a graph that illustrates how developers are connected to each other:

Proximity graph for the given branch and given set of identities

The Profile page contains detailed information about the selected user. Apart from some basic numbers also visible on the overview, there's several charts and graphs, illustrating how reviews are done by and for this person.

There's a chart and a table showing who this user adds as a reviewer, and how often they approve the changes:

A chart and table showing who this user adds as a reviewer, and how often they approve the changes

A team graph, centered around this user, shows with whom the reviews are done with, and how strong the relations between others in the team are:

Proximity graph around this user that displays only the users this person does reviews with

A per-day chart of the number of reviews done by this user.

There's a chart showing cumulative statistics of commits, and how many comments were written or received over time:

Cumulative statistics chart of commits, and comments written/received

There's also a chart that shows commits in which the user iterated, got reviews, and iterated some more - a highly time-consuming activity for all parties:

A timeline illustrating highly iterative commits where reviewers were involved

Apart from these, there's many other bits of data being shown, so take a look at the demo app linked above!

gerritstats's People

Contributors

chrisinmtown avatar dorian73 avatar haraldf avatar holmari avatar opalmer avatar sschuberth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gerritstats's Issues

Deploy nodejs express to display the out-html

Deploy node js to display the out-html
docker-compose docker-compose.yml and add server.js to out-html (refs:https://stackoverflow.com/questions/13339695/nodejs-w-express-error-cannot-get )

$ cat docker-compose.yml

version: "3"
services:
node:
image: node:16
container_name: gerritstats-3003
hostname: node
ports:
- "3003:3000"
working_dir: /app
volumes:
- ./out-html:/app
command: ["/bin/bash", "-c", "npm add express && node server.js"]
restart: always

$ cat out-html/server.js

const express = require('express')
const app = express()
const port = 3000

app.use(express.static(__dirname));
app.listen(port, () => {
console.log(Example app listening at http://localhost:${port})
})

--exclude works only emails.

I tried to originally remove few jenkins bots (making comments to gerrit reviews based on build results) from gerritstats but it didnt seem to work. Help says following:

--exclude If specified, the comma-separated list of identities will be excluded from all generated statistics. Default: []
I passed "jenkins,fin-jenkins" but neither of the accounts where removed from statistics. Fix was quite evident after browsing the javascript: exclude expects emails.

However, in my case, one of the bot does not provide email in their gerrit messages so gerritstats is not able to remove it.

This is another usecase for supporting mailmap - bots/people who do not have proper git config setup can then be fixed/grouped into a single user during generation of the stats. See #26

Unable to install on OSX

Hello,

I am trying to install this on OSX ElCapitan. On running ./gradlew assemble I was prompted to run as admin so I retried using sudo. Am getting the following error

npm ERR! path /workspaces/gerrit/gerritstats/GerritStats/node_modules/npm/node_modules/dezalgo
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/workspaces/gerrit/gerritstats/GerritStats/node_modules/npm/node_modules/dezalgo' -> '/workspaces/gerrit/gerritstats/GerritStats/node_modules/npm/node_modules/.dezalgo.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nprabhu/.npm/_logs/2018-01-23T00_30_56_048Z-debug.log
:GerritStats:npmInstall FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':GerritStats:npmInstall'.
> Process 'command 'npm'' finished with non-zero exit value 254

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I tried installing dezalgo using npm: npm install dezalgo but this does not solve my problem.

Any suggestions would be most helpful.

Execution failed for task ':GerritCommon:compileJava'.

while executing ./gradlew assemble getting BUILD FAILED.

/home/username/gerritstats-master/GerritCommon/src/main/java/com.holmsted/resources/ResourceReader.java:21: illegal start of type
List lines = new ArrayList<>();
^
2 errors
:GerritCommon:compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':GerritCommon:compileJava'.

    Compilation failed; see the compiler error output for details.

how to gather data from multiple gerrit servers and multiple projects?

It seems that the documentation lacks information about how to gather data from multiple gerrit instances and multiple projects.

The idea of downloading all projects where you have access to does not make any sense for anything else than very small deployments.

We use 4-5 instances, one internal and the rest public, like gerrithub.io which is HUGE and where we have projects under multiple organizations, so we need a way to gather these in a single place.

BUILD FAILED

Hi, I tried to build the project on my mac running High Sierra, I'm getting this:

In file included from ../../nan/nan.h:192: ../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object' return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); ~~~ ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:174:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:91:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:167:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:91:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:160:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:91:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return scope.Escape(node::MakeCallback( ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:174:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/jossiftomash/.node-gyp/10.11.0/include/node/node.h:91:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ 4 warnings and 1 error generated. make: *** [Release/obj.target/binding/src/binding.o] Error 1 gyp ERR! build error gyp ERR! stack Error: makefailed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/jossiftomash/source/gerritstats/GerritStats/node_modules/node-gyp/lib/build.js:258:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Darwin 17.7.0 gyp ERR! command "/usr/local/Cellar/node/10.11.0/bin/node" "/Users/jossiftomash/source/gerritstats/GerritStats/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /Users/jossiftomash/source/gerritstats/GerritStats/node_modules/node-sass gyp ERR! node -v v10.11.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install:node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jossiftomash/.npm/_logs/2018-10-04T13_33_58_361Z-debug.log
:GerritStats:npmSetup FAILED`

Problems building gerritstats on Linux

Hi,

I'm trying to build gerritstats on a Debian machine. Gerritdownloader builds fine, but the build fails for the gerritstat tool. I have nodejs 8.5 installer (I have tried with the 8.11 as well).

13:36:30.369 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :GerritStats:nodeSetup SKIPPED
13:36:30.377 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :GerritStats:nodeSetup (Thread[Daemon worker Thread 2,5,main]) completed. Took 0.032 secs.
13:36:30.392 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :GerritStats:npmSetup (Thread[Daemon worker Thread 2,5,main]) started.
13:36:30.399 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :GerritStats:npmSetup
13:36:30.405 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':GerritStats:npmSetup'
13:36:30.412 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':GerritStats:npmSetup' is up-to-date
13:36:30.418 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':GerritStats:npmSetup' (up-to-date check took 0.0 secs) due to:
  No history is available.
13:36:30.426 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':GerritStats:npmSetup'.
13:36:30.434 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'npm''. Working directory: /automount/home/hjonsson/gerrit/gerritstats-master/GerritStats Command: npm install [email protected]
13:36:30.440 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'npm'': {PATH=/usr/local/bin:/usr/bin:/bin:/usr/games, LANGUAGE=en_US:en, http_proxy=http://ndefra00em04.bt.bombardier.net:8080/, SHELL=/usr/bin/zsh, SSH_CLIENT=10.160.166.231 51839 22, SSH_TTY=/dev/pts/1, TERM=xterm, OLDPWD=/home/hjonsson/gerrit/gerritstats-master, USER=hjonsson, XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt, LANG=en_US.UTF-8, SSH_CONNECTION=10.160.166.231 51839 10.162.3.122 22, MAIL=/var/mail/hjonsson, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, LOGNAME=hjonsson, PWD=/home/hjonsson/gerrit/gerritstats-master, SHLVL=1, HOME=/home/hjonsson}
13:36:30.445 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
13:36:30.451 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'npm'.
13:36:30.459 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
13:36:30.473 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'npm'' finished with exit value -1 (state: FAILED)
13:36:30.487 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':GerritStats:npmSetup'
13:36:30.497 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :GerritStats:npmSetup FAILED

There seems to be some problem with the npm command. But I can't see what.

Build fails ./gradlew assemble

Error message: * What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Visualize sizeInsertions and sizeDeletions data

Sum the insertions and deletions per author to display in an overview.

Nice-to-have: perhaps some kind of chart over time, showing lines changed (added/removed). Consider this similar to the "Contributors" chart in GitHub. Similarly, rather than breaking down to commits per month and comments per month, also consider SLOC-changed per month, especially over time.

Reason for this is that sometimes commit velocity is not sufficient to give a good indication of what kind of work is being done. But SLOC insertions/deletions over time might be a better view (for some people). So having the option to see both views, or combination (like average SLOC per commit) would help give more detail.

README mentions option "list-commits-exceeding-patch-set-count" for gerrit_stats.sh but it does not seem to exist

As per the title, it looks to me like the option mentionned in the README does not exist anymore.

Also, using "git log -p -S list-commits-exceeding-patch-set-count", I stumbled upon a related commit b9a5ba7 :

commit b9a5ba74eb4900ce1984588ea58661e724b5b1c1
Author: Lasse Holmstedt <[email protected]>
Date:   Tue Aug 25 22:03:44 2015 +0200

    Create a chart of commits that exceed n patch sets
    
    Rename the command line argument to --commit-patch-set-count-threshold in
    preparation to always make the listing occur, with some default value set.

But even trying to use "commit-patch-set-count-threshold" did not quite work for me and it looks like this was deleted with 1b08f25 :

commit 1b08f250233eaa0d2c327a352961ac665633fa02
Author: Lasse Holmstedt <[email protected]>
Date:   Tue Sep 27 22:27:16 2016 -0700

    Add pmd to gradle check step
    
    The config file is from
    https://github.com/GoogleCloudPlatform/google-cloud-java
    with minor modifications, and licensed under Apache license.
    
    As with checkstyle, this can be run with:
    ./gradlew check
    ./gradlew clean check

I'm happy to submit a PR to update the doc if needed.

Link to comment does not quite work because URL format changed ("/#/c/" not expected anymore)

On the particular instance of Gerrit I am using, the link to comments do not work. In fact, it looks like the format of the link has changed at some point (removing the "/#/c" part) and the gerritstats code was not updated accordingly.

If anyone is facing the same issue, here is the fix to change things:

--- a/GerritStats/src/main/frontend/profile/ReviewCommentsPanel.jsx
+++ b/GerritStats/src/main/frontend/profile/ReviewCommentsPanel.jsx
@@ -17,7 +17,8 @@ import SelectedUsers from '../common/model/SelectedUsers';
 function getGerritUrlForComment(commit, patchSet, comment) {
     var url = commit.url;
     var baseUrl = url.substring(0, url.lastIndexOf('/'));
-    return baseUrl + '/#/c/' + commit.commitNumber + '/' + patchSet.number + '/' + comment.file;
+    return baseUrl + '/' + commit.commitNumber + '/' + patchSet.number + '/' + comment.file;
+    //return baseUrl + '/#/c/' + commit.commitNumber + '/' + patchSet.number + '/' + comment.file;
 }
 
 function escapeHtml(text) {

I do not know when the format got changed on the Gerrit side but it is it old enough, I'm happy to provide a PR for this.

Can't Find files "GerritDownloader.jar" & "GerritStats.jar"

Hi,
while running these scripts it tries to find JAR files but they are missing.

  1. ./gerrit_stats.sh
    Error: Unable to access jarfile GerritStats/build/libs/GerritStats.jar

  2. ./gerrit_downloader.sh
    Error: Unable to access jarfile /opt/gerrit_workspace/Gerrit_Plugins/byHolmari/gerritstats/GerritDownloader/build/libs/GerritDownloader.jar

In both paths, the build files are missing.

can you help me out
Thanks

How to parse commit message

We have BUGID mentioned inside every commit message, like below.
BUGID: 123456, 234567

Is it possible to parse commit message for BUGID and make it available in analytics report ?

Corrupted npm package

Hi,

It looks like the npm 3.10.5 package in the dependencies is corrupted and the shasum check fails.
I am behind a corporate proxy, but I doubt it is the cause: the downloaded tar archive cannot be processed by tar correctly neither.

Error:

:GerritStats:npmSetupnpm ERR! Linux 3.10.0-514.10.2.el7.x86_64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "[email protected]"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10

npm ERR! shasum check failed for /tmp/npm-83-dd032ba8/registry.npmjs.org/npm/-/npm-3.10.5.tgz
npm ERR! Expected: 4753bfbb1526077d61c3b6a251cff61a22206cc6
npm ERR! Actual:   d9eab943f20ae7a8d28f29f10c79f7a8e192bdf9
npm ERR! From:     https://registry.npmjs.org/npm/-/npm-3.10.5.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/gerritstats/gerritstats/GerritStats/npm-debug.log
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':GerritStats:npmSetup'.
> Process 'command 'npm'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Support --projects in gerrit_downloader

I'd like to use gerrit downloader with prefixes. This means using 'projects:prefix' instead of 'project:{^project}`

Here is a quick hack to make it work, but it would be nicer to add a '--projects' option doing that.

$ git diff
diff --git a/GerritDownloader/src/main/java/com/holmsted/gerrit/downloaders/ssh/SshDownloader.java b/GerritDownloader/src/main/java/com/holmsted/gerrit/downloaders/ssh/SshDownloader.java
index 862d437..ce4fd4d 100644
--- a/GerritDownloader/src/main/java/com/holmsted/gerrit/downloaders/ssh/SshDownloader.java
+++ b/GerritDownloader/src/main/java/com/holmsted/gerrit/downloaders/ssh/SshDownloader.java
@@ -255,9 +255,9 @@ public class SshDownloader extends AbstractGerritStatsDownloader {
                 throw new IllegalStateException("No project name defined!");
             }
             if (afterDate != null) {
-                this.gerritQuery = String.format("project:{^%s} after:{%s}", projectNameList, afterDate);
+                this.gerritQuery = String.format("projects:%s after:{%s}", projectNameList, afterDate);
             } else {
-                this.gerritQuery = String.format("project:{^%s}", projectNameList);
+                this.gerritQuery = String.format("projects:%s", projectNameList);
             }
         }

time filter

Very nice tool! Greatly appreciated.

The only thing I missed was a way to filter the output (either when generating stats or in the generated web page) based on time.
E.g. only show info for the last month or from 1 jan onwards, or from Feb 1 to Mar 5

Empty index.html file even though the json file is present and has the data in it

Hi,

I successfully ran the gerrit_stats.sh after generating the json file using gerrit_downloader.sh but the index.html remains empty, Here is the log:

./gerrit_stats.sh -f gerrit_out/sonom.json
Warning: file 'gerrit_out/sonom.json' does not exist, skipping.
Creating overview.js
Creating datasetOverview.js
Creating ids.js
Output written to /tmp/gerritstats-master/GerritStats/out-html/data

[email protected] prewebpack /tmp/gerritstats-master/GerritStats
mkdir -p out-html && cp src/main/frontend/index.html out-html/

[email protected] webpack /tmp/gerritstats-master/GerritStats
webpack --display-error-details --colors --progress --config webpack.config.js

Hash: 0ab6c21e5dcb5c52313e
Version: webpack 1.14.0
Time: 18469ms
Asset Size Chunks Chunk Names
f4769f9bdb7466be65088239c12046d1.eot 20.1 kB [emitted]
448c34a56d699c29117adc64c43affeb.woff2 18 kB [emitted]
fa2772327f55d8198301fdb8bcfc8158.woff 23.4 kB [emitted]
e18bbf611f2a2e43afc071aa2f4e1512.ttf 45.4 kB [emitted]
89889688147bd7575d6327160d64e760.svg 109 kB [emitted]
4713eef7edb06b1e8b4e1e4a6c489a5c.png 19.8 kB [emitted]
a3b60647ef11633dfce07443e8ebcc56.png 19.8 kB [emitted]
bundle.js 3.12 MB 0 [emitted] main
+ 742 hidden modules
Output generated to /tmp/gerritstats-master/out-html

For some reason its unable to find the json file even though I see the json file in the gerrit_out dir and has all the data in it.

Permission denied (publickey)

Hi,

I have tried to execute a downloader command to get JSON data. But it failed at point of command execution , due to some permission issue.
My project is maintained at gerrit. and i have generated keys and registered to gerrit server also.
Command executed :
./gerrit_downloader.sh --server MyServerName --project MyProjectName --limit 10 --output-dir MyOutput/

Output :

Reading data from MyServerName:29418 for last 10 commits
ssh -p 29418 MyServerName gerrit query project:^ MyProjectName --format=JSON --all-approvals --all-reviewers --comments
Process exited with return code 255 and output:
Permission denied (publickey).

Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '%s'
at java.util.Formatter.format(Formatter.java:2519)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2927)
at com.holmsted.gerrit.GerritStatsDownloaderMain.main(GerritStatsDownloaderMain.java:35)

Inaccurate gerrit version parsing

Given gerrit version 2.12

Attempt to fetch json failing with:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
	at com.holmsted.gerrit.GerritVersion.fromString(GerritVersion.java:25)
	at com.holmsted.gerrit.downloaders.ssh.GerritSsh.version(GerritSsh.java:27)
	at com.holmsted.gerrit.downloaders.Downloader.download(Downloader.java:45)
	at com.holmsted.gerrit.GerritStatsDownloaderMain.main(GerritStatsDownloaderMain.java:17)

Query Gerrit REST API https access using curl/wget tools

Extend the gerritstats downloader to query the REST API via HTTPS using curl or wget. This will allow use of this stats tool on gerrit repositories that block access to statistics by SSH but grant access via anonymous HTTPS.

Unfortunately the protocols are sharply different. The SSH access path is script friendly; the REST API is machine friendly. Both return JSON, but formatted significantly differently.

https://gerrit-review.googlesource.com/Documentation/rest-api.html

Module not found after ./gerrit_stats.sh

Hi! Great project, thank you so much for sharing!

I get some warnings when running npm install in GerritStats:

npm WARN [email protected] requires a peer of react@^0.14.0 || ^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@^0.14.0 || ^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of node-sass@^3.4.2 || ^4.0.0 but none was installed.

And then when running ./gerrit_stats.sh i get a looooot of Module not found:.

limit parameter not working as expected

Hi,

Limit parameter is not working as expected. whether will give --limit 10 OR --limit 1, in all cases , Its downloading last 500 commits gerrit data of Project. Please let me know , If below command is incorrect .

./gerrit_downloader.sh --server MyServerName --project MyProjectName --limit 10 --output-dir MyOutput/

Use Mailmap to combine multiple accounts

In some cases, developers tend to have quite lax behaviour when it comes to setting up their user.name & user.email settings to the git repo they are working on. This leads to scenarios where a single user can be shown as multiple users if she has made commits/reviews with different settings.

Git itself has a functionality to map these cases into a single user via "mailmap" file. See: https://git-scm.com/docs/git-shortlog#_mapping_authors - this sort of a map file is used by other tools also like gitstats ( https://github.com/hoxu/gitstats )

I think it would be a good feature get a author mapping also to gerritstats.

[IDEA] Add commit size to stats

Each commit contains a size of add/removed lines.
It would be helpful to have stats on changes size (to encourage working in small changes)
It could be something like avg. change size.

Build Failure on Ubuntu 14.04

I'm trying to build gerritstats by following the readme on ubuntu 14.04.

It first complained that npm wasn't installed, so I apt-get'ed it.

It then complained that node wasn't installed, so I apt-get'ed it too

It then fails with:

npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/block-stream

[email protected] install /home/rschmitt/git/gerritstats/GerritStats/node_modules/node-sass
node scripts/install.js

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1
npm ERR! not ok code 0
:GerritStats:npmInstall FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':GerritStats:npmInstall'.

Process 'command 'npm'' finished with non-zero exit value 1

It might be due to legacy node, since it says it's replaced with nodejs. But nodejs is installed. So, I don't know. Does any of this sound familiar?

Rich

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.