Add Custom Properties for Repository-Derived Tables - #556
Conversation
cbruno10
left a comment
There was a problem hiding this comment.
@Recurzion Thanks for the PR!
I've added a couple suggestions, the bigger one is around moving from v3 (REST) to v4 (GraphQL) API, happy to discuss more if you have any questions. Thanks!
| Value interface{} `json:"value"` | ||
| } | ||
|
|
||
| func hydrateRepositoryCustomPropertiesFromV3(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { |
There was a problem hiding this comment.
Instead of using the v3 RESTful API, can we retrieve it using the newer GraphQL API, similar to most other columns in this table? GraphQL APIs in general are more forgiving with rate limits and from what we could see, better supported moving forward.
In the GraphQL API, the Repository object has repositoryCustomPropertyValues, so we can use that I believe and we should get the first: 100, as there seems to be a limit of 100 property definitions.
You can look at the labels column in the github_issue table, as it has the same shape and also does an array to map conversion like this property would use.
There was a problem hiding this comment.
Sure thing. I followed the same pattern used by the labels column now.
This PR adds the ability to query repository custom properties (returned as
jsonb) for any repository-derived columns viasharedRepositoryColumns()and updates docs with example queries (these can be removed if not needed).Teams often use GitHub custom properties to capture custom repo-level metadata/attributes, so adding this field should benefit organizations that leverage it.
This applies to the following tables:
sharedRepositoryColumns()Example query results
Results