Skip to content
Snippets Groups Projects

Add feature: team_users API

Merged gitlab-qa-bot requested to merge github/fork/former03/feature_teams_api into master

Created by: simonswine

Fixes: #3066 (closed)

Features:

  • Create/Read/Delete user_teams
  • Create/Read/Delete user_teams::members
  • Create/Read/Delete user_teams::projects
  • Testing for that
  • Documentation

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 module API
2 # user_teams API
3 class UserTeams < Grape::API
4 before { authenticate! }
5
6 resource :user_teams do
7 helpers do
8 def handle_team_member_errors(errors)
9 if errors[:permission].any?
10 render_api_error!(errors[:permission], 422)
  • Created by: m4tthumphrey

    :thumbsup:

    By Administrator on 2013-04-18T09:29:04 (imported from GitLab project)

    By Administrator on 2013-04-18T09:29:04 (imported from GitLab)

  • Created by: karlhungus

    :thumbsup:

    By Administrator on 2013-04-18T16:08:25 (imported from GitLab project)

    By Administrator on 2013-04-18T16:08:25 (imported from GitLab)

  • Created by: karlhungus

    Any reason you didn't squash it into one commit?

    By Administrator on 2013-04-18T17:09:06 (imported from GitLab project)

    By Administrator on 2013-04-18T17:09:06 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage increased (+12.31%) when pulling 672dbec2f39023a682b6b59cee1952df509d2685 on former03:feature_teams_api into 68a31780 on gitlabhq:master.

    By Administrator on 2013-04-18T17:35:31 (imported from GitLab project)

    By Administrator on 2013-04-18T17:35:31 (imported from GitLab)

  • Created by: amacarthur

    :thumbsup:

    By Administrator on 2013-04-21T04:30:26 (imported from GitLab project)

    By Administrator on 2013-04-21T04:30:26 (imported from GitLab)

  • Created by: simonswine

    @karlhungus: The only reason was, i never heard about git rebasing before ;-)

    By Administrator on 2013-04-24T18:34:37 (imported from GitLab project)

    By Administrator on 2013-04-24T18:34:37 (imported from GitLab)

  • Created by: karlhungus

    @simonswine I think if you squish it it'll be more likely to get pulled -- it's part of the contribution guides.. I actually pulled down the changes from former03, but couldn't get them to run with tests on a 5.0 stable version otherwise i would have pushed my squahs up to your former03... i can still do that if you like

    By Administrator on 2013-04-24T18:38:07 (imported from GitLab project)

    By Administrator on 2013-04-24T18:38:07 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage decreased (-0.02%) when pulling a88c3bedf11b5bf5e69a6a158c0d0519a185957d on former03:feature_teams_api into 75fbdc40 on gitlabhq:master.

    By Administrator on 2013-04-24T19:01:04 (imported from GitLab project)

    By Administrator on 2013-04-24T19:01:04 (imported from GitLab)

  • Created by: samcday

    @simonswine

    Note that the API is currently lacking GETs for /user_teams/:id/projects/:project_id and /user_teams/:id/members/:user_id

    By Administrator on 2013-05-09T05:51:34 (imported from GitLab project)

    By Administrator on 2013-05-09T05:51:34 (imported from GitLab)

  • Created by: m4tthumphrey

    What's the status with this then? Desperately want this now!

    @simonswine

    By Administrator on 2013-05-16T15:30:55 (imported from GitLab project)

    By Administrator on 2013-05-16T15:30:55 (imported from GitLab)

  • Created by: amacarthur

    Me too! Could @randx or one of the @gitlabhq team comment on when or if this can be merged?

    @m4tthumphrey @simonswine

    By Administrator on 2013-05-16T15:38:16 (imported from GitLab project)

    By Administrator on 2013-05-16T15:38:16 (imported from GitLab)

  • Created by: m4tthumphrey

    @amacarthur It seems theres a few requests missing, @simonswine do you plan on carrying on with this or should someone else take over?

    By Administrator on 2013-05-16T15:46:37 (imported from GitLab project)

    By Administrator on 2013-05-16T15:46:37 (imported from GitLab)

  • Created by: NARKOZ

    This needs rebasing.

    By Administrator on 2013-05-20T11:18:17 (imported from GitLab project)

    By Administrator on 2013-05-20T11:18:17 (imported from GitLab)

  • Created by: m4tthumphrey

    @narkoz It needs finishing too...

    By Administrator on 2013-05-21T11:01:09 (imported from GitLab project)

    By Administrator on 2013-05-21T11:01:09 (imported from GitLab)

  • Created by: simonswine

    I'll do both later this week

    @m4tthumphrey @narkoz @amacarthur

    By Administrator on 2013-05-21T11:03:35 (imported from GitLab project)

    By Administrator on 2013-05-21T11:03:35 (imported from GitLab)

  • Created by: m4tthumphrey

    :thumbsup:

    By Administrator on 2013-05-21T11:11:24 (imported from GitLab project)

    By Administrator on 2013-05-21T11:11:24 (imported from GitLab)

  • gitlab-qa-bot
  • 19 {
    20 id: 2,
    21 name: "User team 2",
    22 path: "user_team2",
    23 owner_id: 1
    24 }
    25 ]
    26 ```
    27
    28
    29 ### Get single user team
    30
    31 Get a specific user team, identified by user team ID, which is viewable by the authenticated user.
    32
    33 ```
    34 GET /user_teams/:id
    • Created by: NARKOZ

      Why not namespace it simply under /teams?

      By Administrator on 2013-05-21T21:15:46 (imported from GitLab project)

      By Administrator on 2013-05-21T21:15:46 (imported from GitLab)

  • gitlab-qa-bot
  • 19 {
    20 id: 2,
    21 name: "User team 2",
    22 path: "user_team2",
    23 owner_id: 1
    24 }
    25 ]
    26 ```
    27
    28
    29 ### Get single user team
    30
    31 Get a specific user team, identified by user team ID, which is viewable by the authenticated user.
    32
    33 ```
    34 GET /user_teams/:id
    • Created by: m4tthumphrey

      I would prefer teams too but I would assume @simonswine has used /user_teams because that is what the entity is called.

      By Administrator on 2013-05-21T21:15:46 (imported from GitLab project)

      By Administrator on 2013-05-21T21:15:46 (imported from GitLab)

  • gitlab-qa-bot
  • 19 {
    20 id: 2,
    21 name: "User team 2",
    22 path: "user_team2",
    23 owner_id: 1
    24 }
    25 ]
    26 ```
    27
    28
    29 ### Get single user team
    30
    31 Get a specific user team, identified by user team ID, which is viewable by the authenticated user.
    32
    33 ```
    34 GET /user_teams/:id
    • Created by: simonswine

      I thought it would be best to use the same name as the model. Cause there's a model two "team" models: user_team and project_team

      By Administrator on 2013-05-21T21:15:46 (imported from GitLab project)

      By Administrator on 2013-05-21T21:15:46 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage decreased (-0%) when pulling 526f0d305d2c4f2040b79fd8241d299e01206575 on former03:feature_teams_api into 6654db2c on gitlabhq:master.

    By Administrator on 2013-05-21T20:36:32 (imported from GitLab project)

    By Administrator on 2013-05-21T20:36:32 (imported from GitLab)

  • Created by: simonswine

    I've just rebased the PR and added the missing requests for:

    • GET /user_teams/:id/projects/:project_id
    • GET /user_teams/:id/members/:user_id

    @m4tthumphrey @narkoz @amacarthur @samcday

    By Administrator on 2013-05-21T21:17:36 (imported from GitLab project)

    By Administrator on 2013-05-21T21:17:36 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage increased (+0%) when pulling 0ebfa5e5 on former03:feature_teams_api into 6654db2c on gitlabhq:master.

    By Administrator on 2013-05-21T21:50:02 (imported from GitLab project)

    By Administrator on 2013-05-21T21:50:02 (imported from GitLab)

  • Created by: m4tthumphrey

    Wahoo! Top work @simonswine :)

    By Administrator on 2013-05-22T08:45:19 (imported from GitLab project)

    By Administrator on 2013-05-22T08:45:19 (imported from GitLab)

  • gitlab-qa-bot
  • 19 {
    20 id: 2,
    21 name: "User team 2",
    22 path: "user_team2",
    23 owner_id: 1
    24 }
    25 ]
    26 ```
    27
    28
    29 ### Get single user team
    30
    31 Get a specific user team, identified by user team ID, which is viewable by the authenticated user.
    32
    33 ```
    34 GET /user_teams/:id
    • Created by: NARKOZ

      I see, ideally would be nice to use teams for user teams and projects/:id/teams for project teams.

      By Administrator on 2013-05-23T07:08:55 (imported from GitLab project)

      By Administrator on 2013-05-23T07:08:55 (imported from GitLab)

  • Created by: dzaporozhets

    thank you

    By Administrator on 2013-05-27T12:05:30 (imported from GitLab project)

    By Administrator on 2013-05-27T12:05:30 (imported from GitLab)

  • Please register or sign in to reply
    Loading