| commit | e9630dbff88cbd48c31a0803a10c92f9278b5cc4 | [log] [tgz] |
|---|---|---|
| author | Antonio Barone <syntonyze@gmail.com> | Tue Aug 03 11:51:19 2021 +0200 |
| committer | Antonio Barone <syntonyze@gmail.com> | Tue Aug 03 11:51:19 2021 +0200 |
| tree | 7cd3cfb729784d1a149c80fe1302cd067b92d078 | |
| parent | e2623868c59411528798bfdcd44f476e31de14af [diff] | |
| parent | 1e3e011b190e5d9cd4e292fa744fd4dc4196dac2 [diff] |
Merge branch 'stable-3.2' into stable-3.3 * stable-3.2: Consume scheduled replication events Add gerrit CI validation Change-Id: I022a04c0381288545b9327c65052de5917f814ad
Record and display the repository's replication status without having to dig into the Gerrit replication_log
Consumes replication events and updates a cache with the latest replication status of specific refs to specific remotes.
The cache information is then exposed via a project's resource REST endpoint:
curl -v --user <user> '<gerrit-server>/a/projects/<project-name>/remotes/<remote-url>/replication-status'
For instance, to assess the replication status of the project some/project to the https://github.com/some/project.git URL, the following endpoint should be called:
curl -v --user <user> '<gerrit-server>/a/projects/some%2Fproject/remotes/https%3A%2F%2Fgithub.com%2Fsome%2Fproject.git/replication-status'
A payload, similar to this may be returned:
{
"remotes": {
"https://github.com/some/project.git": {
"status": {
"refs/changes/01/1/meta": {
"status": "SUCCEEDED",
"when": 1626688830
},
"refs/changes/03/3/meta": {
"status": "SUCCEEDED",
"when": 1626688854
},
"refs/changes/03/3/1": {
"status": "SUCCEEDED",
"when": 1626688854
},
"refs/changes/02/2/1": {
"status": "SUCCEEDED",
"when": 1626688844
},
"refs/changes/02/2/meta": {
"status": "SUCCEEDED",
"when": 1626688844
},
"refs/changes/01/1/1": {
"status": "SUCCEEDED",
"when": 1626688830
}
}
}
},
"status": "OK",
"project": "some/project"
}
The endpoint returns different HTTP response code depending on the result:
The REST-API response shows a status field, which shows the overall replication-status of the projects for the specified remote.
OK - all the refs have successfully replicatedFAILED - Some refs have not replicated successfully