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

dotnet automation api ImportStackAsync and ExportStackAsync #6728

Merged
merged 11 commits into from
Apr 12, 2021

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Apr 8, 2021

Could't use Deplomyent as in node SDK as this is taken by something else. So StackDeployment. Good name?

Should I add show-secrets flag?

Do we want ImportOptions and ExportOptions with OnStandardError etc.

@t0yv0 t0yv0 requested a review from komalali April 8, 2021 18:29
@t0yv0 t0yv0 changed the title dotnet automation api stack export import dotnet automation api ImportStackAsync and ExportStackAsync Apr 8, 2021
@t0yv0
Copy link
Member Author

t0yv0 commented Apr 8, 2021

CC @orionstudt

@t0yv0
Copy link
Member Author

t0yv0 commented Apr 8, 2021

TODO: PR against feature-3.0 to bring in compliance with #6415 that is pass --stack

@t0yv0
Copy link
Member Author

t0yv0 commented Apr 8, 2021

Thanks a ton for the review! I'm converging on shipping is for now as other methods don't have detailed Options yet either. @komalali ready for final review.

@vipentti
Copy link
Contributor

vipentti commented Apr 9, 2021

Consider adding the methods to WorkspaceStack so you can do stack.ExportAsync and stack.ImportAsync to match the nodejs api and for convenience when working with a specific stack. E.g. instead of having to do stack.Workspace.ExportStackAsync(stack.Name).

Something like:

/// <summary>
/// Exports the deployment state of the stack.
/// <para/>
/// This can be combined with ImportStackAsync to edit a
/// stack's state (such as recovery from failed deployments).
/// </summary>
public Task<StackDeployment> ExportStackAsync(CancellationToken cancellationToken = default)
    => this.Workspace.ExportStackAsync(this.Name, cancellationToken);

/// <summary>
/// Imports the specified deployment state into a pre-existing stack.
/// <para/>
/// This can be combined with ExportStackAsync to edit a
/// stack's state (such as recovery from failed deployments).
/// </summary>
public Task ImportStackAsync(StackDeployment state, CancellationToken cancellationToken = default)
    => this.Workspace.ImportStackAsync(this.Name, state, cancellationToken);

@t0yv0
Copy link
Member Author

t0yv0 commented Apr 12, 2021

@komalali this should be good to review one last time (need a :stamp) and I can merge.

CHANGELOG_PENDING.md Outdated Show resolved Hide resolved
Co-authored-by: Komal <komal@pulumi.com>
@t0yv0 t0yv0 merged commit 737cffc into master Apr 12, 2021
@pulumi-bot pulumi-bot deleted the t0yv0/dotnet-automation-api-stack-export-import branch April 12, 2021 21:41
abhinav pushed a commit to pulumi/pulumi-dotnet that referenced this pull request Jan 11, 2023
…ulumi#6728)

* Initial impl of import/export

* Add test

* Address PR comments

* Do not Select stack but pass it as --stack

* Add CHANGELOG entry

* Update sdk/dotnet/Pulumi.Automation/LocalWorkspace.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/LocalWorkspace.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Add helper methods to match node SDK

* Match project settings

* Update CHANGELOG_PENDING.md

Co-authored-by: Komal <komal@pulumi.com>

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Co-authored-by: Komal <komal@pulumi.com>
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

4 participants