Skip to content

Add support for setting enterprise properties - #3292

Open
jackmtpt wants to merge 9 commits into
integrations:mainfrom
jackmtpt:enterprise-props
Open

jackmtpt wants to merge 9 commits into
integrations:mainfrom
jackmtpt:enterprise-props

Conversation

@jackmtpt

@jackmtpt jackmtpt commented Mar 19, 2026 •

Copy link
Copy Markdown

Resolves #3230

I've basically copied the existing org resource/data source and adjusted it for the enterprise API calls. The tests pass for me and I can see the properties appear briefly in my enterprise while the tests are running.


Before the change?

  • Enterprise custom properties are not supported.

After the change?

  • They now are.

Pull request checklist

  • [] Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@jackmtpt
jackmtpt marked this pull request as ready for review March 19, 2026 16:48
@jackmtpt

Copy link
Copy Markdown
Author

I'm quite new to this so I'm not really sure how I can get a build and hook up my actual terraform code to use it - do the CI builds of providers in this repo get published to the registry so they can be used for testing?

@deiga deiga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Partial review

return diag.Errorf("error querying GitHub custom properties %s: %v", entSlug, err)
}

// TODO: Add support for other types of default values

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please don't submit PRs with missing implementation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this was copied from resource_github_organization_custom_properties - what should be done instead?

}

d.SetId(*customProperty.PropertyName)
return resourceGithubEnterpriseCustomPropertiesRead(d, meta)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Never call any of the CRUD functions

Comment on lines +133 to +139
_ = d.Set("allowed_values", customProperty.AllowedValues)
_ = d.Set("default_value", defaultValue)
_ = d.Set("description", customProperty.Description)
_ = d.Set("property_name", customProperty.PropertyName)
_ = d.Set("required", customProperty.Required)
_ = d.Set("value_type", string(customProperty.ValueType))
_ = d.Set("values_editable_by", customProperty.ValuesEditableBy)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't swallow errors


_, err := client.Enterprise.RemoveCustomProperty(context.Background(), entSlug, d.Get("property_name").(string))
if err != nil {
return err

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add 404 handling

Co-authored-by: Copilot <[email protected]>
@jackmtpt

Copy link
Copy Markdown
Author

@deiga I am leaving my company in a week so I won't be able to work on this anymore. If someone else wants to take it over feel free.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Add support for defining custom properties for an enterprise

3 participants