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

Support future glob patterns #11150

Merged
merged 1 commit into from Oct 26, 2022
Merged

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Oct 25, 2022

Fixes #8956

This changes how the various --target globs work. Instead of expanding the glob on the current snapshot, we now push the glob into the engine itself. This allows us to glob on resources not yet created.

In exchange for this feature, we give up the ability to reject globs that expand to nothing ahead of running a pulumi up. We gain a much more intuitive interface: globs work as expected, without caveats.

@iwahbe iwahbe requested review from Frassle and dixler October 25, 2022 19:11
@iwahbe iwahbe self-assigned this Oct 25, 2022
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2022-10-25)

Features

  • [cli] Allow globbing for resources that do not yet exist
    #11150

Copy link
Member

@Frassle Frassle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to get this done 🎉

}

// Return if the instance was explicitly created, or if it was default initialized.
func (t UrnTargets) IsInitialized() bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsInitialized reads a bit odd, maybe IsEmpty? Because NewUrnTargets([]string{}) is initialized but would return false from this method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'm going to change it to IsConstrained.

Conceptually, NewUrnTargets([]string{"foo*", "bar"}) is { urn | urn in Urns and (urn = "bar" or urn in expand("foo*")) } (urn is constrained).

NewUrnTargets([]string{}) is equivalent to { urn | urn in Urns } (urn is unconstrained).

@Frassle
Copy link
Member

Frassle commented Oct 25, 2022

It would be good to have a test for these new glob creates in pkg/engine/lifecycletest/target_test.go

Support future glob patterns

Improve name for unspecified targets

Add a test in target_test
@iwahbe iwahbe force-pushed the iwahbe/8956/support-future-glob-patterns branch from 0555d58 to 856bded Compare October 25, 2022 23:55
@iwahbe
Copy link
Member Author

iwahbe commented Oct 25, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 26, 2022

Build succeeded:

  • bors-ok

@bors bors bot merged commit 17b1a66 into master Oct 26, 2022
@bors bors bot deleted the iwahbe/8956/support-future-glob-patterns branch October 26, 2022 00:33
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.

Support resources not yet created for --target glob patterns
3 participants