Important
Tool is fully dependent on server response. Servers may differ and change overtime. If you encounter errors in results, please report.
Tool for loading merge requests from Gerrit. Github functionality will be added later.
MR-loader workflow:
- Identify
maxId(the largest existing ID number of pull requests). It's done by requesting a batch of the most recent pull requests. - Iterate over all integers until
maxIDand send the requests via REST API to load all required information of code changes with the specified ID. Unmodified responses from server stored inwork_dir/gerrit/url_dir/changesdirectory where each file map with following structuremap[changeID] = jsonResponse. - Iterate over all loaded changes in
work_dir/gerrit/url_dir/changesand load comments if needed towork_dir/gerrit/url_dir/comments. Files inwork_dir/gerrit/url_dir/commentsinclude a map with the following structuremap[changeID] = jsonResponse. - Iterate over all loaded changes in
work_dir/gerrit/url_dir/changesand comments inwork_dir/gerrit/url_dir/commentsto create a dataset inwork_dir/dataset/gerrit/
You can use tool as CLI via docker.
First, choose a working folder for storing all the results. You can set it via mounting volume to /root of docker
container
--volume ~/your/folder/path:/root. After you need to call the GerritLoad command with arguments. List of
arguments you can get via:
docker run --volume ~/your/folder/path:/root -it ghcr.io/jetbrains-research/mr-loader/mr-loader:latest GerritLoad -hExample run to load all available changes from http://review.openstack.org :
docker run --volume ~/your/folder/path:/root -it ghcr.io/jetbrains-research/mr-loader/mr-loader:latest GerritLoad --url http://review.openstack.orgAll dataset parts stored in work_dir/dataset/gerrit/
Stored in work_dir/dataset/gerrit/changes.
| created_at | number | key_user | status | comment | key_change | updated_time | subject |
|---|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | ... | ... |
Stored in work_dir/dataset/gerrit/changes_files
| key_change | key_file |
|---|---|
| ... | ... |
Stored in work_dir/dataset/gerrit/changes_files
| key_change | key_user |
|---|---|
| ... | ... |
Stored in work_dir/dataset/gerrit/commits
| oid | committed_date | key_commit | key_change |
|---|---|---|---|
| ... | ... | ... | ... |
Stored in work_dir/dataset/gerrit/commits_author
| key_commit | author_key_user | committer_key_user | uploader_key_user |
|---|---|---|---|
| ... | ... | ... | ... |
Stored in work_dir/dataset/gerrit/commits_file
| key_commit | key_file | lines_inserted | lines_deleted | size | size_delta | status |
|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | ... |
Stored in work_dir/dataset/gerrit/files
| path | key |
|---|---|
| ... | ... |
Stored in work_dir/dataset/gerrit/users
| name | login | |
|---|---|---|
| ... | ... | ... |