Skip to content
Snippets Groups Projects
Commit 648a2797 authored by Tomasz Maczukin's avatar Tomasz Maczukin
Browse files

Move build data to 'last_build' namespace in commit details

parent 66221057
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,8 +10,6 @@ class Commit
attr_mentionable :safe_message, pipeline: :single_line
participant :author, :committer, :notes
 
delegate :duration, :started_at, :finished_at, :coverage, to: :ci_commit, allow_nil: true
attr_accessor :project
 
# Safe amount of changes (files and lines) in one commit to render
Loading
Loading
Loading
Loading
@@ -73,14 +73,18 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
"parent_ids": [
"ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
],
"status": "running",
"coverage": null,
"duration": 2,
"started_at": "2015-12-24T17:54:09.744Z",
"finished_at": "2016-01-11T10:14:09.526Z"
"last_build": {
"status": "failed",
"coverage": null,
"duration": 2,
"started_at": "2015-12-24T17:54:09.744Z",
"finished_at": "2016-01-11T10:14:09.526Z"
}
}
```
 
`duration` in `last_build` - value exposed in **seconds**
## Get the diff of a commit
 
Get the diff of a commit in a project.
Loading
Loading
Loading
Loading
@@ -102,23 +102,27 @@ Parameters:
"author_name": "Administrator",
"authored_date": "2012-04-25T13:12:15.000+01:00",
"committed_date": "2012-04-25T13:12:15.000+01:00",
"coverage": null,
"created_at": "2012-04-25T13:12:15.000+01:00",
"duration": 0,
"finished_at": null,
"id": "6c14056df0be27374e849ad67295a22cd0f7e0d0",
"message": "Add some fixes",
"parent_ids": [
"6b053ad388c531c21907f022933e5e81598db388"
],
"short_id": "6c14056d",
"started_at": null,
"status": "pending",
"title": "Add some fixes"
"title": "Add some fixes",
"last_build": {
"coverage": null,
"duration": 0,
"finished_at": null,
"started_at": "2012-04-25T13:15:15.000+01:00",
"status": "running"
}
}
}
```
 
`duration` in `last_commit` > `last_build` - value exposed in **seconds**
## Get single MR commits
 
Get a list of merge request commits.
Loading
Loading
Loading
Loading
@@ -131,10 +131,17 @@ module API
expose :safe_message, as: :message
end
 
class RepoCommitLastBuild < Grape::Entity
expose :status
expose :started_at
expose :finished_at
expose :duration
expose :coverage
end
class RepoCommitDetail < RepoCommit
expose :parent_ids, :committed_date, :authored_date
expose :status
expose :started_at, :finished_at, :duration, :coverage
expose :ci_commit, as: :last_build, with: Entities::RepoCommitLastBuild
end
 
class ProjectSnippet < Grape::Entity
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment