Skip to content

Commit e10040d

Browse files
authored
fix!: Add support for missing attributes in ProjectsV2 API (#3888)
1 parent c98fd62 commit e10040d

File tree

7 files changed

+1027
-71
lines changed

7 files changed

+1027
-71
lines changed

github/event_types.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,44 +1148,6 @@ type FieldValue struct {
11481148
To json.RawMessage `json:"to,omitempty"`
11491149
}
11501150

1151-
// ProjectV2ItemFieldValue represents a field value of a project item.
1152-
type ProjectV2ItemFieldValue struct {
1153-
ID *int64 `json:"id,omitempty"`
1154-
Name string `json:"name,omitempty"`
1155-
DataType string `json:"data_type,omitempty"`
1156-
// Value set for the field. The type depends on the field type:
1157-
// - text: string
1158-
// - number: float64
1159-
// - date: string (ISO 8601 date format, e.g. "2023-06-23") or null
1160-
// - single_select: object with "id", "name", "color", "description" fields or null
1161-
// - iteration: object with "id", "title", "start_date", "duration" fields or null
1162-
// - title: object with "text" field (read-only, reflects the item's title) or null
1163-
// - assignees: array of user objects with "login", "id", etc. or null
1164-
// - labels: array of label objects with "id", "name", "color", etc. or null
1165-
// - linked_pull_requests: array of pull request objects or null
1166-
// - milestone: milestone object with "id", "title", "description", etc. or null
1167-
// - repository: repository object with "id", "name", "full_name", etc. or null
1168-
// - reviewers: array of user objects or null
1169-
// - status: object with "id", "name", "color", "description" fields (same structure as single_select) or null
1170-
Value any `json:"value,omitempty"`
1171-
}
1172-
1173-
// ProjectV2Item represents an item belonging to a project.
1174-
type ProjectV2Item struct {
1175-
ID *int64 `json:"id,omitempty"`
1176-
NodeID *string `json:"node_id,omitempty"`
1177-
ProjectNodeID *string `json:"project_node_id,omitempty"`
1178-
ContentNodeID *string `json:"content_node_id,omitempty"`
1179-
ProjectURL *string `json:"project_url,omitempty"`
1180-
ContentType *string `json:"content_type,omitempty"`
1181-
Creator *User `json:"creator,omitempty"`
1182-
CreatedAt *Timestamp `json:"created_at,omitempty"`
1183-
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
1184-
ArchivedAt *Timestamp `json:"archived_at,omitempty"`
1185-
ItemURL *string `json:"item_url,omitempty"`
1186-
Fields []*ProjectV2ItemFieldValue `json:"fields,omitempty"`
1187-
}
1188-
11891151
// PublicEvent is triggered when a private repository is open sourced.
11901152
// According to GitHub: "Without a doubt: the best GitHub event."
11911153
// The Webhook event name is "public".

github/event_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15866,7 +15866,7 @@ func TestProjectV2ItemEvent_Marshal(t *testing.T) {
1586615866
NodeID: Ptr("nid"),
1586715867
ProjectNodeID: Ptr("pnid"),
1586815868
ContentNodeID: Ptr("cnid"),
15869-
ContentType: Ptr("ct"),
15869+
ContentType: Ptr(ProjectV2ItemContentType("ct")),
1587015870
Creator: &User{
1587115871
Login: Ptr("l"),
1587215872
ID: Ptr(int64(1)),

github/github-accessors.go

Lines changed: 221 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)