Commit Graph

4 Commits

Author SHA1 Message Date
Mathias Lafeldt bbf5b0d421
Fix slice bounds out of range panic in fixupPath ()
I noticed that sst currently panics if an environment variable's name is
shorter than 5 characters. This fixes the root cause.

```
V=1 sst deploy --stage=dev 
SST ❍ ion 0.0.416  ready!

➜  App:        myapp
   Stage:      dev

~  Deploying

panic: runtime error: slice bounds out of range [:5] with length 3

goroutine 1 [running]:
github.com/pulumi/pulumi/sdk/v3/go/auto.fixupPath({0x140018ec408, 0xb1, 0x1400013dfc0?}, {0x1400013dfc0, 0x32})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/cmd.go:324 +0x270
github.com/pulumi/pulumi/sdk/v3/go/auto.pulumiCommand.Run({{0x3, 0x73, 0x2, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}}, {0x1400013dfc0, ...}}, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/cmd.go:273 +0x394
github.com/pulumi/pulumi/sdk/v3/go/auto.(*LocalWorkspace).runPulumiInputCmdSync(0x14001494000, {0x106fb2b28, 0x1400061c0f0}, {0x0, 0x0}, {0x14000aeba00, 0x4, 0x4})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/local_workspace.go:776 +0x1f4
github.com/pulumi/pulumi/sdk/v3/go/auto.(*LocalWorkspace).runPulumiCmdSync(...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/local_workspace.go:790
github.com/pulumi/pulumi/sdk/v3/go/auto.(*LocalWorkspace).SelectStack(0x14001494000, {0x106fb2b28, 0x1400061c0f0}, {0x16b392623, 0x3})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/local_workspace.go:568 +0x160
github.com/pulumi/pulumi/sdk/v3/go/auto.SelectStack({0x106fb2b28?, 0x1400061c0f0?}, {0x16b392623, 0x3}, {0x106fcd6e0, 0x14001494000})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/stack.go:179 +0x5c
github.com/pulumi/pulumi/sdk/v3/go/auto.UpsertStack({0x106fb2b28, 0x1400061c0f0}, {0x16b392623, 0x3}, {0x106fcd6e0, 0x14001494000})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/stack.go:191 +0x34
github.com/sst/ion/pkg/project.(*stack).Run(0x14000a42058, {0x106fb2b28, 0x1400061c0f0}, 0x140000bbcc0)
        /home/runner/work/ion/ion/pkg/project/stack.go:283 +0x1cf4
main.init.func3(0x14000064550)
        /home/runner/work/ion/ion/cmd/sst/main.go:458 +0x2c8
main.run()
        /home/runner/work/ion/ion/cmd/sst/main.go:160 +0x6cc
main.main()
        /home/runner/work/ion/ion/cmd/sst/main.go:52 +0x12c
```
2024-07-08 09:10:58 +00:00
Julien P 1672ba246f
Use the full path when running pulumi from a custom CLI install ()
# Description

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

Fixes https://github.com/pulumi/pulumi/issues/15796

Turns out nodejs already uses the [full command
name](bc4a9ad59b/sdk/nodejs/automation/cmd.ts (L176)).

Fixed for python and go.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] 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. -->
2024-03-27 21:12:00 +00:00
Justin Van Patten b8fcb771ef
[sdk/go] Use `filepath.Join` rather than `path.Join` ()
We're seeing Go Automation API test failures on Windows. Looks like it's
likely due to the use of `path.Join` (introduced in
https://github.com/pulumi/pulumi/pull/15049 which merged about an hour
ago; it's a separate question on how it was able to merge with failures
on Windows). This PR changes those uses of `path` to `filepath`.

Note: No changelog because this hasn't been released yet.

This is currently blocking merges.

Fixes 
2024-01-27 01:25:23 +00:00
Julien P 50800995b0
[auto/go] Add new API to install the Pulumi CLI ()
# Description

Provide a way for the Automation API to install the Pulumi CLI so that
Automation API can be used in a more standalone manner.

https://github.com/pulumi/pulumi/issues/14987

⚠️ Needs https://github.com/pulumi/get.pulumi.com/pull/171 to be merged
and deployed to production first.

Fixes # (issue)

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- 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.
-->
- [ ] 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. -->
2024-01-26 16:01:17 +00:00