From 82e92a0900f76d208faf94629c90309201d05914 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Wed, 6 Apr 2016 14:32:36 +0200 Subject: [PATCH 1/2] API: Expose open_issues_count, closed_issues_count, open_merge_requests_count on labels --- doc/api/labels.md | 40 ++++++++++++++++++++-------------------- lib/api/entities.rb | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/doc/api/labels.md b/doc/api/labels.md index 544e898b6aa..3730c07c5a7 100644 --- a/doc/api/labels.md +++ b/doc/api/labels.md @@ -23,42 +23,42 @@ Example response: { "name" : "bug", "color" : "#d9534f", - "description": "Bug reported by user" + "description": "Bug reported by user", + "open_issues_count": 1, + "closed_issues_count": 0, + "open_merge_requests_count": 1 }, { "color" : "#d9534f", "name" : "confirmed", - "description": "Confirmed issue" + "description": "Confirmed issue", + "open_issues_count": 2, + "closed_issues_count": 5, + "open_merge_requests_count": 0 }, { "name" : "critical", "color" : "#d9534f", - "description": "Criticalissue. Need fix ASAP" - }, - { - "color" : "#428bca", - "name" : "discussion", - "description": "Issue that needs further discussion" + "description": "Criticalissue. Need fix ASAP", + "open_issues_count": 1, + "closed_issues_count": 3, + "open_merge_requests_count": 1 }, { "name" : "documentation", "color" : "#f0ad4e", - "description": "Issue about documentation" + "description": "Issue about documentation", + "open_issues_count": 1, + "closed_issues_count": 0, + "open_merge_requests_count": 2 }, { "color" : "#5cb85c", "name" : "enhancement", - "description": "Enhancement proposal" - }, - { - "color" : "#428bca", - "name" : "suggestion", - "description": "Suggestion" - }, - { - "color" : "#f0ad4e", - "name" : "support", - "description": "Support issue" + "description": "Enhancement proposal", + "open_issues_count": 1, + "closed_issues_count": 0, + "open_merge_requests_count": 1 } ] ``` diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 340fc5452ab..cd0d16e5316 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -293,6 +293,7 @@ module API class Label < Grape::Entity expose :name, :color, :description + expose :open_issues_count, :closed_issues_count, :open_merge_requests_count end class Compare < Grape::Entity From 5083e5b616d2ba9b2812920c8d6cf3e0f95389e1 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Wed, 6 Apr 2016 19:07:23 +0200 Subject: [PATCH 2/2] Add changelog item --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 8db9a9b0d1e..05d8270b5b4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ v 8.7.0 (unreleased) - Add endpoints to archive or unarchive a project !3372 - Add links to CI setup documentation from project settings and builds pages - Handle nil descriptions in Slack issue messages (Stan Hu) + - API: Expose open_issues_count, closed_issues_count, open_merge_requests_count for labels (Robert Schilling) - Add default scope to projects to exclude projects pending deletion - Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.) - Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)