Skip to content

Commit

Permalink
feat(engine): Adds structured alias support to the engine
Browse files Browse the repository at this point in the history
feat(engine): Adds alias lineage calculation to the engine
  • Loading branch information
kpitzen committed Oct 11, 2022
1 parent 0ce3821 commit 95e2505
Show file tree
Hide file tree
Showing 51 changed files with 2,487 additions and 1,648 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ coverage.cov
**/obj/
coverage/
venv/
.envrc

**/.idea/
*.iml
Expand Down
4 changes: 4 additions & 0 deletions changelog/pending/20221006--engine--structured-aliasing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: engine
description: Adds structured alias support to the engine
2 changes: 1 addition & 1 deletion pkg/backend/display/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func stateForJSONOutput(s *resource.State, opts Options) *resource.State {

return resource.NewState(s.Type, s.URN, s.Custom, s.Delete, s.ID, inputs,
outputs, s.Parent, s.Protect, s.External, s.Dependencies, s.InitErrors, s.Provider,
s.PropertyDependencies, s.PendingReplacement, s.AdditionalSecretOutputs, s.AliasURNs, &s.CustomTimeouts,
s.PropertyDependencies, s.PendingReplacement, s.AdditionalSecretOutputs, s.Aliases, &s.CustomTimeouts,
s.ImportID, s.RetainOnDelete)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/lifecycletest/golang_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func TestSingleResourceDefaultProviderGolangTransformations(t *testing.T) {
if res.URN.Name() == "res3" {
foundRes3 = true
assert.Equal(t, "baz", res.Inputs["foo"].StringValue())
assert.Len(t, res.AliasURNs, 0)
assert.Len(t, res.Aliases, 0)
}
// "res4" is impacted by two component parent transformations which set
// Foo to "baz1" and then "baz2" and also a global stack
Expand Down
4 changes: 2 additions & 2 deletions pkg/engine/lifecycletest/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func TestSingleResourceExplicitProviderAliasUpdateDelete(t *testing.T) {
program := deploytest.NewLanguageRuntime(func(_ plugin.RunInfo, monitor *deploytest.ResourceMonitor) error {
provURN, provID, _, err := monitor.RegisterResource(providers.MakeProviderType("pkgA"), providerName, true,
deploytest.ResourceOptions{
Inputs: providerInputs,
Inputs: providerInputs,
AliasURNs: aliases,
})
assert.NoError(t, err)
Expand Down Expand Up @@ -515,7 +515,7 @@ func TestSingleResourceExplicitProviderAliasReplace(t *testing.T) {
program := deploytest.NewLanguageRuntime(func(_ plugin.RunInfo, monitor *deploytest.ResourceMonitor) error {
provURN, provID, _, err := monitor.RegisterResource(providers.MakeProviderType("pkgA"), providerName, true,
deploytest.ResourceOptions{
Inputs: providerInputs,
Inputs: providerInputs,
AliasURNs: aliases,
})
assert.NoError(t, err)
Expand Down
Loading

0 comments on commit 95e2505

Please sign in to comment.