Skip to content

feat: Add support for Issue Types API #3525

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

Merged
merged 20 commits into from
Mar 20, 2025

Conversation

atilsensalduz
Copy link
Contributor

This pull request introduces support for the Issue Types API to the go-github library, enabling users to manage issue types within their organizations. The following functions have been added:

  • ListIssueTypes: Retrieves all issue types for a specified organization.
  • CreateIssueType: Allows the creation of a new issue type within an organization.
  • UpdateIssueType: Enables updating the attributes of an existing issue type.
  • DeleteIssueType: Facilitates the deletion of an issue type from an organization.

Each function is accompanied by comprehensive tests to ensure functionality and reliability.

API References: https://docs.github.com/en/rest/orgs/issue-types

Fixes: #3523

Please let me know if any additional changes or improvements are needed!

atilsensalduz and others added 17 commits February 20, 2025 23:10
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
Implement new methods for managing GitHub-hosted runners,
including functionalities for creating, updating, deleting, and
retrieving details about hosted runners.

References:
- GitHub REST API: https://docs.github.com/en/rest/actions/hosted-runners

Signed-off-by: atilsensalduz <[email protected]>
…add validation

Unified the CreateHostedRunnerRequest and UpdateHostedRunnerRequest into a single HostedRunnerRequest struct.
Added validation functions for HostedRunnerRequest.

Signed-off-by: atilsensalduz <[email protected]>
…add validation

Unified the CreateHostedRunnerRequest and UpdateHostedRunnerRequest into a single HostedRunnerRequest struct.
Added validation functions for HostedRunnerRequest.

Signed-off-by: atilsensalduz <[email protected]>
…add validation

Unified the CreateHostedRunnerRequest and UpdateHostedRunnerRequest into a single HostedRunnerRequest struct.
Added validation functions for HostedRunnerRequest.

Signed-off-by: atilsensalduz <[email protected]>
…text, allowing for better error inspection and unwrapping.

Signed-off-by: atilsensalduz <[email protected]>
…text, allowing for better error inspection and unwrapping.

Signed-off-by: atilsensalduz <[email protected]>
- Implement functions to interact with the Issue Types API:
  - ListIssueTypes: Retrieve all issue types for an organization.
  - CreateIssueType: Add a new issue type to an organization.
  - UpdateIssueType: Modify an existing issue type.
  - DeleteIssueType: Remove an issue type from an organization.

- Add corresponding tests for each function to ensure reliability.

References:
- GitHub REST API documentation: https://docs.github.com/en/rest/orgs/issue-types
- Related issue: #3523

Signed-off-by: atilsensalduz <[email protected]>
- Implement functions to interact with the Issue Types API:
  - ListIssueTypes: Retrieve all issue types for an organization.
  - CreateIssueType: Add a new issue type to an organization.
  - UpdateIssueType: Modify an existing issue type.
  - DeleteIssueType: Remove an issue type from an organization.

- Add corresponding tests for each function to ensure reliability.

References:
- GitHub REST API documentation: https://docs.github.com/en/rest/orgs/issue-types
- Related issue: #3523

Signed-off-by: atilsensalduz <[email protected]>
- Implement functions to interact with the Issue Types API:
  - ListIssueTypes: Retrieve all issue types for an organization.
  - CreateIssueType: Add a new issue type to an organization.
  - UpdateIssueType: Modify an existing issue type.
  - DeleteIssueType: Remove an issue type from an organization.

- Add corresponding tests for each function to ensure reliability.

References:
- GitHub REST API documentation: https://docs.github.com/en/rest/orgs/issue-types
- Related issue: #3523

Signed-off-by: atilsensalduz <[email protected]>
- Implement functions to interact with the Issue Types API:
  - ListIssueTypes: Retrieve all issue types for an organization.
  - CreateIssueType: Add a new issue type to an organization.
  - UpdateIssueType: Modify an existing issue type.
  - DeleteIssueType: Remove an issue type from an organization.

- Add corresponding tests for each function to ensure reliability.

References:
- GitHub REST API documentation: https://docs.github.com/en/rest/orgs/issue-types
- Related issue: #3523

Signed-off-by: atilsensalduz <[email protected]>
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.30%. Comparing base (a03e88c) to head (8a6fa7d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3525      +/-   ##
==========================================
+ Coverage   91.27%   91.30%   +0.02%     
==========================================
  Files         183      184       +1     
  Lines       16099    16143      +44     
==========================================
+ Hits        14695    14739      +44     
  Misses       1230     1230              
  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.

@gmlewis
Copy link
Collaborator

gmlewis commented Mar 20, 2025

It looks like the openapi stuff is a problem afterall.
I'm thinking I should make a separate PR to update openapi, then you can merge it from master and your PR can then be focused on just your changes. I'll do that today.

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.

This looks great, @atilsensalduz!
Just one minor tweak, please.

- Implement functions to interact with the Issue Types API:
  - ListIssueTypes: Retrieve all issue types for an organization.
  - CreateIssueType: Add a new issue type to an organization.
  - UpdateIssueType: Modify an existing issue type.
  - DeleteIssueType: Remove an issue type from an organization.

- Add corresponding tests for each function to ensure reliability.

References:
- GitHub REST API documentation: https://docs.github.com/en/rest/orgs/issue-types
- Related issue: #3523

Signed-off-by: atilsensalduz <[email protected]>
@atilsensalduz
Copy link
Contributor Author

atilsensalduz commented Mar 20, 2025

Tests are passed in my local. @gmlewis could you please rerun the test?

wdyt to add small delay in here?
https://github.com/google/go-github/blob/master/github/github_test.go#L67

	// Add a slight delay before closing the server to prevent race conditions
	t.Cleanup(func() {
		time.Sleep(100 * time.Millisecond) // Ensures all requests complete
		server.Close()
	})

before:
script/test.sh 8.05s user 10.24s system 145% cpu 12.584 total

after:
script/test.sh 10.47s user 12.00s system 83% cpu 26.990 total

@gmlewis
Copy link
Collaborator

gmlewis commented Mar 20, 2025

wdyt to add small delay in here?

What I would really like to understand is WHY we have any race conditions at all.
There should be a way to close down the server reliably without any use of sleep, and I would love to get to the bottom of it. Can you please file an issue, @atilsensalduz, and/or investigate if you feel like it?

- Implement functions to interact with the Issue Types API:
  - ListIssueTypes: Retrieve all issue types for an organization.
  - CreateIssueType: Add a new issue type to an organization.
  - UpdateIssueType: Modify an existing issue type.
  - DeleteIssueType: Remove an issue type from an organization.

- Add corresponding tests for each function to ensure reliability.

References:
- GitHub REST API documentation: https://docs.github.com/en/rest/orgs/issue-types
- Related issue: #3523

Signed-off-by: atilsensalduz <[email protected]>
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, @atilsensalduz and @Wisma-55!
LGTM.
Merging.

@gmlewis gmlewis merged commit df116e5 into google:master Mar 20, 2025
7 checks passed
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.

Add support for issue types
3 participants