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

UpdateEnvironmentWithRevision does not return diagnostics properly #370

Open
IaroslavTitov opened this issue Aug 13, 2024 · 0 comments
Open
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@IaroslavTitov
Copy link
Contributor

What happened?

Method UpdateEnvironmentWithRevision does not return diagnostics properly. Instead, empty array is returned and err is returned, filled with diagnostics in the error text.

Example

Call like this:

diagnostics, revision, err := st.client.UpdateEnvironmentWithRevision(context.Background(), input.OrgName, input.EnvName, input.Yaml, "")
	if diagnostics != nil {
		return nil, fmt.Errorf("failed to update environment, yaml code failed following checks: %+v", diagnostics)
	}
	if err != nil {
		return nil, fmt.Errorf("failed to update environment due to error: %+v", err)
	}

Diagnostics check is skipped, because it's empty array, then second if is hit. The error returned is
failed to update environment due to error: [0] Diags: string must match the pattern "^[a-zA-Z0-9-_.]{1,100}\\/[a-zA-Z0-9-_.]{1,100}$"

Which shows that diags are present, just not parsed and returned correctly.

Output of pulumi about

Not relevant

Additional context

Found this in Pulumi Service Provider

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).

@IaroslavTitov IaroslavTitov added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 13, 2024
@cleverguy25 cleverguy25 removed the needs-triage Needs attention from the triage team label Aug 14, 2024
@cleverguy25 cleverguy25 added this to the 0.110 milestone Aug 14, 2024
IaroslavTitov added a commit to pulumi/pulumi-pulumiservice that referenced this issue Aug 14, 2024
### Summary:
- Add validation on Environment resource's values, blocking values using
/
- Improve error messages of Environment resource
- Moved diags check above error, as it should precede (even though diags
don't work currently, see
[bug](pulumi/esc#370))

### Testing
- Manually
- Integ tests
@komalali komalali modified the milestones: 0.110, 0.111 Sep 30, 2024
@komalali komalali modified the milestones: 0.111, 0.112 Oct 24, 2024
@komalali komalali modified the milestones: 0.112, 0.114 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants