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

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

Merged
merged 11 commits into from
Mar 12, 2025

Conversation

jndz2
Copy link
Contributor

@jndz2 jndz2 commented Mar 10, 2025

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

jndz2 commented Mar 10, 2025

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

Copy link

codecov bot commented Mar 10, 2025

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

jndz2 commented Mar 11, 2025

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

@gmlewis
Copy link
Collaborator

gmlewis commented Mar 11, 2025

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

jndz2 added 3 commits March 11, 2025 21:34

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…riable
…r create/update operation and corresponding test cases.
@gmlewis
Copy link
Collaborator

gmlewis commented Mar 11, 2025

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

jndz2 commented Mar 11, 2025

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

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Mar 11, 2025
@gmlewis gmlewis 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
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, @jndz2!
Just a couple tweaks, please.

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, @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!

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.

Just one comment.

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.

LGTM

@gmlewis gmlewis changed the title feat: Add support for network-configurations endpoints for organization feat!: Add support for network-configurations endpoints for organization Mar 12, 2025
@gmlewis
Copy link
Collaborator

gmlewis commented Mar 12, 2025

Thank you @jndz2 and @stevehipwell!
Merging.

@gmlewis gmlewis merged commit 8a3634e into google:master Mar 12, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). NeedsReview PR 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