Skip to content

Add support for new custom properties for orgs APIs - #3804

Merged
gmlewis merged 12 commits into
google:masterfrom
Not-Dhananjay-Mishra:issue-3799
Nov 10, 2025
Merged

Add support for new custom properties for orgs APIs#3804
gmlewis merged 12 commits into
google:masterfrom
Not-Dhananjay-Mishra:issue-3799

Conversation

@Not-Dhananjay-Mishra

@Not-Dhananjay-MishraNot-Dhananjay-Mishra commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Fixes: #3799.

This PR adds support for

  • Enterprise REST API to configure custom properties
  • Organization REST API to set custom properties
  • Add organization_property support to enterprise rules

@Not-Dhananjay-Mishra

Copy link
Copy Markdown
ContributorAuthor

@stevehipwell did i implement organization_property support to enterprise rules correctly?

@stevehipwellstevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR @Not-Dhananjay-Mishra, it's looking good. I've added some comments for you to follow up on.

@gmlewis I'd like to take a look at #3692 as well as the consistency of the custom property implementation before we release this code. If we're going to have a breaking change it'd make sense to make any other related changes at the same time.

Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties_test.go
Comment threadgithub/organizations_custom_properties_test.go Outdated
Comment threadgithub/rules.go Outdated
@Not-Dhananjay-Mishra

Copy link
Copy Markdown
ContributorAuthor

@stevehipwell Thanks for the suggestions.
I have done following changes -

  • Re-use struct that already present
  • CustomProperty now have one more field named URL
  • Change struct name as suggested
  • Swap the test file, really apologize for that mistake.
  • change filename from organizations_..go to orgs_..go

@codecov

codecovBot commented Nov 5, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.32%. Comparing base (943b801) to head (8a52a7e).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3804 +/- ##
==========================================
+ Coverage 92.27% 92.32% +0.04% 
==========================================
Files 192 194 +2 Lines 13896 13984 +88 ==========================================
+ Hits 12823 12911 +88 
Misses 884 884 Partials 189 189 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewisgmlewis 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.

Thank you, @Not-Dhananjay-Mishra and @stevehipwell!
LGTM.

@stevehipwell - we have a few options here:
Option A: Merge this and work on #3692 before cutting the next release
Option B: Work on #3692 before merging this

Now that I write these out, I'm betting you meant Option A, but please correct me if I'm wrong.

Either way, I will wait for your LGTM and reply before proceeding.

@stevehipwellstevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the naming here is hard, and a per my last comment I think the existing repository custom properties need some changes. But let's get the changes in this PR correct and then we only need to update the existing code.

In addition to my inline comment think the new files need to follow the pattern [enterprise|orgs]_organization_properties.go.

Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/orgs_custom_properties.go Outdated

@gmlewisgmlewis 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.

Thank you, @Not-Dhananjay-Mishra and @alexandear!
LGTM.
Merging.

@gmlewis

Copy link
Copy Markdown
Collaborator

Oh, sorry - @stevehipwell - I see you had comments - do you approve this PR now?

@stevehipwellstevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new files haven't been renamed as requested in my previous review and the naming still isn't consistent.

Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/enterprise_custom_properties.go Outdated
Comment threadgithub/orgs_custom_properties.go Outdated
// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties-for-orgs#create-or-update-custom-property-values-for-an-organization
//
//meta:operation PATCH /organizations/{org}/org-properties/values
func (s *OrganizationsService) CreateOrUpdateOrgCustomPropertyValues(ctx context.Context, org string, values OrganizationCustomPropertyValues) (*Response, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The name of this function doesn't match the function above organization/org.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for suggestion, I have changed it to CreateOrUpdateOrganizationCustomPropertyValues. Do I need to change it to something else?

@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @alexandear!
Awaiting approval from @stevehipwell.

@stevehipwellstevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR @Not-Dhananjay-Mishra and for your prompt PR responses.

LGTM

@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @stevehipwell!
Merging.

@gmlewis
gmlewis merged commit 9c16433 into google:masterNov 10, 2025
7 checks passed
elminster-aom pushed a commit to elminster-aom/go-github that referenced this pull request Nov 11, 2025
@Not-Dhananjay-Mishra
Not-Dhananjay-Mishra deleted the issue-3799 branch February 5, 2026 15:30
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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.

Add support for new custom properties for orgs APIs

4 participants

@Not-Dhananjay-Mishra@gmlewis@alexandear@stevehipwell