Skip to content

Commit 550ecbe

Browse files
authored
feat!: Remove Project (classic) support (#3380)
BREAKING CHANGE: All support for "Project (classic)" is removed and `Project` responses are replaced by `ProjectV2` (renamed from `ProjectsV2`). Fixes: #3367.
1 parent 9505a7f commit 550ecbe

23 files changed

+533
-4953
lines changed

github/event_types.go

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,72 +1083,22 @@ type PingEvent struct {
10831083
Installation *Installation `json:"installation,omitempty"`
10841084
}
10851085

1086-
// ProjectEvent is triggered when project is created, modified or deleted.
1087-
// The webhook event name is "project".
1088-
//
1089-
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project
1090-
type ProjectEvent struct {
1091-
Action *string `json:"action,omitempty"`
1092-
Changes *ProjectChange `json:"changes,omitempty"`
1093-
Project *Project `json:"project,omitempty"`
1094-
1095-
// The following fields are only populated by Webhook events.
1096-
Repo *Repository `json:"repository,omitempty"`
1097-
Org *Organization `json:"organization,omitempty"`
1098-
Sender *User `json:"sender,omitempty"`
1099-
Installation *Installation `json:"installation,omitempty"`
1100-
}
1101-
1102-
// ProjectCardEvent is triggered when a project card is created, updated, moved, converted to an issue, or deleted.
1103-
// The webhook event name is "project_card".
1104-
//
1105-
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_card
1106-
type ProjectCardEvent struct {
1107-
Action *string `json:"action,omitempty"`
1108-
Changes *ProjectCardChange `json:"changes,omitempty"`
1109-
AfterID *int64 `json:"after_id,omitempty"`
1110-
ProjectCard *ProjectCard `json:"project_card,omitempty"`
1111-
1112-
// The following fields are only populated by Webhook events.
1113-
Repo *Repository `json:"repository,omitempty"`
1114-
Org *Organization `json:"organization,omitempty"`
1115-
Sender *User `json:"sender,omitempty"`
1116-
Installation *Installation `json:"installation,omitempty"`
1117-
}
1118-
1119-
// ProjectColumnEvent is triggered when a project column is created, updated, moved, or deleted.
1120-
// The webhook event name is "project_column".
1121-
//
1122-
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_column
1123-
type ProjectColumnEvent struct {
1124-
Action *string `json:"action,omitempty"`
1125-
Changes *ProjectColumnChange `json:"changes,omitempty"`
1126-
AfterID *int64 `json:"after_id,omitempty"`
1127-
ProjectColumn *ProjectColumn `json:"project_column,omitempty"`
1128-
1129-
// The following fields are only populated by Webhook events.
1130-
Repo *Repository `json:"repository,omitempty"`
1131-
Org *Organization `json:"organization,omitempty"`
1132-
Sender *User `json:"sender,omitempty"`
1133-
Installation *Installation `json:"installation,omitempty"`
1134-
}
1135-
11361086
// ProjectV2Event is triggered when there is activity relating to an organization-level project.
11371087
// The Webhook event name is "projects_v2".
11381088
//
11391089
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2
11401090
type ProjectV2Event struct {
1141-
Action *string `json:"action,omitempty"`
1142-
ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"`
1091+
Action *string `json:"action,omitempty"`
1092+
ProjectsV2 *ProjectV2 `json:"projects_v2,omitempty"`
11431093

11441094
// The following fields are only populated by Webhook events.
11451095
Installation *Installation `json:"installation,omitempty"`
11461096
Org *Organization `json:"organization,omitempty"`
11471097
Sender *User `json:"sender,omitempty"`
11481098
}
11491099

1150-
// ProjectsV2 represents a projects v2 project.
1151-
type ProjectsV2 struct {
1100+
// ProjectV2 represents a v2 project.
1101+
type ProjectV2 struct {
11521102
ID *int64 `json:"id,omitempty"`
11531103
NodeID *string `json:"node_id,omitempty"`
11541104
Owner *User `json:"owner,omitempty"`
@@ -1163,6 +1113,17 @@ type ProjectsV2 struct {
11631113
Number *int `json:"number,omitempty"`
11641114
ShortDescription *string `json:"short_description,omitempty"`
11651115
DeletedBy *User `json:"deleted_by,omitempty"`
1116+
1117+
// Fields migrated from the Project (classic) struct:
1118+
URL *string `json:"url,omitempty"`
1119+
HTMLURL *string `json:"html_url,omitempty"`
1120+
ColumnsURL *string `json:"columns_url,omitempty"`
1121+
OwnerURL *string `json:"owner_url,omitempty"`
1122+
Name *string `json:"name,omitempty"`
1123+
Body *string `json:"body,omitempty"`
1124+
State *string `json:"state,omitempty"`
1125+
OrganizationPermission *string `json:"organization_permission,omitempty"`
1126+
Private *bool `json:"private,omitempty"`
11661127
}
11671128

11681129
// ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project.

0 commit comments

Comments
 (0)