Skip to content

[public-api] Implement experimental ListTeams #14301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Oct 31, 2022

Description

Implements experimental TeamsService.ListTeams

Related Issue(s)

How to test

Unit tests.

  1. Open up preview, log-in
  2. Obtain a token by running the below in the browser console
    await window._gp.gitpodService.server.generateNewGitpodToken({ type: 1, scopes: ["function:getGitpodTokenScopes",
    	"function:createTeam",
    	"function:getTeamMembers",
    	"function:getGenericInvite",
    	"function:getTeams",
    	"resource:default",]})
  3. Set your credentials on the command line:
    BEARER_TOKEN="<token>"
  4. Create a couple of teams, adjusting the <team_name_X> variable
	curl \
    --header 'Content-Type: application/json' \
    --header "Authorization: Bearer $BEARER_TOKEN" \
    --data '{ "name": "<team_name_1>" }' \
    https://api.mp-papi-list-teams.preview.gitpod-dev.com/gitpod.experimental.v1.TeamsService/CreateTeam

	curl \
    --header 'Content-Type: application/json' \
    --header "Authorization: Bearer $BEARER_TOKEN" \
    --data '{ "name": "<team_name_2>" }' \
    https://api.mp-papi-list-teams.preview.gitpod-dev.com/gitpod.experimental.v1.TeamsService/CreateTeam
  1. Hit the list endpoint, adjusting the <team_name> variable
	curl \
    --header 'Content-Type: application/json' \
    --header "Authorization: Bearer $BEARER_TOKEN" \
    --data '{ }' \
    https://api.mp-papi-list-teams.preview.gitpod-dev.com/gitpod.experimental.v1.TeamsService/ListTeams
{
  "teams": [
    {
      "id": "47fd227c-19b0-49e2-8ee6-7e00ddb6526a",
      "name": "milans2",
      "slug": "milans2",
      "members": [
        {
          "userId": "c269e49a-4c20-4d65-b762-6acac9df7aa5",
          "role": "TEAM_ROLE_OWNER"
        }
      ],
      "teamInvitation": {
        "id": "redacted"
      }
    },
    {
      "id": "97532eb7-54d3-452c-98f9-321024382fba",
      "name": "milans1",
      "slug": "milans1",
      "members": [
        {
          "userId": "c269e49a-4c20-4d65-b762-6acac9df7aa5",
          "role": "TEAM_ROLE_OWNER"
        }
      ],
      "teamInvitation": {
        "id": "8743a6f7-b103-4c87-9d02-8ed531e8cfaa"
      }
    },
    {
      "id": "ae8e46e9-071f-4a19-877e-5a681794fa65",
      "name": "foobaz",
      "slug": "foobaz",
      "members": [
        {
          "userId": "c269e49a-4c20-4d65-b762-6acac9df7aa5",
          "role": "TEAM_ROLE_OWNER"
        }
      ],
      "teamInvitation": {
        "id": "redacted"
      }
    }
  ]
}

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-mp-papi-list-teams.1 because the annotations in the pull request description changed
(with .werft/ from main)

@roboquat roboquat added size/XXL and removed size/XL labels Oct 31, 2022
@roboquat roboquat added size/XL and removed size/XXL labels Nov 1, 2022
@easyCZ easyCZ force-pushed the mp/papi-list-teams branch 2 times, most recently from cbdaa2f to e1b7d59 Compare November 1, 2022 13:22
@roboquat roboquat added size/L and removed size/XL labels Nov 1, 2022
@easyCZ easyCZ marked this pull request as ready for review November 1, 2022 13:22
@easyCZ easyCZ requested a review from a team November 1, 2022 13:22
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Nov 1, 2022
@easyCZ easyCZ force-pushed the mp/papi-list-teams branch 3 times, most recently from d06bd35 to 341fb7a Compare November 1, 2022 15:14
@easyCZ easyCZ force-pushed the mp/papi-list-teams branch from 341fb7a to b5708a1 Compare November 1, 2022 16:56
Copy link
Contributor

@andrew-farries andrew-farries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roboquat roboquat merged commit e24616b into main Nov 2, 2022
@roboquat roboquat deleted the mp/papi-list-teams branch November 2, 2022 08:50
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants