Skip to content

Commit

Permalink
Add support for new skipIntermediateDeployments setting (#162)
Browse files Browse the repository at this point in the history
Adds support to the new `skipIntermediateDeployments` on
`DeploymentSettings`.

Fix pulumi/pulumi-cloud-requests#136
  • Loading branch information
glena authored Aug 29, 2023
2 parents ae77b20 + 90b4679 commit bc9231b
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 43 deletions.
102 changes: 62 additions & 40 deletions provider/cmd/pulumi-resource-pulumiservice/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"description": "A native Pulumi package for creating and managing Pulumi Cloud constructs",
"homepage": "https://pulumi.com",
"repository": "https://github.com/pulumi/pulumi-pulumiservice",
"keywords": ["pulumi", "kind/native", "category/infrastructure"],
"keywords": [
"pulumi",
"kind/native",
"category/infrastructure"
],
"license": "Apache-2.0",
"publisher": "Pulumi",
"config": {
Expand All @@ -23,7 +27,9 @@
"type": "string",
"default": "",
"defaultInfo": {
"environment": ["PULUMI_ACCESS_TOKEN"]
"environment": [
"PULUMI_ACCESS_TOKEN"
]
}
}
}
Expand Down Expand Up @@ -83,72 +89,72 @@
{
"value": "stack_deleted",
"description": "Trigger a webhook when a stack is deleted. Only valid for org webhooks.",
"name": "StackDeleted"
"name": "StackDeleted"
},
{
"value": "update_succeeded",
"description": "Trigger a webhook when a stack update succeeds.",
"name": "UpdateSucceeded"
"name": "UpdateSucceeded"
},
{
"value": "update_failed",
"description": "Trigger a webhook when a stack update fails.",
"name": "UpdateFailed"
"name": "UpdateFailed"
},
{
"value": "preview_succeeded",
"description": "Trigger a webhook when a stack preview succeeds.",
"name": "PreviewSucceeded"
"name": "PreviewSucceeded"
},
{
"value": "preview_failed",
"description": "Trigger a webhook when a stack preview fails.",
"name": "PreviewFailed"
"name": "PreviewFailed"
},
{
"value": "destroy_succeeded",
"description": "Trigger a webhook when a stack destroy succeeds.",
"name": "DestroySucceeded"
"name": "DestroySucceeded"
},
{
"value": "destroy_failed",
"description": "Trigger a webhook when a stack destroy fails.",
"name": "DestroyFailed"
"name": "DestroyFailed"
},
{
"value": "refresh_succeeded",
"description": "Trigger a webhook when a stack refresh succeeds.",
"name": "RefreshSucceeded"
"name": "RefreshSucceeded"
},
{
"value": "refresh_failed",
"description": "Trigger a webhook when a stack refresh fails.",
"name": "RefreshFailed"
"name": "RefreshFailed"
},
{
"value": "deployment_queued",
"description": "Trigger a webhook when a deployment is queued.",
"name": "DeploymentQueued"
"name": "DeploymentQueued"
},
{
"value": "deployment_started",
"description": "Trigger a webhook when a deployment starts running.",
"name": "DeploymentStarted"
"name": "DeploymentStarted"
},
{
"value": "deployment_succeeded",
"description": "Trigger a webhook when a deployment succeeds.",
"name": "DeploymentSucceeded"
"name": "DeploymentSucceeded"
},
{
"value": "deployment_failed",
"description": "Trigger a webhook when a deployment fails.",
"name": "DeploymentFailed"
"name": "DeploymentFailed"
}
]
},
"pulumiservice:index:DeploymentSettingsExecutorContext": {
"description":"The executor context defines information about the executor where the deployment is executed. If unspecified, the default 'pulumi/pulumi' image is used.",
"description": "The executor context defines information about the executor where the deployment is executed. If unspecified, the default 'pulumi/pulumi' image is used.",
"properties": {
"executorImage": {
"type": "string",
Expand All @@ -161,7 +167,7 @@
]
},
"pulumiservice:index:DeploymentSettingsSourceContext": {
"description":"Settings related to the source of the deployment.",
"description": "Settings related to the source of the deployment.",
"properties": {
"git": {
"$ref": "#/types/pulumiservice:index:DeploymentSettingsGitSource",
Expand All @@ -171,7 +177,7 @@
"type": "object"
},
"pulumiservice:index:DeploymentSettingsGitSource": {
"description":"Git source settings for a deployment.",
"description": "Git source settings for a deployment.",
"properties": {
"repoUrl": {
"type": "string",
Expand All @@ -196,8 +202,8 @@
},
"type": "object"
},
"pulumiservice:index:DeploymentSettingsGitSourceGitAuth": {
"description":"Git source settings for a deployment.",
"pulumiservice:index:DeploymentSettingsGitSourceGitAuth": {
"description": "Git source settings for a deployment.",
"properties": {
"sshAuth": {
"$ref": "#/types/pulumiservice:index:DeploymentSettingsGitAuthSSHAuth",
Expand Down Expand Up @@ -316,6 +322,10 @@
"type": "boolean",
"description": "Skip the default dependency installation step - use this to customize the dependency installation (e.g. if using yarn or poetry)"
},
"skipIntermediateDeployments": {
"type": "boolean",
"description": "Skip intermediate deployments (Consolidate multiple deployments of the same type into one deployment)"
},
"shell": {
"type": "string",
"description": "The shell to use to run commands during the deployment. Defaults to 'bash'."
Expand Down Expand Up @@ -449,7 +459,9 @@
"type": "string"
}
},
"requiredInputs": ["description"]
"requiredInputs": [
"description"
]
},
"pulumiservice:index:Team": {
"description": "The Pulumi Cloud offers role-based access control (RBAC) using teams. Teams allow organization admins to assign a set of stack permissions to a group of users.",
Expand Down Expand Up @@ -482,8 +494,8 @@
"type": "string"
},
"githubTeamId": {
"description": "The GitHub ID of the team to mirror. Must be in the same GitHub organization that the Pulumi org is backed by. Required for \"github\" teams.",
"type": "number"
"description": "The GitHub ID of the team to mirror. Must be in the same GitHub organization that the Pulumi org is backed by. Required for \"github\" teams.",
"type": "number"
}
},
"inputProperties": {
Expand Down Expand Up @@ -515,11 +527,14 @@
"type": "string"
},
"githubTeamId": {
"description": "The GitHub ID of the team to mirror. Must be in the same GitHub organization that the Pulumi org is backed by. Required for \"github\" teams.",
"type": "number"
"description": "The GitHub ID of the team to mirror. Must be in the same GitHub organization that the Pulumi org is backed by. Required for \"github\" teams.",
"type": "number"
}
},
"requiredInputs": ["organizationName", "teamType"]
"requiredInputs": [
"organizationName",
"teamType"
]
},
"pulumiservice:index:TeamAccessToken": {
"description": "The Pulumi Cloud allows users to create access tokens scoped to team. Team access tokens is a resource to create them and assign them to a team",
Expand Down Expand Up @@ -564,7 +579,11 @@
"type": "string"
}
},
"requiredInputs": ["name", "teamName", "organizationName"]
"requiredInputs": [
"name",
"teamName",
"organizationName"
]
},
"pulumiservice:index:OrgAccessToken": {
"description": "The Pulumi Cloud allows users to create access tokens scoped to orgs. Org access tokens is a resource to create them and assign them to an org",
Expand Down Expand Up @@ -601,7 +620,10 @@
"type": "string"
}
},
"requiredInputs": ["name", "organizationName"]
"requiredInputs": [
"name",
"organizationName"
]
},
"pulumiservice:index:Webhook": {
"description": "Pulumi Webhooks allow you to notify external services of events happening within your Pulumi organization or stack. For example, you can trigger a notification whenever a stack is updated. Whenever an event occurs, Pulumi will send an HTTP POST request to all registered webhooks. The webhook can then be used to emit some notification, start running integration tests, or even update additional stacks.\n\n### Import\n\nPulumi webhooks can be imported using the `id`, which for webhooks is `{org}/{project}/{stack}/{webhook-name}` e.g.,\n\n```sh\n $ pulumi import pulumiservice:index:Webhook my_webhook my-org/my-project/my-stack/4b0d0671\n```\n\n",
Expand Down Expand Up @@ -632,23 +654,23 @@
"type": "string"
},
"projectName": {
"description": "Name of the project. Only specified if this is a stack webhook.",
"type": "string"
"description": "Name of the project. Only specified if this is a stack webhook.",
"type": "string"
},
"stackName": {
"description": "Name of the stack. Only specified if this is a stack webhook.",
"type": "string"
"description": "Name of the stack. Only specified if this is a stack webhook.",
"type": "string"
},
"format": {
"description": "Format of the webhook payload. Can be either `raw` or `slack`. Defaults to `raw`.",
"$ref": "#/types/pulumiservice:index:WebhookFormat"
"description": "Format of the webhook payload. Can be either `raw` or `slack`. Defaults to `raw`.",
"$ref": "#/types/pulumiservice:index:WebhookFormat"
},
"filters": {
"description": "Optional set of filters to apply to the webhook. See [webhook docs](https://www.pulumi.com/docs/intro/pulumi-service/webhooks/#filters) for more information.",
"type": "array",
"items": {
"$ref": "#/types/pulumiservice:index:WebhookFilters"
}
"description": "Optional set of filters to apply to the webhook. See [webhook docs](https://www.pulumi.com/docs/intro/pulumi-service/webhooks/#filters) for more information.",
"type": "array",
"items": {
"$ref": "#/types/pulumiservice:index:WebhookFilters"
}
}
},
"inputProperties": {
Expand Down Expand Up @@ -861,4 +883,4 @@
}
}
}
}
}
5 changes: 3 additions & 2 deletions provider/pkg/internal/pulumiapi/deployment_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ type AzureOIDCConfiguration struct {
}

type OperationContextOptions struct {
SkipInstallDependencies bool `json:"skipInstallDependencies,omitempty"`
Shell string `json:"shell,omitempty"`
SkipInstallDependencies bool `json:"skipInstallDependencies,omitempty"`
SkipIntermediateDeployments bool `json:"skipIntermediateDeployments,omitempty"`
Shell string `json:"shell,omitempty"`
}

type GitHubConfiguration struct {
Expand Down
7 changes: 7 additions & 0 deletions provider/pkg/provider/deployment_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func (ds *PulumiServiceDeploymentSettingsInput) ToPropertyMap() resource.Propert
if ds.OperationContext.Options.SkipInstallDependencies {
optionsMap["skipInstallDependencies"] = resource.NewPropertyValue(true)
}
if ds.OperationContext.Options.SkipIntermediateDeployments {
optionsMap["skipIntermediateDeployments"] = resource.NewPropertyValue(true)
}
ocMap["options"] = resource.PropertyValue{V: optionsMap}
}
if ds.OperationContext.OIDC != nil {
Expand Down Expand Up @@ -366,6 +369,10 @@ func toOperationContext(inputMap resource.PropertyMap) *pulumiapi.OperationConte
o.SkipInstallDependencies = oInput["skipInstallDependencies"].BoolValue()
}

if oInput["skipIntermediateDeployments"].HasValue() && oInput["skipIntermediateDeployments"].IsBool() {
o.SkipIntermediateDeployments = oInput["skipIntermediateDeployments"].BoolValue()
}

if oInput["Shell"].HasValue() && oInput["Shell"].IsString() {
o.Shell = oInput["Shell"].StringValue()
}
Expand Down
6 changes: 6 additions & 0 deletions sdk/dotnet/Inputs/OperationContextOptionsArgs.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions sdk/go/pulumiservice/pulumiTypes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bc9231b

Please sign in to comment.