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

add support for --import-file when using the Automation API #16071

Merged
merged 7 commits into from Apr 30, 2024

Conversation

charlie-haley
Copy link
Contributor

Description

Fixes # (issue)

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

@charlie-haley charlie-haley requested a review from a team as a code owner April 26, 2024 14:58
Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Apr 26, 2024

Changelog

[uncommitted] (2024-04-29)

Features

  • [auto/{go,nodejs,python}] Add support for --import-file option on Preview with Automation API

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 26, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 26, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

Copy link
Collaborator

@tgummerer tgummerer left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, this looks like a good addition to the automation API.

Having a look at the code, I think this needs to be a string, to be able to pass an actual path argument to the CLI, I don't think this is just a binary flag.

@charlie-haley
Copy link
Contributor Author

Thanks for the PR, this looks like a good addition to the automation API.

Having a look at the code, I think this needs to be a string, to be able to pass an actual path argument to the CLI, I don't think this is just a binary flag.

Ah, good point! The output of the help command is quite confusing as it says --import-file pulumi import instead of --import-file string, I believe that's happened because of pulumi import being in single quotes here:
https://github.com/pulumi/pulumi/blob/master/pkg/cmd/pulumi/preview.go#L542

I'll also update that as part of this PR unless you want me to raise a separate PR, also happy to do that.

Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 29, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

Copy link
Collaborator

@tgummerer tgummerer left a comment

Choose a reason for hiding this comment

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

Thank you! Agreed on the docstring, it's nice to update that so the help output is less confusing. I'm fine with keeping that in the same PR, just left a minor suggestion on formatting there.

pkg/cmd/pulumi/preview.go Outdated Show resolved Hide resolved
Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 29, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 29, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

@tgummerer
Copy link
Collaborator

@charlie-haley I saw CI was still failing and had a quick look. It looks like there was an != "" missing in the Go if statement. I took the liberty to just push that to your branch, which will hopefully get the PR green, so we can go ahead and merge it.

Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@charlie-haley
Copy link
Contributor Author

@charlie-haley I saw CI was still failing and had a quick look. It looks like there was an != "" missing in the Go if statement. I took the liberty to just push that to your branch, which will hopefully get the PR green, so we can go ahead and merge it.

Thanks! There was also an indentation problem in the stack.ts, it should hopefully all be green now

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 29, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@tgummerer
Copy link
Collaborator

tgummerer commented Apr 30, 2024

/run-acceptance-tests
Please view the results of the acceptance tests Here

@tgummerer tgummerer added this pull request to the merge queue Apr 30, 2024
Merged via the queue into pulumi:master with commit b57c60f Apr 30, 2024
8 of 9 checks passed
@tgummerer
Copy link
Collaborator

Thanks again for this contribution @charlie-haley! This is gonna go into the next pulumi release, which might happen this week (or potentially next, since we have a company offsite this week)

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.

None yet

3 participants