Skip to content

Conversation

@Not-Dhananjay-Mishra
Copy link
Contributor

Issue : #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
Contributor Author

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

Copy link
Contributor

@stevehipwell stevehipwell left a comment

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.

@Not-Dhananjay-Mishra
Copy link
Contributor Author

@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
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.32%. Comparing base (943b801) to head (8a52a7e).
⚠️ Report is 1 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.

Copy link
Collaborator

@gmlewis gmlewis left a comment

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.

Copy link
Contributor

@stevehipwell stevehipwell left a comment

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.

Copy link
Collaborator

@gmlewis gmlewis left a comment

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
Collaborator

gmlewis commented Nov 6, 2025

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

Copy link
Contributor

@stevehipwell stevehipwell left a comment

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.

// 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
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
Contributor Author

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?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants