Skip to content

feat: Add support for network-configurations endpoints - #3497

Merged
gmlewis merged 5 commits into
google:masterfrom
jndz2:issue/3462
Mar 3, 2025
Merged

feat: Add support for network-configurations endpoints#3497
gmlewis merged 5 commits into
google:masterfrom
jndz2:issue/3462

Conversation

@jndz2

@jndz2jndz2 commented Mar 1, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces support for the hosted compute network configurations 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 enterprise.
  • Get network settings resource.
  • Corresponding unit tests for each function.

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

…endpoints
Implement functionality to list, create, get, update, and delete enterprise network configurations, as well as get network settings resources.
References:
- GitHub REST API: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/network-configurations
…endpoints
Unified the create and update into a single EnterpriseNetworkConfigurationRequest struct, Refactored struct types, fixed urls and return response in the case of an error.
…endpoints
Implementation of tests for all network configuration functions.
…endpoints
Adding generated accessors for all network configuration structures.
@gmlewisgmlewis changed the title feat(network-configurations): Add support for network-configurations endpointsfeat: Add support for network-configurations endpointsMar 1, 2025
@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Mar 1, 2025
@codecov

codecovBot commented Mar 1, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.21%. Comparing base (868f897) to head (d9f8734).
Report is 7 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3497 +/- ##
==========================================
+ Coverage 91.02% 91.21% +0.18% 
==========================================
Files 179 182 +3 Lines 15561 15930 +369 ==========================================
+ Hits 14165 14531 +366 - Misses 1223 1225 +2 - Partials 173 174 +1 

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

@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!
This is looking great! Just a couple minor tweaks, please, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.

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

Comment threadgithub/enterprise_network_configurations.go Outdated
Comment threadgithub/enterprise_network_configurations.go Outdated
Comment threadgithub/enterprise_network_configurations.go Outdated
Comment threadgithub/enterprise_network_configurations.go Outdated
Comment threadgithub/enterprise_network_configurations.go Outdated
@jndz2

jndz2 commented Mar 2, 2025

Copy link
Copy Markdown
ContributorAuthor

All code suggestions fixed.

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

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

Whups, I did it again!
I've got to remember to wait for tests to pass first.

Please address step 4 of CONTRIBUTING.md before we proceed and push the changes.

@jndz2

jndz2 commented Mar 2, 2025

Copy link
Copy Markdown
ContributorAuthor

Interesting the generate script ignores my type change from *[]string to []string.

Do I also have to call the metadata script here, because of this warnings?

could not find operation "GET /enterprises/{enterprise}/network-configurations" in openapi_operations.yaml
could not find operation "POST /enterprises/{enterprise}/network-configurations" in openapi_operations.yaml
could not find operation "GET /enterprises/{enterprise}/network-configurations/{network_configuration_id}" in openapi_operations.yaml
could not find operation "PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id}" in openapi_operations.yaml
could not find operation "DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id}" in openapi_operations.yaml
could not find operation "GET /enterprises/{enterprise}/network-settings/{network_settings_id}" in openapi_operations.yaml

@gmlewis

Copy link
Copy Markdown
Collaborator

Hmmm... That's odd. Maybe we have a bug in our generators?
I don't know and would have to dig in, but I'm currently on my phone.
Please see if you can figure out what the problem is, and if you are still stuck, I can look later today.

@jndz2

jndz2 commented Mar 3, 2025

Copy link
Copy Markdown
ContributorAuthor

Okay, it seems like I'm stuck. When I run the tests, I don't get any errors, I have run all the scripts and only get the information “could not find operation”.

@gmlewis

Copy link
Copy Markdown
Collaborator

Sorry about that. It looks like we may have introduced a flaky test recently. Rerunning the jobs appears to have fixed it.

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

@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 removed the NeedsReview PR is awaiting a review before merging. label Mar 3, 2025
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @stevehipwell!
Merging.

@gmlewis
gmlewis merged commit 470d43a into google:masterMar 3, 2025
@jndz2
jndz2 deleted the issue/3462 branch March 5, 2025 13:40
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.

3 participants

@jndz2@gmlewis@stevehipwell