-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: Organization/Repository custom properties #2968
base: main
Are you sure you want to change the base?
Conversation
5cf58d4
to
2f33a50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind implementing organization custom properties?
https://docs.github.com/en/rest/orgs/custom-properties
If not don't doubt to tag me in, I'd love this feature as my org recently moved to Github and find this valuable.
Thank you for your work!
github/Repository.py
Outdated
""" | ||
url = f"{self.url}/properties/values" | ||
_, data = self._requester.requestJsonAndCheck("GET", url) | ||
return {p["property_name"]: p["value"] for p in data} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would return the data directly as expected by the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the repo /
and /properties/values
return different schemas - I would prefer sticking to dict[str, *]
to make it easier to work with. Let me know if you think otherwise :)
Closes #2895 |
Done - didn't realize it's already returned in the root GET. You're welcome! |
54a16aa
to
3bbae39
Compare
There might have been a misunderstanding here, I meant implementing |
My bad, I was looking at the issue you linked earlier. I've written a new Considering using the same class for the repo method returns too. |
fd2c138
to
fc93c6a
Compare
@@ -1326,6 +1328,35 @@ def get_dependabot_alerts( | |||
url_parameters, | |||
) | |||
|
|||
def get_all_custom_properties(self) -> PaginatedList[OrganizationCustomProperty]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we rename this?
def get_all_custom_properties(self) -> PaginatedList[OrganizationCustomProperty]: | |
def get_custom_properties(self) -> PaginatedList[OrganizationCustomProperty]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename the get_all_custom_properties
method?
Fixes #2895.