Allows external services to set a state on revisions to consult it directly in Redmine. This plugin is highly based on Github's Commit Status API.
This plugin version is compatible only with Redmine 4.2 and later.
-
Download the .ZIP archive, extract files and copy the plugin directory to
#{REDMINE_ROOT}/plugins/redmine_changeset_statuses
. -
Make a backup of your database, then run the following command to update it:
bundle exec rake redmine:plugins:migrate NAME=redmine_changeset_statuses RAILS_ENV=production
-
Restart Redmine.
-
Make a backup of your database, then rollback the migrations:
bundle exec rake redmine:plugins:migrate NAME=redmine_changeset_statuses VERSION=0 RAILS_ENV=production
-
Remove the plugin's folder from
#{REDMINE_ROOT}/plugins
. -
Restart Redmine.
By using the endpoints described below, you can add a status to a revision. This status will then be displayed in Redmine on associated revisions to an issue.
A common use cases is to add statuses from a continuous integration system like Jenkins. Then, you'll be able to see the build status and access it directly from Redmine.
Users with permission "Commit access" to a repository can create commit statuses for a given revision.C
POST /projects/:project/repository/statuses/:revision.json
Name | Type | Description |
---|---|---|
context |
string |
Required. A string label to differentiate this status from the status of other systems. |
state |
string |
Required. The state of the status. Can be one of error , failure , pending , or success . |
target_url |
string |
The target URL to associate with this status. |
description |
string |
A short description of the status. |
{
"context": "continuous-integration/jenkins",
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!"
}
Users with permission "View changesets" to a repository can retrieve all statuses for a specific revision. Statuses are displayed in reverse chronological order.
GET /projects/:project/repository/statuses/:revision.json
{
"statuses": [
{
"id": 2,
"context": "continuous-integration/jenkins",
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!",
"created_on": "2019-02-26T18:02:27Z"
}
],
"total_count": 1,
"offset": 0,
"limit": 25
}
Users with permission "View changesets" to a repository can retrieve all statuses for a specific revision. For a combined status, only the last status for each context is displayed in reverse chronological order. Additionally, a combined state
is returned.
GET /projects/:project/repository/revisions/:revision/status.json
{
"statuses": [
{
"id": 2,
"context": "continuous-integration/jenkins",
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!",
"created_on": "2019-02-26T18:02:27Z"
}
],
"state": "success",
"total_count": 1,
"offset": 0,
"limit": 25
}
Run tests using the following command:
bundle exec rake redmine:plugins:test NAME=redmine_changeset_statuses RAILS_ENV=development
Please see CONTRIBUTING and CODE OF CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
This code is licensed under the MIT license. Please see the license file for more information.