Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !5212

Closed
Created Sep 28, 2013 by Administrator@rootOwner
  • Report abuse
Report abuse

Expose merge_request.closed, .merged, merge_request/:id/commits to API

  • Overview 6
  • Commits 1
  • Changes 4

Created by: doublerebel

Hello,

This is a more complete version of PR #2179 I submitted earlier this year. It exposes a few attributes of MergeRequest which are needed for "pretty" PR merging, as with jresig/pulley, creating pulley-gitlab.

I have rebased the PR against master branch and added RSpec tests for the new features.

Although I learned a ton about RoR while adding this feature, I am stumped by the 2nd test. It fails with:

Failure/Error: get api("/projects/#{project.id}/merge_request/#{merge_request.id}/commits", user)
    ActionController::RoutingError:
       No route matches [GET] "/api/v3/projects/785/merge_request/395/commits"

I have written a rake task helper to show me the API routes:

lib/task/gitlab/api_routes.rake

desc "API Routes"
task api_routes: :environment do
  API::API.routes.each do |api|
    method = api.route_method.ljust(10)
    path = api.route_path
    puts "     #{method} #{path}"
  end
end

Which shows me that my new route does exist in the test environment:

$ sudo -u git -H bundle exec rake api_routes RAILS_ENV=test
...
GET   /:version/projects/:id/merge_request/:merge_request_id/commits(.:format)
...

Does GitLab cache routes? Have I implemented the test incorrectly? I have pored over the sources and tried other solutions to no avail.

Many thanks for GitLab! I am happy to continue work on this PR and appreciate any help or hints from the community.

Best,

Charles

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/doublerebel/merge_request_commits_for_pulley