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 #3497

Merged
merged 5 commits into from
Mar 3, 2025

Conversation

jndz2
Copy link
Contributor

@jndz2 jndz2 commented Mar 1, 2025

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.
@gmlewis gmlewis changed the title feat(network-configurations): Add support for network-configurations endpoints feat: Add support for network-configurations endpoints Mar 1, 2025
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Mar 1, 2025
Copy link

codecov bot commented Mar 1, 2025

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.

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

@jndz2
Copy link
Contributor Author

jndz2 commented Mar 2, 2025

All code suggestions fixed.

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.

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.

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

jndz2 commented Mar 2, 2025

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
Collaborator

gmlewis commented Mar 2, 2025

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

jndz2 commented Mar 3, 2025

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
Collaborator

gmlewis commented Mar 3, 2025

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

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.

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

gmlewis commented Mar 3, 2025

Thank you, @stevehipwell!
Merging.

@gmlewis gmlewis merged commit 470d43a into google:master Mar 3, 2025
7 checks passed
@jndz2 jndz2 deleted the issue/3462 branch March 5, 2025 13:40
Sign up for free to 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