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

[pcl] Do not panic when the type of PCL local variable isn't known #12670

Merged
merged 1 commit into from Apr 14, 2023

Conversation

Zaid-Ajaj
Copy link
Contributor

Another small fix for PCL binding so that we don't panic when the type of a local variable isn't known.

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

@Zaid-Ajaj Zaid-Ajaj requested a review from Frassle April 13, 2023 18:17
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2023-04-13)

Miscellaneous

  • [programgen] Do not panic when the type of PCL local variable isn't known
    #12670

Copy link
Member

@Frassle Frassle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, the nil checks a bit odd though

@@ -36,6 +36,9 @@ func (lv *LocalVariable) SyntaxNode() hclsyntax.Node {
}

func (lv *LocalVariable) Traverse(traverser hcl.Traverser) (model.Traversable, hcl.Diagnostics) {
if lv == nil || lv.Type() == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can lv itself be nil here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure tbh, though I don't think so 🤔

@Zaid-Ajaj
Copy link
Contributor Author

bors merge

bors bot added a commit that referenced this pull request Apr 14, 2023
12670: [pcl] Do not panic when the type of PCL local variable isn't known r=Zaid-Ajaj a=Zaid-Ajaj

Another small fix for PCL binding so that we don't panic when the type of a local variable isn't known. 

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


12674: Improve plugin install help text r=Zaid-Ajaj a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

`@EvanBoyle` commented that it wasn't that clear that VERSION was optional in this command.

```
Install one or more plugins.

This command is used manually install plugins required by your program. It may
be run either with a specific KIND, NAME, and optionally VERSION, or by omitting
these and letting Pulumi compute the set of plugins that may be required by the
current project. If specified VERSION cannot be a range: it must be a specific
number. If not specified pulumi will try to look up the latest version of the
plugin, this is not always possible.

If you let Pulumi compute the set to download, it is conservative and may end up
downloading more plugins than is strictly necessary.

Usage:
  pulumi plugin install [KIND NAME [VERSION]] [flags]
```


Co-authored-by: Zaid Ajaj <zaid.naom@gmail.com>
Co-authored-by: Fraser Waters <fraser@pulumi.com>
@bors
Copy link
Contributor

bors bot commented Apr 14, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Apr 14, 2023
12670: [pcl] Do not panic when the type of PCL local variable isn't known r=Zaid-Ajaj a=Zaid-Ajaj

Another small fix for PCL binding so that we don't panic when the type of a local variable isn't known. 

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Zaid Ajaj <zaid.naom@gmail.com>
@bors
Copy link
Contributor

bors bot commented Apr 14, 2023

Build failed:

@Zaid-Ajaj
Copy link
Contributor Author

bors retry

@bors
Copy link
Contributor

bors bot commented Apr 14, 2023

Build succeeded:

@bors bors bot merged commit e52a87e into master Apr 14, 2023
44 of 48 checks passed
@bors bors bot deleted the zaid/fix-local-variable-panic branch April 14, 2023 15:21
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

3 participants