PivotalTracker Source Commits Endpoint
Created by: ghost
Hi,
I've added a simple PivotalTracker Service for the Source Commits Endpoint (https://www.pivotaltracker.com/help/api/rest/v5#Source_Commits).
If there's something missing, please let me know.
Thanks for GitLab, it's a great OpenSource Project!
Best Regards
Merge request reports
Activity
Created by: Razer6
Thank you for your effort. Please also add tests therefore like the other services do: https://github.com/gitlabhq/gitlabhq/blob/master/features/project/service.feature
By Administrator on 2013-09-25T06:54:55 (imported from GitLab project)
By Administrator on 2013-09-25T06:54:55 (imported from GitLab)
- app/models/pivotaltracker_service.rb 0 → 100644
39 url = 'https://www.pivotaltracker.com/services/v5/source_commits' 40 push[:commits].each do |commit| 41 message = { 42 'source_commit' => { 43 'commit_id' => commit[:id], 44 'author' => commit[:author][:name], 45 'url' => commit[:url], 46 'message' => commit[:message] 47 } 48 } 49 PivotaltrackerService.post( 50 url, 51 body: message.to_json, 52 headers: { 53 'Content-Type' => 'application/json', 54 'X-TrackerToken' => token - app/models/pivotaltracker_service.rb 0 → 100644
31 32 def fields 33 [ 34 { type: 'text', name: 'token', placeholder: '' } 35 ] 36 end 37 38 def execute(push) 39 url = 'https://www.pivotaltracker.com/services/v5/source_commits' 40 push[:commits].each do |commit| 41 message = { 42 'source_commit' => { 43 'commit_id' => commit[:id], 44 'author' => commit[:author][:name], 45 'url' => commit[:url], 46 'message' => commit[:message] Created by: dzaporozhets
Please use better formatting
message = { 'source_commit' => { 'commit_id' => commit[:id], 'author' => commit[:author][:name], 'url' => commit[:url], 'message' => commit[:message] } }
By Administrator on 2013-09-25T14:54:40 (imported from GitLab project)
By Administrator on 2013-09-25T14:54:40 (imported from GitLab)
- app/models/pivotaltracker_service.rb 0 → 100644
36 end 37 38 def execute(push) 39 url = 'https://www.pivotaltracker.com/services/v5/source_commits' 40 push[:commits].each do |commit| 41 message = { 42 'source_commit' => { 43 'commit_id' => commit[:id], 44 'author' => commit[:author][:name], 45 'url' => commit[:url], 46 'message' => commit[:message] 47 } 48 } 49 PivotaltrackerService.post( 50 url, 51 body: message.to_json, Created by: ghost
Thanks for reviewing!
@razer6 Added the tests accordingly
@randx Syntax cleaned up
By Administrator on 2013-09-25T14:56:06 (imported from GitLab project)
By Administrator on 2013-09-25T14:56:06 (imported from GitLab)