-
Notifications
You must be signed in to change notification settings - Fork 25
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 conformance for rootDirectory pcl function #466
base: main
Are you sure you want to change the base?
Conversation
8d0797e
to
70227ac
Compare
e758114
to
96e3aa7
Compare
a54d28f
to
12f56a3
Compare
11c9fda
to
c9e0260
Compare
d9c4a33
to
fd16e43
Compare
c9e0260
to
0b45515
Compare
This should be good once blocking PR is done |
0b45515
to
ec84337
Compare
blocking PR is approved, just running tests so this should be good to review |
Update `pulumi` submodule to the v3.153.0 tag. This brings in two new conformance tests. - `l1-builtin-project-root` support is being added in #466 - `l2-component-property-deps` is blocked on .NET programgen support for `Call` (and #488) Somewhat suspicious that a couple generated SDKs changed (I ran the conformance tests with `PULUMI_ACCEPT=true`). Are we not snapshot comparing those?
ec84337
to
cc541d6
Compare
sdk/Pulumi/Deployment/Deployment.cs
Outdated
|
||
/// <summary> | ||
/// The current running deployment instance. This is only available from inside the function | ||
/// passed to <see cref="Deployment.RunAsync(Action)"/> (or its overloads). | ||
/// </summary> | ||
public static DeploymentInstance Instance | ||
{ | ||
get => _instance.Value ?? throw new InvalidOperationException("Trying to acquire Deployment.Instance before 'Run' was called."); | ||
get => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't reformat whitespace everywhere, just makes the diff noisy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that shoudl be better, wasn't aware I had a strict formatter turned on
I also added a cache clear before testing to purge any old versions with the same version number if present, as well as some docs describing this issue which cost me an hour. Part of #18565 Blocked by #18595 Changes required to get project root in dotnet and have conformance tests pass.
cc541d6
to
a8cf4fa
Compare
sdk/Pulumi/Deployment/Deployment.cs
Outdated
@@ -119,6 +121,7 @@ private Deployment(RunnerOptions? runnerOptions = null) | |||
if (string.IsNullOrEmpty(monitor) || | |||
string.IsNullOrEmpty(engine) || | |||
string.IsNullOrEmpty(project) || | |||
string.IsNullOrEmpty(rootDirectory) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't add this here. If someone uses a new SDK with the old language host it will error out on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okidoki
@@ -17,6 +17,7 @@ private Deployment(IDeploymentBuilder builder, InlineDeploymentSettings settings | |||
|
|||
_organizationName = settings.Organization ?? "organization"; | |||
_projectName = settings.Project; | |||
_rootDirectory = "rootDirectory"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably make root directory nulllable. Both running against the old engine, and running inline programs won't have a root directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sdk/Pulumi/Deployment/Deployment.cs
Outdated
@@ -160,6 +163,7 @@ internal Deployment(IEngine engine, IMonitor monitor, TestOptions? options) | |||
_isDryRun = options?.IsPreview ?? true; | |||
_stackName = options?.StackName ?? "stack"; | |||
_projectName = options?.ProjectName ?? "project"; | |||
_rootDirectory = options?.RootDirectory ?? "rootDirectory"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this should default to anything? Like null is easier to match against than "rootDirectory'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose so, the others aren't nullable but it kinda makes me think they should be as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the others always get set except org and "organisation" was I suppose a half sensible default choice for that, although in hindsight maybe that should have been nullable or throwing as well for old engines.
I think this probably could be set for inline programs as well (the autoapi does make a temp folder for them to run in). So it's just what to do for old engines, which I think has three choices:
- Be nullable, return null for old engines
- Don't be nullable and throw a runtime exception if running against an old engine. We do this for other things like transforms
- Don't be nullable and have a default value, but I'm not sure anything makes sense for that.
So actually thinking about it (and sorry to go back and forth on you like this) but maybe we should do option 2. Make the user API non-nullable, but internally track if it's actually set by the engine or not and if the user tries to access it throw an exception like we do if they try and register a stack transform and it isn't supported: throw new Exception("The Pulumi CLI does not support root directory. Please update the Pulumi CLI.");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this is done now
046af8d
to
c77d2d7
Compare
c0fecc7
to
2d10121
Compare
Co-authored-by: Fraser Waters <[email protected]>
38a47e3
to
89e5d82
Compare
Add conformance for projectRoot pcl function
Part of pulumi/pulumi#18565
Blocked by pulumi/pulumi#18595
Changes required to get project root in dotnet and have conformance
tests pass.