diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d52d2b9..a26ebfc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.13.0" + ".": "0.14.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 82c3873..b0ef81a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dabc0ff98cd7b9d91850b3c0dbada4e487e698333cd0b7257959e4819d9a29d6.yml -openapi_spec_hash: b974bdc6025a26cfa62857bf74ec379b -config_hash: 13514c5eb422e4eb01767e718798de1e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0e20f536f7f833dd7205eaadd72826bd527a3ed91fcb006323e3232550abb04e.yml +openapi_spec_hash: 7a96aca1a75735a1664edd091b277940 +config_hash: 25c7c72de891ed240ee62c4fb9a99756 diff --git a/CHANGELOG.md b/CHANGELOG.md index a4864f2..d46ba0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.14.0 (2026-04-17) + +Full Changelog: [v0.13.0...v0.14.0](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.13.0...v0.14.0) + +### Features + +* **api:** add integration_id, update webhook_id in pull request trigger ([71d164a](https://github.com/gitpod-io/gitpod-sdk-go/commit/71d164aa1e7e29b16ee8531437e1e9969933aa08)) +* **api:** add old_path field to environment git changed file model ([9fe1925](https://github.com/gitpod-io/gitpod-sdk-go/commit/9fe19258fc36ca036af7788f5f6a9999734c2563)) +* **api:** add OPUS_4_7 to agent supported models enum ([d2a744b](https://github.com/gitpod-io/gitpod-sdk-go/commit/d2a744be9876078da2a967eea5b71e6d10709fca)) +* **api:** add port_authentication capability to RunnerCapability ([6e3178e](https://github.com/gitpod-io/gitpod-sdk-go/commit/6e3178eff7946662bdd2aede907d7d86b4d003f1)) +* **api:** add review_requested event to workflow trigger pull request events ([ac58c85](https://github.com/gitpod-io/gitpod-sdk-go/commit/ac58c8578b8564674f5204cadbee1a3ce89e5b94)) +* **api:** remove Terminal field from RunsOn type ([5b02fe5](https://github.com/gitpod-io/gitpod-sdk-go/commit/5b02fe5111f66ac18a52efb079dcc0a86d82181a)) +* **types:** add prebuild value to AutomationsFileServicesTriggeredBy enum ([efe0872](https://github.com/gitpod-io/gitpod-sdk-go/commit/efe08724860d1d93c1782725f688a588b755be40)) +* **types:** extract Report types to top-level from WorkflowStep ([d58de25](https://github.com/gitpod-io/gitpod-sdk-go/commit/d58de258a0f8f2f3e1400778b07b91d4ff5ee91e)) + + +### Chores + +* **internal:** regenerate SDK with no functional changes ([f8b376e](https://github.com/gitpod-io/gitpod-sdk-go/commit/f8b376ef7d1eebbdf66252e7ec29893d2fc1541f)) + ## 0.13.0 (2026-04-02) Full Changelog: [v0.12.0...v0.13.0](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.12.0...v0.13.0) diff --git a/README.md b/README.md index 212b803..8e810cf 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Or to pin the version: ```sh -go get -u 'github.com/gitpod-io/gitpod-sdk-go@v0.13.0' +go get -u 'github.com/gitpod-io/gitpod-sdk-go@v0.14.0' ``` diff --git a/agent.go b/agent.go index 255239e..a5866b3 100644 --- a/agent.go +++ b/agent.go @@ -1197,6 +1197,7 @@ const ( AgentExecutionStatusSupportedModelSupportedModelOpus4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5_EXTENDED" AgentExecutionStatusSupportedModelSupportedModelOpus4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6" AgentExecutionStatusSupportedModelSupportedModelOpus4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6_EXTENDED" + AgentExecutionStatusSupportedModelSupportedModelOpus4_7 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_7" AgentExecutionStatusSupportedModelSupportedModelHaiku4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_HAIKU_4_5" AgentExecutionStatusSupportedModelSupportedModelOpenAI4O AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O" AgentExecutionStatusSupportedModelSupportedModelOpenAI4OMini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O_MINI" @@ -1206,7 +1207,7 @@ const ( func (r AgentExecutionStatusSupportedModel) IsKnown() bool { switch r { - case AgentExecutionStatusSupportedModelSupportedModelUnspecified, AgentExecutionStatusSupportedModelSupportedModelSonnet3_5, AgentExecutionStatusSupportedModelSupportedModelSonnet3_7, AgentExecutionStatusSupportedModelSupportedModelSonnet3_7Extended, AgentExecutionStatusSupportedModelSupportedModelSonnet4, AgentExecutionStatusSupportedModelSupportedModelSonnet4Extended, AgentExecutionStatusSupportedModelSupportedModelSonnet4_5, AgentExecutionStatusSupportedModelSupportedModelSonnet4_5Extended, AgentExecutionStatusSupportedModelSupportedModelSonnet4_6, AgentExecutionStatusSupportedModelSupportedModelSonnet4_6Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4, AgentExecutionStatusSupportedModelSupportedModelOpus4Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4_5, AgentExecutionStatusSupportedModelSupportedModelOpus4_5Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4_6, AgentExecutionStatusSupportedModelSupportedModelOpus4_6Extended, AgentExecutionStatusSupportedModelSupportedModelHaiku4_5, AgentExecutionStatusSupportedModelSupportedModelOpenAI4O, AgentExecutionStatusSupportedModelSupportedModelOpenAI4OMini, AgentExecutionStatusSupportedModelSupportedModelOpenAIO1, AgentExecutionStatusSupportedModelSupportedModelOpenAIO1Mini: + case AgentExecutionStatusSupportedModelSupportedModelUnspecified, AgentExecutionStatusSupportedModelSupportedModelSonnet3_5, AgentExecutionStatusSupportedModelSupportedModelSonnet3_7, AgentExecutionStatusSupportedModelSupportedModelSonnet3_7Extended, AgentExecutionStatusSupportedModelSupportedModelSonnet4, AgentExecutionStatusSupportedModelSupportedModelSonnet4Extended, AgentExecutionStatusSupportedModelSupportedModelSonnet4_5, AgentExecutionStatusSupportedModelSupportedModelSonnet4_5Extended, AgentExecutionStatusSupportedModelSupportedModelSonnet4_6, AgentExecutionStatusSupportedModelSupportedModelSonnet4_6Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4, AgentExecutionStatusSupportedModelSupportedModelOpus4Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4_5, AgentExecutionStatusSupportedModelSupportedModelOpus4_5Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4_6, AgentExecutionStatusSupportedModelSupportedModelOpus4_6Extended, AgentExecutionStatusSupportedModelSupportedModelOpus4_7, AgentExecutionStatusSupportedModelSupportedModelHaiku4_5, AgentExecutionStatusSupportedModelSupportedModelOpenAI4O, AgentExecutionStatusSupportedModelSupportedModelOpenAI4OMini, AgentExecutionStatusSupportedModelSupportedModelOpenAIO1, AgentExecutionStatusSupportedModelSupportedModelOpenAIO1Mini: return true } return false diff --git a/aliases.go b/aliases.go index 8de5747..9dc2f5b 100644 --- a/aliases.go +++ b/aliases.go @@ -21,8 +21,8 @@ type Error = apierror.Error // automation during a prebuild of an environment. This phase does not have user // secrets available. The `before_snapshot` field triggers the automation after all // prebuild tasks complete but before the snapshot is taken. This is used for tasks -// that need to run last during prebuilds, such as IDE warmup. Note: The prebuild -// and before_snapshot triggers can only be used with tasks, not services. +// that need to run last during prebuilds, such as IDE warmup. Note: The +// before_snapshot trigger can only be used with tasks, not services. // // This is an alias to an internal type. type AutomationTrigger = shared.AutomationTrigger @@ -39,8 +39,8 @@ type AutomationTrigger = shared.AutomationTrigger // automation during a prebuild of an environment. This phase does not have user // secrets available. The `before_snapshot` field triggers the automation after all // prebuild tasks complete but before the snapshot is taken. This is used for tasks -// that need to run last during prebuilds, such as IDE warmup. Note: The prebuild -// and before_snapshot triggers can only be used with tasks, not services. +// that need to run last during prebuilds, such as IDE warmup. Note: The +// before_snapshot trigger can only be used with tasks, not services. // // This is an alias to an internal type. type AutomationTriggerParam = shared.AutomationTriggerParam diff --git a/automation.go b/automation.go index 4cf5f52..724bfa7 100644 --- a/automation.go +++ b/automation.go @@ -2496,7 +2496,6 @@ type WorkflowStep struct { Agent WorkflowStepAgent `json:"agent"` // WorkflowPullRequestStep represents a pull request creation step. PullRequest WorkflowStepPullRequest `json:"pullRequest"` - Report WorkflowStepReport `json:"report"` // WorkflowTaskStep represents a task step that executes a command. Task WorkflowStepTask `json:"task"` JSON workflowStepJSON `json:"-"` @@ -2506,7 +2505,6 @@ type WorkflowStep struct { type workflowStepJSON struct { Agent apijson.Field PullRequest apijson.Field - Report apijson.Field Task apijson.Field raw string ExtraFields map[string]apijson.Field @@ -2590,51 +2588,6 @@ func (r workflowStepPullRequestJSON) RawJSON() string { return r.raw } -type WorkflowStepReport struct { - // Report must have at least one output: - // - // ``` - // size(this) >= 1 - // ``` - Outputs []WorkflowStepReportOutput `json:"outputs"` - JSON workflowStepReportJSON `json:"-"` -} - -// workflowStepReportJSON contains the JSON metadata for the struct -// [WorkflowStepReport] -type workflowStepReportJSON struct { - Outputs apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkflowStepReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r workflowStepReportJSON) RawJSON() string { - return r.raw -} - -type WorkflowStepReportOutput struct { - JSON workflowStepReportOutputJSON `json:"-"` -} - -// workflowStepReportOutputJSON contains the JSON metadata for the struct -// [WorkflowStepReportOutput] -type workflowStepReportOutputJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkflowStepReportOutput) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r workflowStepReportOutputJSON) RawJSON() string { - return r.raw -} - // WorkflowTaskStep represents a task step that executes a command. type WorkflowStepTask struct { // Command must be between 1 and 20,000 characters: @@ -2668,7 +2621,6 @@ type WorkflowStepParam struct { Agent param.Field[WorkflowStepAgentParam] `json:"agent"` // WorkflowPullRequestStep represents a pull request creation step. PullRequest param.Field[WorkflowStepPullRequestParam] `json:"pullRequest"` - Report param.Field[WorkflowStepReportParam] `json:"report"` // WorkflowTaskStep represents a task step that executes a command. Task param.Field[WorkflowStepTaskParam] `json:"task"` } @@ -2718,26 +2670,6 @@ func (r WorkflowStepPullRequestParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkflowStepReportParam struct { - // Report must have at least one output: - // - // ``` - // size(this) >= 1 - // ``` - Outputs param.Field[[]WorkflowStepReportOutputParam] `json:"outputs"` -} - -func (r WorkflowStepReportParam) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type WorkflowStepReportOutputParam struct { -} - -func (r WorkflowStepReportOutputParam) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - // WorkflowTaskStep represents a task step that executes a command. type WorkflowStepTaskParam struct { // Command must be between 1 and 20,000 characters: @@ -2817,6 +2749,10 @@ func (r workflowTriggerJSON) RawJSON() string { // for PRs in repositories matching the trigger context. type WorkflowTriggerPullRequest struct { Events []WorkflowTriggerPullRequestEvent `json:"events"` + // integration_id is the optional ID of an integration that acts as the source of + // webhook events. When set, the trigger will be activated when the webhook + // receives events. + IntegrationID string `json:"integrationId" api:"nullable" format:"uuid"` // webhook_id is the optional ID of a webhook that this trigger is bound to. When // set, the trigger will be activated when the webhook receives events. This allows // multiple workflows to share a single webhook endpoint. @@ -2827,10 +2763,11 @@ type WorkflowTriggerPullRequest struct { // workflowTriggerPullRequestJSON contains the JSON metadata for the struct // [WorkflowTriggerPullRequest] type workflowTriggerPullRequestJSON struct { - Events apijson.Field - WebhookID apijson.Field - raw string - ExtraFields map[string]apijson.Field + Events apijson.Field + IntegrationID apijson.Field + WebhookID apijson.Field + raw string + ExtraFields map[string]apijson.Field } func (r *WorkflowTriggerPullRequest) UnmarshalJSON(data []byte) (err error) { @@ -2845,18 +2782,19 @@ func (r workflowTriggerPullRequestJSON) RawJSON() string { type WorkflowTriggerPullRequestEvent string const ( - WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED" - WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED" - WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED" - WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED" - WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED" - WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED" - WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW" + WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED" + WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED" + WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED" + WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED" + WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED" + WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED" + WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW" + WorkflowTriggerPullRequestEventPullRequestEventReviewRequested WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_REVIEW_REQUESTED" ) func (r WorkflowTriggerPullRequestEvent) IsKnown() bool { switch r { - case WorkflowTriggerPullRequestEventPullRequestEventUnspecified, WorkflowTriggerPullRequestEventPullRequestEventOpened, WorkflowTriggerPullRequestEventPullRequestEventUpdated, WorkflowTriggerPullRequestEventPullRequestEventApproved, WorkflowTriggerPullRequestEventPullRequestEventMerged, WorkflowTriggerPullRequestEventPullRequestEventClosed, WorkflowTriggerPullRequestEventPullRequestEventReadyForReview: + case WorkflowTriggerPullRequestEventPullRequestEventUnspecified, WorkflowTriggerPullRequestEventPullRequestEventOpened, WorkflowTriggerPullRequestEventPullRequestEventUpdated, WorkflowTriggerPullRequestEventPullRequestEventApproved, WorkflowTriggerPullRequestEventPullRequestEventMerged, WorkflowTriggerPullRequestEventPullRequestEventClosed, WorkflowTriggerPullRequestEventPullRequestEventReadyForReview, WorkflowTriggerPullRequestEventPullRequestEventReviewRequested: return true } return false @@ -2940,6 +2878,10 @@ func (r WorkflowTriggerParam) MarshalJSON() (data []byte, err error) { // for PRs in repositories matching the trigger context. type WorkflowTriggerPullRequestParam struct { Events param.Field[[]WorkflowTriggerPullRequestEvent] `json:"events"` + // integration_id is the optional ID of an integration that acts as the source of + // webhook events. When set, the trigger will be activated when the webhook + // receives events. + IntegrationID param.Field[string] `json:"integrationId" format:"uuid"` // webhook_id is the optional ID of a webhook that this trigger is bound to. When // set, the trigger will be activated when the webhook receives events. This allows // multiple workflows to share a single webhook endpoint. diff --git a/automation_test.go b/automation_test.go index bfb8c99..6e6a243 100644 --- a/automation_test.go +++ b/automation_test.go @@ -47,9 +47,6 @@ func TestAutomationNewWithOptionalParams(t *testing.T) { Draft: gitpod.F(true), Title: gitpod.F("title"), }), - Report: gitpod.F(gitpod.WorkflowStepReportParam{ - Outputs: gitpod.F([]gitpod.WorkflowStepReportOutputParam{{}}), - }), Task: gitpod.F(gitpod.WorkflowStepTaskParam{ Command: gitpod.F("command"), }), @@ -79,9 +76,6 @@ func TestAutomationNewWithOptionalParams(t *testing.T) { Draft: gitpod.F(true), Title: gitpod.F("title"), }), - Report: gitpod.F(gitpod.WorkflowStepReportParam{ - Outputs: gitpod.F([]gitpod.WorkflowStepReportOutputParam{{}}), - }), Task: gitpod.F(gitpod.WorkflowStepTaskParam{ Command: gitpod.F("command"), }), @@ -109,8 +103,9 @@ func TestAutomationNewWithOptionalParams(t *testing.T) { }), Manual: gitpod.F[any](map[string]interface{}{}), PullRequest: gitpod.F(gitpod.WorkflowTriggerPullRequestParam{ - Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}), - WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}), + IntegrationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), }), Time: gitpod.F(gitpod.WorkflowTriggerTimeParam{ CronExpression: gitpod.F("cronExpression"), @@ -183,9 +178,6 @@ func TestAutomationUpdateWithOptionalParams(t *testing.T) { Draft: gitpod.F(true), Title: gitpod.F("title"), }), - Report: gitpod.F(gitpod.WorkflowStepReportParam{ - Outputs: gitpod.F([]gitpod.WorkflowStepReportOutputParam{{}}), - }), Task: gitpod.F(gitpod.WorkflowStepTaskParam{ Command: gitpod.F("command"), }), @@ -216,9 +208,6 @@ func TestAutomationUpdateWithOptionalParams(t *testing.T) { Draft: gitpod.F(true), Title: gitpod.F("title"), }), - Report: gitpod.F(gitpod.WorkflowStepReportParam{ - Outputs: gitpod.F([]gitpod.WorkflowStepReportOutputParam{{}}), - }), Task: gitpod.F(gitpod.WorkflowStepTaskParam{ Command: gitpod.F("command"), }), @@ -246,8 +235,9 @@ func TestAutomationUpdateWithOptionalParams(t *testing.T) { }), Manual: gitpod.F[any](map[string]interface{}{}), PullRequest: gitpod.F(gitpod.WorkflowTriggerPullRequestParam{ - Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}), - WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Events: gitpod.F([]gitpod.WorkflowTriggerPullRequestEvent{gitpod.WorkflowTriggerPullRequestEventPullRequestEventUnspecified}), + IntegrationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + WebhookID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), }), Time: gitpod.F(gitpod.WorkflowTriggerTimeParam{ CronExpression: gitpod.F("cronExpression"), diff --git a/environment.go b/environment.go index a870d10..9191316 100644 --- a/environment.go +++ b/environment.go @@ -1628,6 +1628,9 @@ func (r environmentStatusContentGitJSON) RawJSON() string { type EnvironmentStatusContentGitChangedFile struct { // ChangeType is the type of change that happened to the file ChangeType EnvironmentStatusContentGitChangedFilesChangeType `json:"changeType"` + // old_path is the previous path of the file before a rename or copy. Only set when + // change_type is RENAMED or COPIED. + OldPath string `json:"oldPath"` // path is the path of the file Path string `json:"path"` JSON environmentStatusContentGitChangedFileJSON `json:"-"` @@ -1637,6 +1640,7 @@ type EnvironmentStatusContentGitChangedFile struct { // struct [EnvironmentStatusContentGitChangedFile] type environmentStatusContentGitChangedFileJSON struct { ChangeType apijson.Field + OldPath apijson.Field Path apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/environmentautomation.go b/environmentautomation.go index b4523b7..726bcdb 100644 --- a/environmentautomation.go +++ b/environmentautomation.go @@ -153,11 +153,12 @@ const ( AutomationsFileServicesTriggeredByManual AutomationsFileServicesTriggeredBy = "manual" AutomationsFileServicesTriggeredByPostEnvironmentStart AutomationsFileServicesTriggeredBy = "postEnvironmentStart" AutomationsFileServicesTriggeredByPostDevcontainerStart AutomationsFileServicesTriggeredBy = "postDevcontainerStart" + AutomationsFileServicesTriggeredByPrebuild AutomationsFileServicesTriggeredBy = "prebuild" ) func (r AutomationsFileServicesTriggeredBy) IsKnown() bool { switch r { - case AutomationsFileServicesTriggeredByManual, AutomationsFileServicesTriggeredByPostEnvironmentStart, AutomationsFileServicesTriggeredByPostDevcontainerStart: + case AutomationsFileServicesTriggeredByManual, AutomationsFileServicesTriggeredByPostEnvironmentStart, AutomationsFileServicesTriggeredByPostDevcontainerStart, AutomationsFileServicesTriggeredByPrebuild: return true } return false diff --git a/environmentautomation_test.go b/environmentautomation_test.go index c8ad014..55ecae4 100644 --- a/environmentautomation_test.go +++ b/environmentautomation_test.go @@ -44,8 +44,7 @@ func TestEnvironmentAutomationUpsertWithOptionalParams(t *testing.T) { Environment: gitpod.F([]string{"string"}), Image: gitpod.F("x"), }), - Machine: gitpod.F[any](map[string]interface{}{}), - Terminal: gitpod.F[any](map[string]interface{}{}), + Machine: gitpod.F[any](map[string]interface{}{}), }), TriggeredBy: gitpod.F([]gitpod.AutomationsFileServicesTriggeredBy{gitpod.AutomationsFileServicesTriggeredByPostDevcontainerStart}), }, @@ -61,8 +60,7 @@ func TestEnvironmentAutomationUpsertWithOptionalParams(t *testing.T) { Environment: gitpod.F([]string{"string"}), Image: gitpod.F("x"), }), - Machine: gitpod.F[any](map[string]interface{}{}), - Terminal: gitpod.F[any](map[string]interface{}{}), + Machine: gitpod.F[any](map[string]interface{}{}), }), TriggeredBy: gitpod.F([]gitpod.AutomationsFileTasksTriggeredBy{gitpod.AutomationsFileTasksTriggeredByPostEnvironmentStart}), }, diff --git a/environmentautomationservice_test.go b/environmentautomationservice_test.go index ff0f3d8..e9421b5 100644 --- a/environmentautomationservice_test.go +++ b/environmentautomationservice_test.go @@ -70,8 +70,7 @@ func TestEnvironmentAutomationServiceNewWithOptionalParams(t *testing.T) { Environment: gitpod.F([]string{"string"}), Image: gitpod.F("x"), }), - Machine: gitpod.F[any](map[string]interface{}{}), - Terminal: gitpod.F[any](map[string]interface{}{}), + Machine: gitpod.F[any](map[string]interface{}{}), }), Session: gitpod.F("session"), SpecVersion: gitpod.F("specVersion"), @@ -161,8 +160,7 @@ func TestEnvironmentAutomationServiceUpdateWithOptionalParams(t *testing.T) { Environment: gitpod.F([]string{"string"}), Image: gitpod.F("x"), }), - Machine: gitpod.F[any](map[string]interface{}{}), - Terminal: gitpod.F[any](map[string]interface{}{}), + Machine: gitpod.F[any](map[string]interface{}{}), }), }), Status: gitpod.F(gitpod.EnvironmentAutomationServiceUpdateParamsStatus{ diff --git a/environmentautomationtask_test.go b/environmentautomationtask_test.go index 21a0f71..3d110cc 100644 --- a/environmentautomationtask_test.go +++ b/environmentautomationtask_test.go @@ -65,8 +65,7 @@ func TestEnvironmentAutomationTaskNewWithOptionalParams(t *testing.T) { Environment: gitpod.F([]string{"string"}), Image: gitpod.F("x"), }), - Machine: gitpod.F[any](map[string]interface{}{}), - Terminal: gitpod.F[any](map[string]interface{}{}), + Machine: gitpod.F[any](map[string]interface{}{}), }), }), }) @@ -150,8 +149,7 @@ func TestEnvironmentAutomationTaskUpdateWithOptionalParams(t *testing.T) { Environment: gitpod.F([]string{"string"}), Image: gitpod.F("x"), }), - Machine: gitpod.F[any](map[string]interface{}{}), - Terminal: gitpod.F[any](map[string]interface{}{}), + Machine: gitpod.F[any](map[string]interface{}{}), }), }), }) diff --git a/internal/version.go b/internal/version.go index 871f096..870e575 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.13.0" // x-release-please-version +const PackageVersion = "0.14.0" // x-release-please-version diff --git a/runner.go b/runner.go index cef5783..f9b3243 100644 --- a/runner.go +++ b/runner.go @@ -599,11 +599,12 @@ const ( RunnerCapabilityRunnerSideAgent RunnerCapability = "RUNNER_CAPABILITY_RUNNER_SIDE_AGENT" RunnerCapabilityWarmPool RunnerCapability = "RUNNER_CAPABILITY_WARM_POOL" RunnerCapabilityAsgWarmPool RunnerCapability = "RUNNER_CAPABILITY_ASG_WARM_POOL" + RunnerCapabilityPortAuthentication RunnerCapability = "RUNNER_CAPABILITY_PORT_AUTHENTICATION" ) func (r RunnerCapability) IsKnown() bool { switch r { - case RunnerCapabilityUnspecified, RunnerCapabilityFetchLocalScmIntegrations, RunnerCapabilitySecretContainerRegistry, RunnerCapabilityAgentExecution, RunnerCapabilityAllowEnvTokenPopulation, RunnerCapabilityDefaultDevContainerImage, RunnerCapabilityEnvironmentSnapshot, RunnerCapabilityPrebuildsBeforeSnapshotTrigger, RunnerCapabilityListScmOrganizations, RunnerCapabilityCheckRepositoryAccess, RunnerCapabilityRunnerSideAgent, RunnerCapabilityWarmPool, RunnerCapabilityAsgWarmPool: + case RunnerCapabilityUnspecified, RunnerCapabilityFetchLocalScmIntegrations, RunnerCapabilitySecretContainerRegistry, RunnerCapabilityAgentExecution, RunnerCapabilityAllowEnvTokenPopulation, RunnerCapabilityDefaultDevContainerImage, RunnerCapabilityEnvironmentSnapshot, RunnerCapabilityPrebuildsBeforeSnapshotTrigger, RunnerCapabilityListScmOrganizations, RunnerCapabilityCheckRepositoryAccess, RunnerCapabilityRunnerSideAgent, RunnerCapabilityWarmPool, RunnerCapabilityAsgWarmPool, RunnerCapabilityPortAuthentication: return true } return false diff --git a/shared/shared.go b/shared/shared.go index 19afda4..1d8f4a1 100644 --- a/shared/shared.go +++ b/shared/shared.go @@ -21,8 +21,8 @@ import ( // automation during a prebuild of an environment. This phase does not have user // secrets available. The `before_snapshot` field triggers the automation after all // prebuild tasks complete but before the snapshot is taken. This is used for tasks -// that need to run last during prebuilds, such as IDE warmup. Note: The prebuild -// and before_snapshot triggers can only be used with tasks, not services. +// that need to run last during prebuilds, such as IDE warmup. Note: The +// before_snapshot trigger can only be used with tasks, not services. type AutomationTrigger struct { BeforeSnapshot bool `json:"beforeSnapshot"` Manual bool `json:"manual"` @@ -66,8 +66,8 @@ func (r automationTriggerJSON) RawJSON() string { // automation during a prebuild of an environment. This phase does not have user // secrets available. The `before_snapshot` field triggers the automation after all // prebuild tasks complete but before the snapshot is taken. This is used for tasks -// that need to run last during prebuilds, such as IDE warmup. Note: The prebuild -// and before_snapshot triggers can only be used with tasks, not services. +// that need to run last during prebuilds, such as IDE warmup. Note: The +// before_snapshot trigger can only be used with tasks, not services. type AutomationTriggerParam struct { BeforeSnapshot param.Field[bool] `json:"beforeSnapshot"` Manual param.Field[bool] `json:"manual"` @@ -567,17 +567,13 @@ type RunsOn struct { Docker RunsOnDocker `json:"docker"` // Machine runs the service/task directly on the VM/machine level. Machine interface{} `json:"machine"` - // Terminal runs the service inside a managed PTY terminal in the devcontainer. - // Users can attach to the terminal interactively via the terminal API. - Terminal interface{} `json:"terminal"` - JSON runsOnJSON `json:"-"` + JSON runsOnJSON `json:"-"` } // runsOnJSON contains the JSON metadata for the struct [RunsOn] type runsOnJSON struct { Docker apijson.Field Machine apijson.Field - Terminal apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -616,9 +612,6 @@ type RunsOnParam struct { Docker param.Field[RunsOnDockerParam] `json:"docker"` // Machine runs the service/task directly on the VM/machine level. Machine param.Field[interface{}] `json:"machine"` - // Terminal runs the service inside a managed PTY terminal in the devcontainer. - // Users can attach to the terminal interactively via the terminal API. - Terminal param.Field[interface{}] `json:"terminal"` } func (r RunsOnParam) MarshalJSON() (data []byte, err error) {