Skip to content
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

GitHub Org name needs to be set otherwise PATCH will show HTTP 422 Validation Failed [] #271

Closed
hugh-at-tesla opened this issue Nov 25, 2022 · 3 comments
Labels
awaiting-upstream Awaiting upstream dependency impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@hugh-at-tesla
Copy link

hugh-at-tesla commented Nov 25, 2022

What happened?

In https://www.pulumi.com/registry/packages/github/api-docs/organizationsettings/ , I didn't see anywhere mentions that org name needs to be set. If not set, pulumi-github will generate a random name that GitHub/GitHub Enterprise will reject with HTTP 422 when doing pulumi up.

Steps to reproduce

Create a GitHub org with Organization display name unset, do a pulumi import and afterwards run pulumi up, it will show some error like below

Do you want to perform this update? yes
Updating (pulumi-github-test):
     Type                                  Name                                   Status                  Info
     pulumi:pulumi:Stack                   pulumi-github-test-pulumi-github-test  **failed**              1 error
 ~   └─ github:index:OrganizationSettings  hughtest                               **updating failed**     [diff: ~name]; 1 error


Diagnostics:
  github:index:OrganizationSettings (hughtest):
    error: 1 error occurred:
        * updating urn:pulumi:pulumi-github-test::pulumi-github-test::github:index/organizationSettings:OrganizationSettings::hughtest: PATCH https://github.xxxxx.xx/api/v3/orgs/hughtest: 422 Validation Failed []

  pulumi:pulumi:Stack (pulumi-github-test-pulumi-github-test):
    error: update failed

Expected Behavior

It should import successfully.
Or this should be mentioned in the documentation as a prerequisite. Instead of leaving it to the users to figure it out.
Or HTTP 422 Validation Failed [] should output a meaningful error message.

Actual Behavior

It keeps showing HTTP 422 Validation Failed []

Output of pulumi about

% pulumi about
CLI          
Version      3.48.0
Go Version   go1.19.2
Go Compiler  gc

Plugins
NAME    VERSION
github  5.1.0
python  unknown

Host     
OS       darwin
Version  12.6
Arch     x86_64

This project is written in python: executable='/Users/xxxxxxxxx/coding_local/pulumi-github-test/venv/bin/python3' version='3.10.8
'

Current Stack: pulumi-github-test

TYPE                                                    URN
pulumi:pulumi:Stack                                     urn:pulumi:pulumi-github-test::pulumi-github-test::pulumi:pulumi:Stack::pulumi-github-test-pulumi-github-test
pulumi:providers:github                                 urn:pulumi:pulumi-github-test::pulumi-github-test::pulumi:providers:github::default_5_1_0
github:index/organizationSettings:OrganizationSettings  urn:pulumi:pulumi-github-test::pulumi-github-test::github:index/organizationSettings:OrganizationSettings::hughtest
github:index/repository:Repository                      urn:pulumi:pulumi-github-test::pulumi-github-test::github:index/repository:Repository::demo-repo


Found no pending operations associated with pulumi-github-test

Backend        
Name           xxxxxxxxxxxxxx
URL            file://~
User           xxxxxxxxxx
Organizations  

Dependencies:
NAME           VERSION
pip            22.3.1
pulumi-github  5.1.0
setuptools     65.6.1
wheel          0.38.4

Pulumi locates its logs in /var/folders/m8/qrb3ff0j6l32v_8b7qb6jsdm0000gq/T/ by default

Additional context

No response

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).

@hugh-at-tesla hugh-at-tesla added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 25, 2022
@lblackstone lblackstone added impact/usability Something that impacts users' ability to use the product easily and intuitively and removed needs-triage Needs attention from the triage team labels Nov 29, 2022
@lblackstone
Copy link
Member

Thanks for the report -- I see several related upstream issues, including integrations/terraform-provider-github#1215, so it seems like an issue with the underlying terraform provider.

@lblackstone lblackstone added the awaiting-upstream Awaiting upstream dependency label Nov 29, 2022
@JonNode28
Copy link

I think the fix for this might have been merged into the terraform provider now: integrations/terraform-provider-github#1489

@AaronFriel AaronFriel added the resolution/fixed This issue was fixed label Apr 1, 2023
@AaronFriel
Copy link
Member

Thanks for flagging that, we've incorporated the fix. Please create a new issue if you identify this issue again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-upstream Awaiting upstream dependency impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

4 participants