# Description
We have some tests that ensure that types for pulumi/pulumi are
compatible with the latest shipped version. However test failures do not
result in CI failures.
https://github.com/pulumi/pulumi/actions/runs/8153744675/job/22285983384#step:38:353
The current tests include a test using typescript 3.7.3 which does not
pass. I upgraded this to match 3.8.3, which is what we use for
pulumi/pulumi.
I believe the yarn.lock in the tests was committed by accident.
Fixes https://github.com/pulumi/pulumi/issues/15574
## Checklist
- [ ] I have run `make tidy` to update any new dependencies
- [ ] I have run `make lint` to verify my code passes the lint check
- [ ] 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. -->
# Description
Make `pulumi install` detect npm and yarn workspaces setups and
successfully install dependencies.
Fixes#15435
## 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`
These tests are pretty close to hitting the timeout during regular runs
(e.g. one successful run I picked randomly took ~194000ms). The GitHub
action runners don't have super reliable performance, so we can easily
get pushed over this limit.
To make matters worse here, if we hit this timeout just at the right
time, the test doesn't exit cleanly (potentially related to
https://github.com/pulumi/pulumi-dotnet/issues/134), as I've seen a
`pulumi preview` process stick around in that case, preventing the tests
from shutting down). This means we have to wait until the CI job times
out after an hour until the failure is reported.
I'm not sure if we only got close to this timeout recently, or if this
is a longer standing issue, but it reproduces well for me locally.
Ideally of course the tests would be faster, but this is still "only"
~5min which is much faster than other tests, and should hopefully reduce
the amount of times we need to go through the merge queue, saving a lot
of time there.
Fixes https://github.com/pulumi/pulumi/issues/14842
## Checklist
- [ ] I have run `make tidy` to update any new dependencies
- [ ] I have run `make lint` to verify my code passes the lint check
- [ ] 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. -->
When we introduced Rome into the Node SDK, we added a Make rule
for formatting separate from our linting rule. This commit moves
format-checking into the lint rule so that the Node SDK's Make rules
will more closely match the Python SDK's Make rules.
Now, in both SDKs, `make lint` also checks formatting.
This commit adds the Rome autoformatter to the Node SDK toolchain.
It adds rules to the Makefile to validate formatting in CI, and to
autoformat. Lastly, it updates CI to ensure each commit correctly formats
the code.
* allow to override makefile variables
When packaging pulumi-python for www.nixos.org, there is no /bin/bash
available so allow for an alternative path to the shell.
Same for versions, PYPI version can be set via the environment variable
PULUMI_VERSION.
* Update sdk/nodejs/Makefile
Co-authored-by: Fraser Waters <frassle@gmail.com>
* Update sdk/go/Makefile
Co-authored-by: Fraser Waters <frassle@gmail.com>
Co-authored-by: Fraser Waters <frassle@gmail.com>
On first run of the makefile here, if a user doesn't have `eslint` or
`typescript` globally installed, `yarn run` won't succeed. If they do
have those dependencies globally, it'll use their locally installed
version, which is not the desired behavior.
This ensures `yarn` is run once before `lint` and `build_package`
targets, and since `build_package` is a dependency for all future
targets that use `yarn run` it covers the remainder of the cases.
* Add coverage folder
* Adjust GHA to run Test target on Windows
* Extend error message on packages not found
* Try with path normalizer
* Edit Makefiles
* Skip SDK codegen tests on Windows
* Skip program gen tests on Windows
* Skip tests that started running on Windows and failing
* Fix non-compiling test
* Skip failing Windows HCL2 tests
* Fix lint
* Merged constants
* Skip one more test failing on Windows
* Disable cov-enabled builds on Windows
* Fix TestDeterminePulumiPackages on Windows
* Fix TestInstallCleansOldFiles test on Windows
* Fix TestCreatingProjectWithPulumiBackendURL on Windows
* Weaken TestAbbreviateFilePath to pass on Windows
* Fix TestDepRootCalc on Windows
* Fix LocalUrl() to be sensible on Windows
* Fix Go lint issue
* Windows fix for TestComments
* Cross-ref skip tracking issue
* Cross-ref issue to fix asset_test skips
* More cross-ref issues
* Use choco not chocolatey
* Use yarn run to ensure the right tools are selected
* Revert python3->python change in common.mk
* In CI context, use python not python3
* More randomness in temp folder names to aoid Windows collisions
* Go lint
These changes add support for gathering code coverage data during tests.
For tests that do not involve the Pulumi CLI, this is straightforward: all of
the ecosystems we target already support gathering coverage data, and we follow
the rules accordingly. Support for each language is broken out into its own
commit.
For tests that do involve the Pulumi CLI, the picture is a bit more complicated.
Go does not make it trivial to perform a coverage-instrumented build (go build
does not have a -cover flag, for example). In lieu of official support, we abuse
go test -c and TestMain to produce a build of the CLI that supports collecting
and reporting coverage data.
* Experiment with gotestsum and test timings
* Fix to locating the helper script
* Fix the code for installing gotestsum
* Try alternative installation method
* Use go to compute test stats; Python fails parsing time values
* Try version without v
* Try with fixed gorelaser config
* Fix test time correlation
* Try a stable test stat sort finally
* Use more accurate test duration aggregation
* Include python and auto-api tests in the Go timing counts
* Bring back TESTPARALLELISM
* Fix test compilation
* Only top 100 slow tests
* Try to fracture build matrix to fan out tests
* Do not run Publish Test Results on unsuppored Mac
* Auto-create test-results-dir
* Fix new flaky test by polling for logs
* Try to move native tests to their own config
* Actually skip
* Do not fail on empty test-results folder
* Try again
* Try once more
* Integration test config is the crit path - make it smaller
* Squash underutilized test configurations
* Remove the test result summary box from PR - counts now incorrec
* Remove debugging step
Fixes:#6565
As part of #6460, the logic for determing the version of the build was
moved to be a dependency on pulumictl.
Unfortunately, the homebrew installs use the "make dist" command to
build + install Pulumi to the user maching and as that would have a
dependency on pulumictl and it not existing on the user machine, it
would pass an empty version to the ldflag
This then manifested to the user as:
```
▶ pulumi version
warning: A new version of Pulumi is available. To upgrade from version '0.0.0' to '2.22.0', run
$ brew upgrade pulumi
or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes.
```
We are able to mitigate this behaviour by bringing back the get-version
script and using that script as part of the make brew installation
We can see that the versions are the same between the 2 different
installation techniques
```
make dist <------- uses pulumict
DIST:
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=2.24.0-alpha.1616029310+787eb70a" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet
DIST:
BUILD:
```
```
make brew <----- uses the legacy script
▶ make brew
BREW:
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=v2.24.0-alpha.1616029310+g787eb70a2" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet
BREW:
```
A full post mortem will be carried out to ensure we mitigate these
types of errors going forward and that we are able to better test
these types of situations
* Make `async:true` the default for `invoke` calls (#3750)
* Switch away from native grpc impl. (#3728)
* Remove usage of the 'deasync' library from @pulumi/pulumi. (#3752)
* Only retry as long as we get unavailable back. Anything else continues. (#3769)
* Handle all errors for now. (#3781)
* Do not assume --yes was present when using pulumi in non-interactive mode (#3793)
* Upgrade all paths for sdk and pkg to v2
* Backport C# invoke classes and other recent gen changes (#4288)
Adjust C# generation
* Replace IDeployment with a sealed class (#4318)
Replace IDeployment with a sealed class
* .NET: default to args subtype rather than Args.Empty (#4320)
* Adding system namespace for Dotnet code gen
This is required for using Obsolute attributes for deprecations
```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```
* Fix the nullability of config type properties in C# codegen (#4379)
Pulumi HCL2 IR:
- Add support for invokes
- Add support for resource options, incl. ranged resources
- Allow the apply rewriter to ignore promise-typed values
- Add tests for the binder
- Add support functions for TF: entries and range
NodeJS codegen:
- Simplify for expression codegen
- Add support for invoke codegen
- Add support for entries and range functions
- Add tests
Python codegen:
- Implement codegen for most expression types
- Add support for invoke codegen
- Add tests