Skip to content

Commit 71d164a

Browse files
feat(api): add integration_id, update webhook_id in pull request trigger
1 parent 52434f8 commit 71d164a

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 193
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c148bac55f33b187604bab867c9b75124734cc8e4e72d4087e5a8e9b7472adff.yml
3-
openapi_spec_hash: b98efd1fad1247c31ca39e482a151040
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5f25564854b84c1757f66d81caaa50f47db40dc697d4cc91877c2f4e59fa16aa.yml
3+
openapi_spec_hash: 132db01aff2713a9a0a4d9e858ec1bba
44
config_hash: 25c7c72de891ed240ee62c4fb9a99756

automation.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,6 +2749,10 @@ func (r workflowTriggerJSON) RawJSON() string {
27492749
// for PRs in repositories matching the trigger context.
27502750
type WorkflowTriggerPullRequest struct {
27512751
Events []WorkflowTriggerPullRequestEvent `json:"events"`
2752+
// integration_id is the optional ID of an integration that acts as the source of
2753+
// webhook events. When set, the trigger will be activated when the webhook
2754+
// receives events.
2755+
IntegrationID string `json:"integrationId" api:"nullable" format:"uuid"`
27522756
// webhook_id is the optional ID of a webhook that this trigger is bound to. When
27532757
// set, the trigger will be activated when the webhook receives events. This allows
27542758
// multiple workflows to share a single webhook endpoint.
@@ -2759,10 +2763,11 @@ type WorkflowTriggerPullRequest struct {
27592763
// workflowTriggerPullRequestJSON contains the JSON metadata for the struct
27602764
// [WorkflowTriggerPullRequest]
27612765
type workflowTriggerPullRequestJSON struct {
2762-
Events apijson.Field
2763-
WebhookID apijson.Field
2764-
raw string
2765-
ExtraFields map[string]apijson.Field
2766+
Events apijson.Field
2767+
IntegrationID apijson.Field
2768+
WebhookID apijson.Field
2769+
raw string
2770+
ExtraFields map[string]apijson.Field
27662771
}
27672772

27682773
func (r *WorkflowTriggerPullRequest) UnmarshalJSON(data []byte) (err error) {
@@ -2872,6 +2877,10 @@ func (r WorkflowTriggerParam) MarshalJSON() (data []byte, err error) {
28722877
// for PRs in repositories matching the trigger context.
28732878
type WorkflowTriggerPullRequestParam struct {
28742879
Events param.Field[[]WorkflowTriggerPullRequestEvent] `json:"events"`
2880+
// integration_id is the optional ID of an integration that acts as the source of
2881+
// webhook events. When set, the trigger will be activated when the webhook
2882+
// receives events.
2883+
IntegrationID param.Field[string] `json:"integrationId" format:"uuid"`
28752884
// webhook_id is the optional ID of a webhook that this trigger is bound to. When
28762885
// set, the trigger will be activated when the webhook receives events. This allows
28772886
// multiple workflows to share a single webhook endpoint.

automation_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ func TestAutomationNewWithOptionalParams(t *testing.T) {
103103
}),
104104
Manual: gitpod.F[any](map[string]interface{}{}),
105105
PullRequest: gitpod.F(gitpod.WorkflowTriggerPullRequestParam{
106-
Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}),
107-
WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
106+
Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}),
107+
IntegrationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
108+
WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
108109
}),
109110
Time: gitpod.F(gitpod.WorkflowTriggerTimeParam{
110111
CronExpression: gitpod.F("cronExpression"),
@@ -234,8 +235,9 @@ func TestAutomationUpdateWithOptionalParams(t *testing.T) {
234235
}),
235236
Manual: gitpod.F[any](map[string]interface{}{}),
236237
PullRequest: gitpod.F(gitpod.WorkflowTriggerPullRequestParam{
237-
Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}),
238-
WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
238+
Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}),
239+
IntegrationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
240+
WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
239241
}),
240242
Time: gitpod.F(gitpod.WorkflowTriggerTimeParam{
241243
CronExpression: gitpod.F("cronExpression"),

0 commit comments

Comments
 (0)