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

Wrong type for Config in ProjectSettingsModel #366

Open
rosieks opened this issue Oct 25, 2024 · 3 comments
Open

Wrong type for Config in ProjectSettingsModel #366

rosieks opened this issue Oct 25, 2024 · 3 comments
Labels
area/automation-api kind/bug Some behavior is incorrect or out of spec

Comments

@rosieks
Copy link

rosieks commented Oct 25, 2024

What happened?

There is wrong property type for Config in ProjectSettingsModel. Right now it's string while specfication assumets it's map.
That cause than when I try to use LocalWorkspace automation it crash on deserialization.

(Line: 5, Col: 3, Idx: 82) - (Line: 5, Col: 3, Idx: 82): Exception during deserialization

Example

Code that crashes:

var args = new LocalProgramArgs($"new-stack", pathToProject);
var stack = await LocalWorkspace.CreateOrSelectStackAsync(args);

Configuration Pulumi.yaml:

name: MyProject
runtime: dotnet
description: Persistence
config: 
  pulumi-disable-default-providers:
  - kubernetes
  some-setting: dev

Output of pulumi about

I'm using NuGet package Pulumi.Automation Version="3.67.1"

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@rosieks rosieks added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 25, 2024
@justinvp justinvp added area/automation-api and removed needs-triage Needs attention from the triage team labels Nov 1, 2024
@justinvp
Copy link
Member

justinvp commented Nov 1, 2024

Thanks for opening the issue @rosieks. It looks like there's a similar issue with the Node.js and Python Automation API SDKs.

These SDKs should look more like the Go SDK:

type Project struct {
	// ...
	Config map[string]ProjectConfigType `json:"config,omitempty" yaml:"config,omitempty"`
	// ...
}
type ProjectConfigItemsType struct {
	Type  string                  `json:"type,omitempty" yaml:"type,omitempty"`
	Items *ProjectConfigItemsType `json:"items,omitempty" yaml:"items,omitempty"`
}

type ProjectConfigType struct {
	Type        *string                 `json:"type,omitempty" yaml:"type,omitempty"`
	Description string                  `json:"description,omitempty" yaml:"description,omitempty"`
	Items       *ProjectConfigItemsType `json:"items,omitempty" yaml:"items,omitempty"`
	Default     interface{}             `json:"default,omitempty" yaml:"default,omitempty"`
	Value       interface{}             `json:"value,omitempty" yaml:"value,omitempty"`
	Secret      bool                    `json:"secret,omitempty" yaml:"secret,omitempty"`
}

@rosieks
Copy link
Author

rosieks commented Dec 20, 2024

@justinvp Any info when that might be fixed or how to workaround that? It's kind of blocking issue

@rosieks
Copy link
Author

rosieks commented Dec 23, 2024

Just to add. I think similar issue is with StackSettings as there might be only string provided and there is no way to set complex object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation-api kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants