Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update target references to use ${bundle.target} #1935

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

pietern
Copy link
Contributor

@pietern pietern commented Nov 27, 2024

Changes

The built-in template contains a reference to ${bundle.environment}.

This property has been deprecated in favor of ${bundle.target} a long time ago (#670), so we should no longer emit it. The environment field will continue to be usable until we cut a new major version in some far away future.

Tests

  • Unit tests
  • The test TestInterpolationWithTarget still covers correct interpolation of ${bundle.environment}

Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 1935
  • Commit SHA: 96feb14d467e8f4a9f87f8c78e84d9c1d3b465d8

Checks will be approved automatically on success.

@eng-dev-ecosystem-bot
Copy link
Collaborator

Test Details: go/deco-tests/12048444439

@pietern
Copy link
Contributor Author

pietern commented Nov 27, 2024

Existing test:

func TestInterpolationWithTarget(t *testing.T) {
b := loadTarget(t, "./interpolation_target", "development")
diags := bundle.Apply(context.Background(), b, mutator.ResolveVariableReferences(
"bundle",
"workspace",
))
require.NoError(t, diags.Error())
assert.Equal(t, "foo bar", b.Config.Bundle.Name)
assert.Equal(t, "foo bar | bar | development | development", b.Config.Resources.Jobs["my_job"].Name)
}

Configuration:

resources:
jobs:
my_job:
name: "${bundle.name} | ${workspace.profile} | ${bundle.environment} | ${bundle.target}"

@pietern pietern added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit fae1b67 Nov 27, 2024
10 checks passed
@pietern pietern deleted the template-target branch November 27, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants