Uh oh!
There was an error while loading. Please reload this page.
feat!: Support querying organization custom roles - #3129
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## master #3129 +/- ##
==========================================
- Coverage 97.72% 92.90% -4.82%
==========================================
Files 153 170 +17 Lines 13390 11463 -1927 ==========================================
- Hits 13085 10650 -2435 - Misses 215 723 +508
Partials 90 90 ☔ View full report in Codecov by Sentry. |
Added support for querying, creating, updating and deleting organization custom roles.
1e8c944 to
83cac3cCompare
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @tomfeigin !
Just one addition, please, then I think we will be ready for a second LGTM+Approval before merging.
Uh oh!
There was an error while loading. Please reload this page.
gmlewis
commented
Apr 16, 2024
(Also, there is no need to force push in this repo - we always squash&merge - see CONTRIBUTING.md for details.) |
| // GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role | ||
| // | ||
| //meta:operation PATCH /orgs/{org}/organization-roles/{role_id} | ||
| func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { |
There was a problem hiding this comment.
According to: https://docs.github.com/en/rest/orgs/organization-roles?apiVersion=2022-11-28#update-a-custom-organization-roleroleID should be an integer.
| func (s*OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org, roleIDstring, opts*CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { | |
| func (s*OrganizationsService) UpdateCustomOrgRole(ctx context.Context, orgstring, roleIDint64, opts*CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { |
| // GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role | ||
| // | ||
| //meta:operation DELETE /orgs/{org}/organization-roles/{role_id} | ||
| func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org, roleID string) (*Response, error) { |
There was a problem hiding this comment.
Same here: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role
| func (s*OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org, roleIDstring) (*Response, error) { | |
| func (s*OrganizationsService) DeleteCustomOrgRole(ctx context.Context, orgstring, roleIDint64) (*Response, error) { |
There was a problem hiding this comment.
I'll change it but it is aligned with DeleteCustomRepoRole
There was a problem hiding this comment.
Ah, bummer. Looks like I didn't catch it before on the other one. 😞
Well, since this is already a breaking API change, do you want to go ahead and make it consistent and fix the older one(s) too?
There was a problem hiding this comment.
I prefer to do that in another PR because here I am just introducing new stuff so it won't break existing usage
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @tomfeigin !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
tomfeigin
commented
Apr 16, 2024
@gmlewis this specific PR is not a breaking a change as it only introduces new API wrappers (I am pretty sure 🙃 ) can you remove the label please? |
| // | ||
| //meta:operation POST /orgs/{org}/custom-repository-roles | ||
| func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { | ||
| func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { |
There was a problem hiding this comment.
@tomfeigin - if I'm not mistaken, this line and line 203 below are both breaking API changes, as code written by a user of this repo that calls one or both of these endpoints will no longer compile correctly without changing their code. Agreed?
There was a problem hiding this comment.
Oh you are right, should I keep the previous naming then?
There was a problem hiding this comment.
Let's just have the breaking change, I'll fix the other APIs to use the int64 ID
There was a problem hiding this comment.
Well, honestly I don't have a problem making breaking API changes, which I suppose might be obvious from the current version number of this repo. 😂
Also, I think it is always a good idea to make things clearer and easier-to-understand for users of this repo... so I think your name change here was perfectly appropriate and that's also why I recommended fixing the bad field type while we are making a breaking API change.
So I'll leave it up to you, but I think the breaking API change is appropriate and am willing to move forward with it.
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @tomfeigin !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
gmlewis
commented
May 15, 2024
Thank you, @gsaraf ! |
BREAKING CHANGE: `CreateOrUpdateCustomRoleOptions` has been renamed to `CreateOrUpdateCustomRepoRoleOptions` and `roleID` has been changed from type `string` to `int64`.
Added support for querying, creating, updating and deleting organization custom roles.
BREAKING CHANGE:
CreateOrUpdateCustomRoleOptionshas been renamed toCreateOrUpdateCustomRepoRoleOptionsandroleIDhas been changed from typestringtoint64.