Skip to content

Commit

Permalink
Merge branch 'master' into simplified-invoke-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-Ajaj committed Dec 14, 2022
2 parents ac4b693 + 8922b44 commit 6d642f4
Show file tree
Hide file tree
Showing 565 changed files with 3,937 additions and 36,014 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci-build-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,36 +124,3 @@ jobs:
path: sdk/nodejs/bin/*.tgz
retention-days: 1
if-no-files-found: error

build_dotnet_sdk:
name: dotnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Setup versioning env vars
env:
version: ${{ inputs.version }}
run: |
./scripts/versions.sh | tee -a "${GITHUB_ENV}"
- name: Set up DotNet ${{ fromJson(inputs.version-set).dotnet }}
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: ${{ fromJson(inputs.version-set).dotnet }}
dotnet-quality: ga
- name: Build the .NET SDK package
run: |
cd sdk/dotnet
dotnet build --configuration Release dotnet.sln "/p:Version=${DOTNET_VERSION}"
- name: Pack the .NET SDK package
run: |
cd sdk/dotnet
dotnet pack --configuration Release --output nupkgs dotnet.sln "/p:Version=${DOTNET_VERSION}"
- name: Upload the NuGet packages
uses: actions/upload-artifact@v2
with:
name: artifacts-dotnet-sdk
path: sdk/dotnet/nupkgs/*.nupkg
retention-days: 1
if-no-files-found: error
14 changes: 0 additions & 14 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ jobs:
python-version: ${{ fromJson(inputs.version-set).python }}
cache: pip
cache-dependency-path: sdk/python/requirements.txt
- name: Set up DotNet ${{ fromJson(inputs.version-set).dotnet }}
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: ${{ fromJson(inputs.version-set).dotnet }}
dotnet-quality: ga
- run: mkdir -p "${{ runner.temp }}/opt/pulumi/nuget"
- name: Add NuGet packages as a local NuGet source
run: |
command -v dotnet
dotnet --version
dotnet nuget add source "${{ runner.temp }}/opt/pulumi/nuget"
- name: Set up Node ${{ fromJson(inputs.version-set).nodejs }}
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -108,9 +97,6 @@ jobs:
- name: Lint Python
run: |
cd sdk/python && make lint
- name: Lint .NET
run: |
cd sdk/dotnet && make lint
actionlint:
name: Lint GHA
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ jobs:
path: artifacts.tmp
- name: Rename SDKs
run: |
(
cd artifacts.tmp/artifacts-dotnet-sdk
for file in *.nupkg ; do
mv -vT "$file" "sdk-dotnet-$file"
done
)
(
cd artifacts.tmp/artifacts-python-sdk
for file in *.whl ; do
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/ci-run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
name: ${{ inputs.test-name }}
env:
PULUMI_HOME: ${{ github.workspace }}/home
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
TEST_ALL_DEPS: ""

runs-on: ${{ inputs.platform }}
Expand Down Expand Up @@ -259,27 +258,6 @@ jobs:
LOCAL_PATH=$(./scripts/normpath "${{ github.workspace }}/bin")
echo "Adding LOCAL_PATH=$LOCAL_PATH to PATH"
echo "$LOCAL_PATH" >> "$GITHUB_PATH"
- name: Download Pulumi .NET NuGet packages
if: ${{ inputs.is-integration-test }}
uses: actions/download-artifact@v2
with:
name: artifacts-dotnet-sdk
# path set to match PULUMI_LOCAL_NUGET
path: ${{ github.workspace }}/nuget
- name: Add NuGet packages as a local NuGet source
if: ${{ inputs.is-integration-test }}
run: |
command -v dotnet
dotnet --version
echo "PULUMI_LOCAL_NUGET=$PULUMI_LOCAL_NUGET"
SOURCE="$(./scripts/normpath "$PULUMI_LOCAL_NUGET")"
echo "SOURCE=$SOURCE"
dotnet nuget add source "$SOURCE"
- name: Inspect downloaded artifacts
if: ${{ inputs.is-integration-test }}
run: |
echo "PULUMI_LOCAL_NUGET=$PULUMI_LOCAL_NUGET"
find "$PULUMI_LOCAL_NUGET"
# /end integration test steps
- name: Verify Pulumi Version
Expand Down
5 changes: 0 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ builds:
binary: pulumi-language-python
dir: sdk
main: ./python/cmd/pulumi-language-python
- <<: *pulumibin
id: pulumi-language-dotnet
binary: pulumi-language-dotnet
dir: sdk
main: ./dotnet/cmd/pulumi-language-dotnet

archives:
- id: pulumi
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"gopls": {
// A couple of modules get copied as part of builds and this confuse gopls as it sees the module name twice, just ignore the copy in the build folders.
"build.directoryFilters": [
"-sdk/dotnet/Pulumi.Automation.Tests/bin",
"-sdk/nodejs/bin",
"-sdk/nodejs/tests",
"-sdk/python/env"
Expand All @@ -16,8 +15,6 @@
"experimentalWorkspaceModule": true,
},

"omnisharp.defaultLaunchSolution": "sdk/dotnet/dotnet.sln",
"dotnet-test-explorer.testProjectPath": "sdk/dotnet",
"python.testing.pytestArgs": [
"sdk/python/lib/test"
],
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT_NAME := Pulumi SDK
SDKS := dotnet nodejs python go
SDKS := nodejs python go
SUB_PROJECTS := $(SDKS:%=sdk/%)

include build/common.mk
Expand Down
2 changes: 0 additions & 2 deletions build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ PIP ?= pip3

PULUMI_BIN := $(PULUMI_ROOT)/bin
PULUMI_NODE_MODULES := $(PULUMI_ROOT)/node_modules
PULUMI_NUGET := $(PULUMI_ROOT)/nuget

# Extra options to pass to `go test` command, for example:
#
Expand Down Expand Up @@ -170,7 +169,6 @@ install::
@# Implicitly creates PULUMI_ROOT.
@mkdir -p $(PULUMI_BIN)
@mkdir -p $(PULUMI_NODE_MODULES)
@mkdir -p $(PULUMI_NUGET)

dist::
$(call STEP_MESSAGE)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: cli
description: Adds a flag that allows user to set the node label as the resource name instead of full URN in the stack graph
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: cli
description: pulumi destroy --remove will now delete the stack config file
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: cli/config,new,package
description: Preserve comments on editing of project and config files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: sdk/python
description: Add json_dumps to python sdk.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: cli/display
description: Fixes negative durations on update display.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: programgen/go
description: Check for optional/ Ptr types within Union types. This fixes a bug in Go programgen where optional outputs are not returned as pointers.
4 changes: 0 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ coverage:
- "sdk/go/common/*"
- "sdk/go/auto/*"
- "sdk/proto/*"
sdk-dotnet:
informational: true
paths:
- "sdk/dotnet/*"
sdk-go:
informational: true
paths:
Expand Down
3 changes: 3 additions & 0 deletions pkg/backend/display/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ func (display *ProgressDisplay) processNormalEvent(event engine.Event) {
// and time elapsed.
display.opStopwatch.start[step.URN] = time.Now()

// Clear out potential event end timings for prior operations on the same resource.
delete(display.opStopwatch.end, step.URN)

row.SetStep(step)
} else if event.Type == engine.ResourceOutputsEvent {
isRefresh := display.getStepOp(row.Step()) == deploy.OpRefresh
Expand Down
23 changes: 15 additions & 8 deletions pkg/cmd/pulumi/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"errors"
"fmt"
"os"

"github.com/spf13/cobra"

Expand Down Expand Up @@ -81,7 +82,7 @@ func newDestroyCmd() *cobra.Command {
"all of this stack's resources and associated state are deleted.\n" +
"\n" +
"The stack itself is not deleted. Use `pulumi stack rm` or the \n" +
"`--remove` flag to delete the stack.\n" +
"`--remove` flag to delete the stack and its config file.\n" +
"\n" +
"Warning: this command is generally irreversible and should be used with great care.",
Args: cmdArgs,
Expand Down Expand Up @@ -271,9 +272,15 @@ func newDestroyCmd() *cobra.Command {
_, err = s.Remove(ctx, false)
if err != nil {
return result.FromError(err)
} else if !jsonDisplay {
fmt.Printf("The resources in the stack have been deleted, and the history and " +
"configuration removed.\n")
}
// Remove also the stack config file.
if _, path, err := workspace.DetectProjectStackPath(s.Ref().Name().Q()); err == nil {
if err = os.Remove(path); err != nil && !os.IsNotExist(err) {
return result.FromError(err)
} else if !jsonDisplay {
fmt.Printf("The resources in the stack have been deleted, and the history and " +
"configuration removed.\n")
}
}
}
} else if res != nil && res.Error() == context.Canceled {
Expand All @@ -288,7 +295,7 @@ func newDestroyCmd() *cobra.Command {
"Print detailed debugging output during resource operations")
cmd.PersistentFlags().BoolVar(
&remove, "remove", false,
"Remove the stack after all resources in the stack have been deleted")
"Remove the stack and its config file after all resources in the stack have been deleted")
cmd.PersistentFlags().StringVarP(
&stack, "stack", "s", "",
"The name of the stack to operate on. Defaults to the current stack")
Expand Down Expand Up @@ -368,7 +375,7 @@ func newDestroyCmd() *cobra.Command {
return cmd
}

// seperateProtected returns a list or unprotected and protected resources respectively. This allows
// separateProtected returns a list or unprotected and protected resources respectively. This allows
// us to safely destroy all resources in the unprotected list without invalidating any resource in
// the protected list. Protection is contravarient: A < B where A: Protected => B: Protected, A < B
// where B: Protected !=> A: Protected.
Expand All @@ -385,7 +392,7 @@ func newDestroyCmd() *cobra.Command {
//
// We rely on the fact that `resources` is topologically sorted with respect to its dependencies.
// This function understands that providers live outside this topological sort.
func seperateProtected(resources []*resource.State) (
func separateProtected(resources []*resource.State) (
/*unprotected*/ []*resource.State /*protected*/, []*resource.State) {
dg := graph.NewDependencyGraph(resources)
transitiveProtected := graph.ResourceSet{}
Expand All @@ -409,7 +416,7 @@ func handleExcludeProtected(ctx context.Context, s backend.Stack) ([]string, int
} else if snapshot == nil {
return nil, 0, errors.New("Failed to find the stack snapshot. Are you in a stack?")
}
unprotected, protected := seperateProtected(snapshot.Resources)
unprotected, protected := separateProtected(snapshot.Resources)
targetUrns := make([]string, len(unprotected))
for i, r := range unprotected {
targetUrns[i] = string(r.URN)
Expand Down

0 comments on commit 6d642f4

Please sign in to comment.