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 --show-reads Support to .NET PreviewOptions and UpOptions #542

Merged
merged 7 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Improvements-542.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component: sdk/auto
kind: Improvements
body: Add --show-reads Support for Pulumi Up & Preview
time: 2025-03-13T11:33:14.4527021Z
custom:
PR: "542"
5 changes: 5 additions & 0 deletions sdk/Pulumi.Automation/PreviewOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ public sealed class PreviewOptions : UpdateOptions
/// Refresh the state of the stack's resources before this preview.
/// </summary>
public bool? Refresh { get; set; }

/// <summary>
/// Show resources that are being read in, alongside those being managed directly in the stack.
/// </summary>
public bool? ShowReads { get; set; }
}
}
10 changes: 10 additions & 0 deletions sdk/Pulumi.Automation/Pulumi.Automation.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions sdk/Pulumi.Automation/UpOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ public sealed class UpOptions : UpdateOptions
/// Refresh the state of the stack's resources before this update.
/// </summary>
public bool? Refresh { get; set; }

/// <summary>
/// Show resources that are being read in, alongside those being managed directly in the stack.
/// </summary>
public bool? ShowReads { get; set; }
}
}
12 changes: 12 additions & 0 deletions sdk/Pulumi.Automation/WorkspaceStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ public async Task<UpResult> UpAsync(
if (options.ExpectNoChanges is true)
args.Add("--expect-no-changes");

if (options.ShowReads.HasValue)
{
var showReads = options.ShowReads.Value ? "true" : "false";
args.Add($"--show-reads={showReads}");
}

if (options.Diff is true)
args.Add("--diff");

Expand Down Expand Up @@ -447,6 +453,12 @@ public async Task<PreviewResult> PreviewAsync(
if (options.ExpectNoChanges is true)
args.Add("--expect-no-changes");

if (options.ShowReads.HasValue)
{
var showReads = options.ShowReads.Value ? "true" : "false";
args.Add($"--show-reads={showReads}");
}

if (options.Diff is true)
args.Add("--diff");

Expand Down
Loading