pulumi/tests/integration
Fraser Waters d771acf707
Add tokens.StackName (#14487)
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

This adds a new type `tokens.StackName` which is a relatively strongly
typed container for a stack name. The only weakly typed aspect of it is
Go will always allow the "zero" value to be created for a struct, which
for a stack name is the empty string which is invalid. To prevent
introducing unexpected empty strings when working with stack names the
`String()` method will panic for zero initialized stack names.
 
Apart from the zero value, all other instances of `StackName` are via
`ParseStackName` which returns a descriptive error if the string is not
valid.

This PR only updates "pkg/" to use this type. There are a number of
places in "sdk/" which could do with this type as well, but there's no
harm in doing a staggered roll out, and some parts of "sdk/" are user
facing and will probably have to stay on the current `tokens.Name` and
`tokens.QName` types.

There are two places in the system where we panic on invalid stack
names, both in the http backend. This _should_ be fine as we've had long
standing validation that stacks created in the service are valid stack
names.

Just in case people have managed to introduce invalid stack names, there
is the `PULUMI_DISABLE_VALIDATION` environment variable which will turn
off the validation _and_ panicing for stack names. Users can use that to
temporarily disable the validation and continue working, but it should
only be seen as a temporary measure. If they have invalid names they
should rename them, or if they think they should be valid raise an issue
with us to change the validation code.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-11-15 07:44:54 +00:00
..
about bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
aliases bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
cloud_secrets_provider Enable full strict mode. (#3218) 2019-09-11 16:21:35 -07:00
component_provider_schema Add RunPlugin support for python 2023-03-06 21:35:39 +00:00
config_basic bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
config_capture_e2e/nodejs Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
config_missing bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
config_secrets_warn bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_error_apply Update @types/node version in tests 2023-02-07 14:20:27 +00:00
construct_component_methods bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_methods_errors bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_methods_provider bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_methods_resources bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_methods_unknown bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_output_values bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_plain bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_provider bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_provider_explicit bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_component_provider_propagation Allow shallow clones for local workspaces (#14312) 2023-11-01 17:21:52 +00:00
construct_component_resource_options Allow shallow clones for local workspaces (#14312) 2023-11-01 17:21:52 +00:00
construct_component_slow Update @types/node version in tests 2023-02-07 14:20:27 +00:00
construct_component_unknown bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
construct_nested_component/go Allow shallow clones for local workspaces (#14312) 2023-11-01 17:21:52 +00:00
custom_timeouts Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
delete_before_create Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
deleted_with bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
dependency_steps Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
double_pending_delete Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
duplicate_urns Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
dynamic Pass PULUMI_CONFIG through to provider plugins 2023-04-05 10:17:18 +01:00
ee_perf Use prefered `new pulumi.Config()` form 2019-01-31 16:11:57 -08:00
empty bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
enums [sdk/python] Fix enum test for python 11 behavior change 2023-03-22 07:23:46 -07:00
environments_basic [environments] Add integration tests (#14144) 2023-10-12 16:39:26 +00:00
environments_merge [environments] Add integration tests (#14144) 2023-10-12 16:39:26 +00:00
exclude_protected Implement the --exclude-protected feature (#8359) 2021-11-15 11:45:14 -08:00
explicit_provider Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
gather_plugin bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
get_created Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
get_resource bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
go bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
invalid_package_json Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
large_resource bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
nodejs Warn about undefined stack outputs 2023-07-28 14:33:04 +01:00
partial_state Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
partial_values Propagate inputs to outputs during preview. (#3327) 2019-11-11 12:09:34 -08:00
policy unused: Remove unused functions and types 2023-01-12 09:55:34 -08:00
printf bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
project_main bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
project_main_abs Enable absolute and relative parent paths for pulumi main (#6734) 2021-04-08 21:39:52 -07:00
project_main_parent/foo Enable absolute and relative parent paths for pulumi main (#6734) 2021-04-08 21:39:52 -07:00
protect_resources Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
provider_secret_config Enable full strict mode. (#3218) 2019-09-11 16:21:35 -07:00
python Test duplicate outputs 2023-06-29 10:46:37 +01:00
python_await [sdk/python] - Await all async tasks (#6606) 2021-03-30 10:56:17 -07:00
query Reuse provider instances where possible (#14127) 2023-10-12 20:46:01 +00:00
read Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
recreate_resource_check Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
refresh/go bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
resource_refs_get_resource bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
rotate_passphrase bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
secret_outputs [sdk/python] Fix secret regression (#5496) 2020-10-01 14:57:51 -07:00
single_resource Suppress JSON outputs in preview correctly (#2771) 2019-05-25 12:10:38 +02:00
stack_bad_parenting Consistent dependencies (#2517) 2019-03-05 20:34:51 -08:00
stack_dependencies Remove existing lock files 2018-11-12 15:33:58 -08:00
stack_outputs Remove dotnet 2022-12-13 16:13:53 +00:00
stack_parenting Consistent dependencies (#2517) 2019-03-05 20:34:51 -08:00
stack_project_name Actually fix the naming test (#10554) 2022-08-31 20:52:23 +01:00
stack_reference bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
stack_reference_multi/python Regression tests for StackReference in the Python SDK (#3913) 2020-02-17 10:40:46 -08:00
stack_reference_secrets/nodejs Remove dotnet 2022-12-13 16:13:53 +00:00
state_rename_parent bump google.golang.org/grpc from 1.57.0 to 1.57.1 (#14434) 2023-10-28 15:56:28 +00:00
steps Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
targets Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
transformations Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
tsconfig Add tsconfig option to specify tsconfig path (#8452) 2021-11-22 11:42:39 -08:00
types Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
unsafe_snapshot_tests/bad_resource Update tests/integration/unsafe_snapshot_tests/bad_resource/resource.ts 2022-09-15 08:00:36 -07:00
.gitignore ci: Enable async component builds 2022-09-14 10:06:05 -07:00
appdash_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
component_setup.sh Engine and Golang support for shimless providers 2022-11-14 11:25:41 +00:00
integration_acceptance_test.go Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
integration_go_acceptance_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
integration_go_test.go Actually disable plugin acquisition (#14134) 2023-10-14 08:32:43 +00:00
integration_nodejs_acceptance_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
integration_nodejs_test.go [environments] Add integration tests (#14144) 2023-10-12 16:39:26 +00:00
integration_python_acceptance_test.go Fix traceback diagnostic from being printed when using Python dynamic providers (#14474) 2023-11-01 22:19:37 +00:00
integration_python_test.go [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00
integration_test.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
integration_util_test.go [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00