pulumi / pulumi-pulumiservice

https://pulumi.com
Apache License 2.0
13 stars 6 forks source link

GitHub Managed Team creation fails with '400 API error: Bad Request: No TeamID provided' #151

Closed vschettino-asimov closed 1 year ago

vschettino-asimov commented 1 year ago

What happened?

Creating a new GitHub Managed team fails with a 400 error:

    error: error creating team '***': failed to create team: 400 API error: Bad Request: No TeamID provided.

The API docs do not say anything about TeamID.

Expected Behavior

Be able to manage GitHub teams on Pulumi

Steps to reproduce

Minimal Reproducible Example:

import * as service from '@pulumi/pulumiservice';

let team = new service.Team(
    'my-team',
    {
    name:  'my-team', // identical to the GitHub Team Name
    organizationName: 'my-org',
    teamType: 'github',
    },
);

pulumi up will fail with:

Diagnostics:
  pulumi:pulumi:Stack (my-stack):
    error: update failed

  pulumiservice:index:Team (my-team):
    error: error creating team 'my-team': failed to create team: 400 API error: Bad Request: No TeamID provided.

Resources:
    2 unchanged

Duration: 4s

Output of pulumi about

pulumi about
CLI
Version      3.74.0
Go Version   go1.20.5
Go Compiler  gc

Plugins
NAME                     VERSION
datadog                  4.19.1
gcp                      6.59.0
kubernetes               3.30.1
kubernetes-cert-manager  0.0.1
nodejs                   unknown
pulumiservice            0.9.0

Host
OS       darwin
Version  13.4.1
Arch     arm64

This project is written in nodejs: executable='/Users/vschettino/.nvm/versions/node/v16.14.2/bin/node' version='v16.14.2'

Dependencies:
NAME                              VERSION
@pulumi/pulumi                    3.74.0
@pulumi/pulumiservice             0.9.0
@asimovbio/pulumi-gcp-components  1.9.8
typescript                        5.1.6
@types/node                       18.16.19

Pulumi locates its logs in /var/folders/0x/7l81mby95f9_b26gzzrqqfdw0000gn/T/ by default

Additional context

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

MitchellGerdisch commented 1 year ago

FWIW, I thought using the github ID for the name field instead of the name itself may work. So I used
gh api --method GET /orgs/GITHUBORGNAME/teams to get the ID.

But the same error occurred.

blampe commented 1 year ago

v0.10.0 was released with the ability to specify githubTeamId on the Team resource.