Skip to content

feat!: Add support for network-configurations endpoints for organization - #3511

Merged
gmlewis merged 11 commits into
google:masterfrom
jndz2:master
Mar 12, 2025
Merged

feat!: Add support for network-configurations endpoints for organization#3511
gmlewis merged 11 commits into
google:masterfrom
jndz2:master

Conversation

@jndz2

@jndz2jndz2 commented Mar 10, 2025

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: EnterpriseNetwork* structs have been replaced with Network* structs.

Fixes: #3462.

This pull request introduces support for the hosted compute network configurations for organization in the go-github library, addressing #3462.

Changes Include:

Implementation of API endpoints for managing network-configuration endpoints.
Support for the following operations:

  • Get, Create, Update, Delete and List network-configuration of an organization.
  • Get network settings resource.
  • Corresponding unit tests for each function.

Additional Information:
API Reference: GitHub REST API: Network Configurations.

…endpoints for organization
Implement functionality to list, create, get, update, and delete organization network configurations, as well get network settings resources.
References:
- GitHub REST API: https://docs.github.com/en/rest/orgs/network-configurations
@jndz2

Copy link
Copy Markdown
ContributorAuthor

I have discovered that the request only allows “actions” or “none” for the compute service, but the get operations can return “codespaces”. I think I will tackle this tomorrow.

https://docs.github.com/en/rest/orgs/network-configurations?apiVersion=2022-11-28#create-a-hosted-compute-network-configuration-for-an-organization & https://docs.github.com/en/rest/orgs/network-configurations?apiVersion=2022-11-28#update-a-hosted-compute-network-configuration-for-an-organization

@codecov

codecovBot commented Mar 10, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (56f5036) to head (0db1555).
Report is 5 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3511 +/- ##
==========================================
+ Coverage 91.21% 91.28% +0.06% 
==========================================
Files 182 183 +1 Lines 15930 16053 +123 ==========================================
+ Hits 14531 14654 +123 
Misses 1225 1225 Partials 174 174 

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

@jndz2

Copy link
Copy Markdown
ContributorAuthor

@gmlewis the structs for the enterprise and organization are not different, should I use only one type?

@gmlewis

Copy link
Copy Markdown
Collaborator

@gmlewis the structs for the enterprise and organization are not different, should I use only one type?

Yes, please. No need to make a separate struct. Please add a comment that the endpoints support both.

@gmlewis

Copy link
Copy Markdown
Collaborator

@jndz2 - am I correct in saying that this PR will completely resolve #3462?
In other words, the 2nd group of methods is identical to the third as @stevehipwell pointed out might be the case?

@jndz2

Copy link
Copy Markdown
ContributorAuthor

@jndz2 - am I correct in saying that this PR will completely resolve #3462? In other words, the 2nd group of methods is identical to the third as @stevehipwell pointed out might be the case?

@gmlewis second and third are identical and this PR will resolve the issue.

@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Mar 11, 2025
@gmlewisgmlewis added the Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). label Mar 11, 2025

@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, @jndz2!
Just a couple tweaks, please.

Comment threadgithub/orgs_network_configurations.go Outdated
Comment threadgithub/orgs_network_configurations.go

@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, @jndz2!
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@stevehipwell - might you have time for a code review? Thank you!

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

Just one comment.

Comment threadgithub/orgs_network_configurations.go Outdated

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

LGTM

@gmlewisgmlewis changed the title feat: Add support for network-configurations endpoints for organizationfeat!: Add support for network-configurations endpoints for organizationMar 12, 2025
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you @jndz2 and @stevehipwell!
Merging.

@gmlewis
gmlewis merged commit 8a3634e into google:masterMar 12, 2025
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
…ion (google#3511)
BREAKING CHANGE: `EnterpriseNetwork*` structs have been replaced with `Network*` structs.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API ChangePR will require a bump to the major version num in next release. Look here to see the change(s).NeedsReviewPR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for network-configurations endpoints

3 participants

@jndz2@gmlewis@stevehipwell