Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
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
  • !6586

Merged
Created 11 years ago by Administrator@rootOwner

added api method to return labels of a given project

  • Overview 16
  • Commits 5
  • Changes 4

Created by: abner

This add a feature to api to allow return a list of labels of a project.

Loading
Loading

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: jvanbaarsen

    @abner Thanks for your contribution! What do you think about moving the specs into the api/project_spec.rb file? The GET /projects/:id/snippets is also in there. And you also did the change in project.rb

    By Administrator on 2014-03-21T18:42:51 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: abner

    Just did it.

    By Administrator on 2014-03-23T19:59:05 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: jvanbaarsen

    @abner Thanks! @randx Looks good to merge

    By Administrator on 2014-03-23T20:03:12 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    spec/requests/api/projects_spec.rb
    632 633 end
    633 634 end
    634 635 end
    636
    637 describe "GET /projects/:id/labels" do
    638 before { issue_with_labels }
    639
    640 it "should return project labels" do
    641 get api("/projects/#{project.id}/labels", user)
    642 response.status.should == 200
    643 json_response.should be_an Array
    644 json_response.first['name'].should == issue_with_labels.labels.first.name
    645 json_response.last['name'].should == issue_with_labels.labels.last.name
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: Razer6

      Where is the check for the labels or am I missing something?

      By Administrator on 2014-03-23T22:20:31 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    lib/api/projects.rb
    215 215 @users = paginate @users
    216 216 present @users, with: Entities::User
    217 217 end
    218
    219 # Get a project labels
    220 #
    221 # Parameters:
    222 # id (required) - The ID of a project
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: Razer6

      Wrong uri! It's labels

      By Administrator on 2014-03-23T22:20:31 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    spec/requests/api/projects_spec.rb
    632 633 end
    633 634 end
    634 635 end
    636
    637 describe "GET /projects/:id/labels" do
    638 before { issue_with_labels }
    639
    640 it "should return project labels" do
    641 get api("/projects/#{project.id}/labels", user)
    642 response.status.should == 200
    643 json_response.should be_an Array
    644 json_response.first['name'].should == issue_with_labels.labels.first.name
    645 json_response.last['name'].should == issue_with_labels.labels.last.name
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: jvanbaarsen

      json_response.first['name'].should == issue_with_labels.labels.first.name
      json_response.last['name'].should == issue_with_labels.labels.last.name

      By Administrator on 2014-03-23T22:20:31 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    lib/api/projects.rb
    215 215 @users = paginate @users
    216 216 present @users, with: Entities::User
    217 217 end
    218
    219 # Get a project labels
    220 #
    221 # Parameters:
    222 # id (required) - The ID of a project
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: jvanbaarsen

      Good catch! Totally missed that one!

      By Administrator on 2014-03-23T22:20:31 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    spec/requests/api/projects_spec.rb
    632 633 end
    633 634 end
    634 635 end
    636
    637 describe "GET /projects/:id/labels" do
    638 before { issue_with_labels }
    639
    640 it "should return project labels" do
    641 get api("/projects/#{project.id}/labels", user)
    642 response.status.should == 200
    643 json_response.should be_an Array
    644 json_response.first['name'].should == issue_with_labels.labels.first.name
    645 json_response.last['name'].should == issue_with_labels.labels.last.name
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: Razer6

      Uups Sorry for the noise

      By Administrator on 2014-03-23T22:20:31 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    lib/api/projects.rb
    215 215 @users = paginate @users
    216 216 present @users, with: Entities::User
    217 217 end
    218
    219 # Get a project labels
    220 #
    221 # Parameters:
    222 # id (required) - The ID of a project
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: Razer6

      Could you also document the parameter :id as for most other methods?

      By Administrator on 2014-03-23T22:20:31 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: Razer6

    @abner Thanks for your PR :) could you please add API documentation in doc/api/'

    By Administrator on 2014-03-23T20:40:26 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit 19938156 11 years ago
    lib/api/projects.rb
    215 215 @users = paginate @users
    216 216 present @users, with: Entities::User
    217 217 end
    218
    219 # Get a project labels
    220 #
    221 # Parameters:
    222 # id (required) - The ID of a project
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: abner

      Fixed

      By Administrator on 2014-03-23T22:23:29 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: abner

    Documentation added. I also fixed the "Wrong uri! " you pointed and documented the parameter :id

    By Administrator on 2014-03-23T22:23:45 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: Razer6

    @abner Thank you :thumbsup: @randx Looks good!

    By Administrator on 2014-03-24T08:24:48 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: Razer6

    Corresponding Feature request: https://gitlab.uservoice.com/admin/forums/176466-general/suggestions/5495352-api-to-get-issues-lables-list

    By Administrator on 2014-03-24T08:28:26 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: dzaporozhets

    @abner thanks

    By Administrator on 2014-03-25T17:39:29 (imported from GitLab project)

  • Administrator
    Administrator @root · 11 years ago
    Owner

    Created by: abner

    You're welcome. Thank you guys. Gitlab is amazing!

    By Administrator on 2014-03-25T20:04:24 (imported from GitLab project)

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Milestone
No milestone
None
None
Time tracking
No estimate or time spent
2
Labels
API Ready for Merge
Assign labels
  • No matching results
  • Manage project labels
Lock merge request
Unlocked
1
1 participant
user avatar
Reference: gpt/large_projects/gitlabhq1!6586
Source branch: github/fork/abner/master

    0 pending comments

Menu

Projects Groups Snippets
Help