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

[policy/new] make pulumi policy new <template-name> runnable in non-interactive mode #13902

Merged
merged 2 commits into from Sep 9, 2023

Conversation

dixler
Copy link
Contributor

@dixler dixler commented Sep 8, 2023

Description

Fixes #13901

pulumi policy new <template-name> would fail requiring a --yes argument that did not exist when being run non-interactively.

This changes pulumi policy new <template-name> to not require --yes when a template-name is provided.

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt
  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Sep 8, 2023

Changelog

[uncommitted] (2023-09-09)

Bug Fixes

  • [cli/new] Fixes pulumi policy new <template-name> to not require --yes when run non-interactively.
    #13902

Fixes #13901

`pulumi policy new <template-name>` would fail requiring a `--yes`
argument that did not exist when being run non-interactively.

This changes `pulumi policy new <template-name>` to not require `--yes`
when a template-name is provided.
@dixler dixler force-pushed the dixler/13901/pulumi-policy-new-noninteractive branch from 21cd301 to 7cd3fda Compare September 8, 2023 15:40
@dixler dixler changed the title [policy/new] pulumi policy new <template-name> runnable in non-interactive mode [policy/new] make pulumi policy new <template-name> runnable in non-interactive mode Sep 8, 2023
@dixler dixler marked this pull request as ready for review September 8, 2023 17:21
@dixler dixler requested a review from a team September 8, 2023 17:21
@dixler dixler added this pull request to the merge queue Sep 8, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 8, 2023
@@ -154,3 +154,10 @@ func TestRemoteLifecycle(t *testing.T) {

e.RunCommand("pulumi", "stack", "rm", "--stack", fullyQualifiedStack, "--yes")
}

func TestPolicyNewNonInteractive(t *testing.T) {
Copy link
Member

@justinvp justinvp Sep 8, 2023

Choose a reason for hiding this comment

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

Nit: Seems a little odd to put this test in this file. Why not a new tests/policy_new_test.go or tests/policy_test.go file?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I didn't notice this was with the remote tests, that's a good point. Make a new file.

Copy link
Member

Choose a reason for hiding this comment

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

I went ahead and pushed a commit that moves it to a new file.

@justinvp justinvp added this pull request to the merge queue Sep 9, 2023
Merged via the queue into master with commit 69af495 Sep 9, 2023
46 checks passed
@justinvp justinvp deleted the dixler/13901/pulumi-policy-new-noninteractive branch September 9, 2023 01:37
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.

[cli] pulumi policy new cannot be run non-interactively
4 participants