Skip to content

Commit

Permalink
Removing x namespace from go/python/nodejs automation packages (#6518)
Browse files Browse the repository at this point in the history
  • Loading branch information
stack72 committed Mar 24, 2021
1 parent 928eb97 commit 9668cd2
Show file tree
Hide file tree
Showing 101 changed files with 56 additions and 94 deletions.
2 changes: 1 addition & 1 deletion sdk/go/Makefile
@@ -1,7 +1,7 @@
PROJECT_NAME := Pulumi Go SDK
LANGHOST_PKG := github.com/pulumi/pulumi/sdk/v2/go/pulumi-language-go
VERSION := $(shell cd ../../ && pulumictl get version)
PROJECT_PKGS := $(shell go list ./pulumi/... ./pulumi-language-go/... ./common/... ./x/...| grep -v /vendor/ | grep -v templates)
PROJECT_PKGS := $(shell go list ./pulumi/... ./pulumi-language-go/... ./common/... ./auto/...| grep -v /vendor/ | grep -v templates)

TESTPARALLELISM := 10

Expand Down
4 changes: 2 additions & 2 deletions sdk/go/x/auto/README.md → sdk/go/auto/README.md
Expand Up @@ -5,7 +5,7 @@ Programmatic infrastructure. Currently in Alpha.
## Godocs
See the full godocs for the most extensive and up to date information including full examples coverage:

https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v2/go/x/auto?tab=doc
https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v2/go/auto?tab=doc

## Examples

Expand Down Expand Up @@ -107,7 +107,7 @@ This repo has extensive examples and godoc content. To test out your changes loc
1. enlist in the appropriate pulumi branch:
2. cd $GOPATH/src/github.com/pulumi/pulumi/sdk/go/x/auto
3. godoc -http=:6060
4. Navigate to http://localhost:6060/pkg/github.com/pulumi/pulumi/sdk/v2/go/x/auto/
4. Navigate to http://localhost:6060/pkg/github.com/pulumi/pulumi/sdk/v2/go/auto/

## Known Issues

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions sdk/go/x/auto/example_test.go → sdk/go/auto/example_test.go
Expand Up @@ -25,14 +25,14 @@ import (
"os/exec"
"path/filepath"

"github.com/pulumi/pulumi/sdk/v2/go/auto/optdestroy"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optrefresh"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optup"
"github.com/pulumi/pulumi/sdk/v2/go/common/apitype"
"github.com/pulumi/pulumi/sdk/v2/go/common/tokens"
"github.com/pulumi/pulumi/sdk/v2/go/common/workspace"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optdestroy"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optrefresh"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optup"
)

func Example() {
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -29,16 +29,16 @@ import (
"github.com/blang/semver"
"github.com/stretchr/testify/assert"

"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optdestroy"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optrefresh"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optup"
"github.com/pulumi/pulumi/sdk/v2/go/common/apitype"
"github.com/pulumi/pulumi/sdk/v2/go/common/tokens"
"github.com/pulumi/pulumi/sdk/v2/go/common/workspace"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optdestroy"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optrefresh"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optup"
)

var pulumiOrg = getTestOrg()
Expand Down
File renamed without changes.
Expand Up @@ -19,8 +19,8 @@ package optdestroy
import (
"io"

"github.com/pulumi/pulumi/sdk/v2/go/x/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
)

// Parallel is the number of resource operations to run in parallel at once during the destroy
Expand Down
Expand Up @@ -19,8 +19,8 @@ package optpreview
import (
"io"

"github.com/pulumi/pulumi/sdk/v2/go/x/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
)

// Parallel is the number of resource operations to run in parallel at once during the update
Expand Down
Expand Up @@ -19,8 +19,8 @@ package optrefresh
import (
"io"

"github.com/pulumi/pulumi/sdk/v2/go/x/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
)

// Parallel is the number of resource operations to run in parallel at once during the refresh
Expand Down
4 changes: 2 additions & 2 deletions sdk/go/x/auto/optup/optup.go → sdk/go/auto/optup/optup.go
Expand Up @@ -19,8 +19,8 @@ package optup
import (
"io"

"github.com/pulumi/pulumi/sdk/v2/go/x/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
)

// Parallel is the number of resource operations to run in parallel at once during the update
Expand Down
12 changes: 6 additions & 6 deletions sdk/go/x/auto/stack.go → sdk/go/auto/stack.go
Expand Up @@ -105,18 +105,18 @@ import (
"github.com/pkg/errors"
"google.golang.org/grpc"

"github.com/pulumi/pulumi/sdk/v2/go/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optdestroy"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optrefresh"
"github.com/pulumi/pulumi/sdk/v2/go/auto/optup"
"github.com/pulumi/pulumi/sdk/v2/go/common/apitype"
"github.com/pulumi/pulumi/sdk/v2/go/common/constant"
"github.com/pulumi/pulumi/sdk/v2/go/common/resource"
"github.com/pulumi/pulumi/sdk/v2/go/common/util/contract"
"github.com/pulumi/pulumi/sdk/v2/go/common/util/rpcutil"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/debug"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optdestroy"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optrefresh"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/optup"
pulumirpc "github.com/pulumi/pulumi/sdk/v2/proto/go"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sdk/go/x/auto/watcher.go → sdk/go/auto/watcher.go
Expand Up @@ -17,8 +17,8 @@ import (
"encoding/json"
"github.com/nxadm/tail"

"github.com/pulumi/pulumi/sdk/v2/go/auto/events"
"github.com/pulumi/pulumi/sdk/v2/go/common/apitype"
"github.com/pulumi/pulumi/sdk/v2/go/x/auto/events"
)

func watchFile(path string, receivers []chan<- events.EngineEvent) (*tail.Tail, error) {
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions sdk/go/x/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions sdk/go/x/x.go

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,12 +13,12 @@
// limitations under the License.

import * as grpc from "@grpc/grpc-js";
import { isGrpcError, ResourceError, RunError } from "../../errors";
import * as log from "../../log";
import * as runtime from "../../runtime";
import { isGrpcError, ResourceError, RunError } from "../errors";
import * as log from "../log";
import * as runtime from "../runtime";

const langproto = require("../../proto/language_pb.js");
const plugproto = require("../../proto/plugin_pb.js");
const langproto = require("../proto/language_pb.js");
const plugproto = require("../proto/plugin_pb.js");

// maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb)
/** @internal */
Expand Down
Expand Up @@ -28,7 +28,7 @@ import { EngineEvent, SummaryEvent } from "./events";
import { LanguageServer, maxRPCMessageSize } from "./server";
import { Deployment, PulumiFn, Workspace } from "./workspace";

const langrpc = require("../../proto/language_grpc_pb.js");
const langrpc = require("../proto/language_grpc_pb.js");

const secretSentinel = "[secret]";

Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion sdk/nodejs/index.ts
Expand Up @@ -26,13 +26,14 @@ export * from "./stackReference";

// Export submodules individually.
import * as asset from "./asset";
import * as automation from "./automation";
import * as dynamic from "./dynamic";
import * as iterable from "./iterable";
import * as log from "./log";
import * as provider from "./provider";
import * as runtime from "./runtime";
import * as utils from "./utils";
export { asset, dynamic, iterable, log, provider, runtime, utils };
export { asset, automation, dynamic, iterable, log, provider, runtime, utils };

// @pulumi is a deployment-only module. If someone tries to capture it, and we fail for some reason
// we want to give a good message about what the problem likely is. Note that capturing a
Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/tests/automation/localWorkspace.spec.ts
Expand Up @@ -25,7 +25,7 @@ import {
ProjectSettings,
Stack,
validatePulumiVersion,
} from "../../x/automation";
} from "../../automation";
import { asyncTest } from "../util";

const versionRegex = /(\d+\.)(\d+\.)(\d+)(-.*)?/;
Expand Down
21 changes: 10 additions & 11 deletions sdk/nodejs/tsconfig.json
Expand Up @@ -67,17 +67,16 @@
"cmd/run-policy-pack/index.ts",
"cmd/run-policy-pack/run.ts",

"x/index.ts",
"x/automation/index.ts",
"x/automation/cmd.ts",
"x/automation/config.ts",
"x/automation/localWorkspace.ts",
"x/automation/minimumVersion.ts",
"x/automation/projectSettings.ts",
"x/automation/stackSettings.ts",
"x/automation/server.ts",
"x/automation/stack.ts",
"x/automation/workspace.ts",
"automation/index.ts",
"automation/cmd.ts",
"automation/config.ts",
"automation/localWorkspace.ts",
"automation/minimumVersion.ts",
"automation/projectSettings.ts",
"automation/stackSettings.ts",
"automation/server.ts",
"automation/stack.ts",
"automation/workspace.ts",

"tests/config.spec.ts",
"tests/init.spec.ts",
Expand Down
17 changes: 0 additions & 17 deletions sdk/nodejs/x/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions sdk/python/lib/pulumi/__init__.py
Expand Up @@ -96,7 +96,7 @@
set,
)

from . import runtime, dynamic, policy, x
from . import runtime, dynamic, policy, automation

__all__ = [
# asset
Expand Down Expand Up @@ -169,5 +169,5 @@
"runtime",
"dynamic",
"policy",
"x"
"automation"
]
File renamed without changes.
File renamed without changes.
Expand Up @@ -19,10 +19,10 @@
from contextlib import suppress

from ._workspace import PulumiFn
from ... import log
from ...runtime.proto import language_pb2, plugin_pb2, LanguageRuntimeServicer
from ...runtime import run_in_stack, reset_options, set_all_config
from ...errors import RunError
from .. import log
from ..runtime.proto import language_pb2, plugin_pb2, LanguageRuntimeServicer
from ..runtime import run_in_stack, reset_options, set_all_config
from ..errors import RunError

_py_version_less_than_3_7 = sys.version_info[0] == 3 and sys.version_info[1] < 7

Expand Down
Expand Up @@ -24,8 +24,8 @@
from .errors import StackAlreadyExistsError
from ._server import LanguageServer
from ._workspace import Workspace, PulumiFn, Deployment
from ...runtime.settings import _GRPC_CHANNEL_OPTIONS
from ...runtime.proto import language_pb2_grpc
from ..runtime.settings import _GRPC_CHANNEL_OPTIONS
from ..runtime.proto import language_pb2_grpc

_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'

Expand Down
File renamed without changes.
15 changes: 0 additions & 15 deletions sdk/python/lib/pulumi/x/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/python/lib/test/automation/test_errors.py
Expand Up @@ -17,7 +17,7 @@
import subprocess
import unittest
import pytest
from pulumi.x.automation import (
from pulumi.automation import (
create_stack,
InlineSourceRuntimeError,
RuntimeError,
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/lib/test/automation/test_local_workspace.py
Expand Up @@ -19,7 +19,7 @@
from typing import List, Optional

from pulumi import Config, export
from pulumi.x.automation import (
from pulumi.automation import (
create_stack,
create_or_select_stack,
CommandError,
Expand Down

0 comments on commit 9668cd2

Please sign in to comment.