Commit Graph

318 Commits

Author SHA1 Message Date
Fraser Waters 571ccc6de4
Update dotnet language host () 2024-04-16 15:07:33 +00:00
Fraser Waters 959fc6c8b4
Run integration tests with race detection ()
<!--- 
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. -->
Combining  and  and including fixes to allow tests to pass.

Enable race detection in the binary we're using for integration tests.
This will allow us to catch more data races before they get into any
release. This does mean the binary we're using for integration tests is
slightly different from the binary we're releasing, however that's
already the case as we're running a binary with coverage enabled for
them. Later we rebuild the binary we're actually releasing.

This requires us to fix the race between snapshot code, display code,
and the step executor. I've done that by adding a lock to the State
struct. This does not feel great, but it's a quick way to fix this and
get race detection running (and unblocks  which was also hitting
the race detector because it started pulling snapshot code into unit
tests as well). There's probably a more principled overhaul that doesn't
require locking at this level.

## 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-04-11 15:58:42 +00:00
Julien P fa2a196c27
Vendor TypeScript and ts-node ()
<!--- 
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

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

Historically these packages were direct dependencies of
`@pulumi/pulumi`. To decouple the node SDK from the precise version of
TypeScript, the packages are now declared as optional peer pependencies
of `@pulumi/pulumi` and customers can pick the versions they want.

The reason we mark the peer dependencies as *optional* is to prevent
package managers from automatically installing them. This avoids the
situation where the package manger would install a more recent version
of TypeScript without the user explictly opting in. Newer versions have
stricter type checks, and can thus stop existing programs from running
successfully.

When the peer dependencies are not present, we load the vendored
versions of the modules.

## 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. -->
2024-04-10 15:26:37 +00:00
Thomas Gummerer 1395f54b51
Revert "Revert "Disable `--rerun-fails` in tests"" ()
Reverts  to disable the `--rerun-fails` option again.
We've done quite a bit of work for flaky tests (there's only some rare
cases left after https://github.com/pulumi/pulumi/pull/15642 gets
merged), so we should be able to disable this option again now, and have
it as a forcing function to keep tests non-flaky.
2024-03-26 16:26:21 +00:00
Julien P e3d0decccc
Reorganize closure tests to prepare for multiple typescript versions ()
# Description

In preparation of https://github.com/pulumi/pulumi/issues/15735 we make
the closure tests proper integration tests so that we can run them with
different typescript versions. Move each test to its own folder instead
of one large file.

This PR only changes tests, and does not touch any of the function
serialisation code.

Some snapshots had to be updated for indentation changes.

Hidden after all the test cases is the test script
[sdk/nodejs/tests/runtime/testdata/closure-tests/test.ts](dfcc953c08/sdk/nodejs/tests/runtime/testdata/closure-tests/test.ts)

Verified that tests run in CI
https://github.com/pulumi/pulumi/actions/runs/8389170587/job/22975068167?pr=15753

## 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-25 13:19:17 +00:00
Fraser Waters a47df9c27c
Fix version scripts ()
<!--- 
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. -->

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

Fix the set-version script to also set the .ts file with the version
correctly.

Fix reversion to replace the currently expected hardcoded version with
the given dynamic version.

## 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. -->
2024-03-22 14:31:57 +00:00
Fraser Waters 3043adeeb3
Add SupportPack to schemas to write out in the new style ()
<!--- 
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. -->


This adds a new flag to the schema metadata to tell codegen to use the
new proposed style of SDKs where we fill in versions and write go.mods
etc.

I've reworked pack to operate on packages assuming they're in this new
style. That is pack no longer has the responsibility to fill in any
version information.

This updates python and node codegen to write out SDKs in this new
style, and fixes their core libraries to still be buildable via pack.
There are two approaches to fixing those, I've chosen option 1 below but
could pretty easily rework for option 2.

1) Write the version information directly to the SDKs at the same time
as we edit the .version file. To simplify this I've added a new
'set-version.py' script that takes a version string an writes it to all
the relevant places (.version, package.json, etc).

2) Write "pack" in the language host to search up the directory tree for
the ".version" file and then fill in the version information as we we're
doing before with envvar tricks and copying and editing package.json.

I think 1 is simpler long term, but does force some amount of cleanup in
unrelated bits of the system right now (release makefiles need a small
edit). 2 is much more localised but keeps this complexity that
sdk/nodejs sdk/python aren't actually valid source modules.

## 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.
-->
- [ ] 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-22 09:25:46 +00:00
Thomas Gummerer db8e097302
add some more debug output to CI script ()
Add some more debug output to maybe help us identify what's happening in
https://github.com/pulumi/pulumi/issues/15274.

I don't get why the output in
https://github.com/pulumi/pulumi/actions/runs/7672650761/job/20913866181#step:38:1
suddenly just stops, so adding some debug output here to see if that
helps track/narrow things down.
2024-03-18 07:56:50 +00:00
Fraser Waters b34f77e74a
Update dotnet language host to 3.60 () 2024-03-06 21:16:47 +00:00
Thomas Gummerer cf9562c6ae
Publish dev versions of the python and node SDKs ()
Publish dev versions of the python and node SDKs, so we can consume them
pre-release and make our releases more stable.

Also clean up the publish_npm.sh script a little bit, removing now
unused cruft.
2024-02-15 16:25:57 +00:00
Fraser Waters 2ccbef65e4
Update tests to run on Go 1.21 and 1.22 ()
Go 1.22 has been released https://tip.golang.org/doc/go1.22.
2024-02-15 09:33:30 +00:00
Justin Van Patten 968234392d
ci: Bump Node.js versions ()
v18.x is the LTS Maintenance release and v21.x is the Current release.
https://nodejs.org/en/about/previous-releases
2024-01-30 14:53:05 +00:00
Justin Van Patten 7309681b5b
Support Python 3.12 ()
Python 3.12 requires `grpcio` 1.59.0 or higher. Unfortunately, there is
a regression in `grpcio` 1.58.0 through the latest version (currently
1.60.0) which causes any error returned from a Python gRPC server to be
written to stderr, including UNIMPLEMENTED errors. This primarily
affects Python dynamic providers, which don't have implementations for
`CheckConfig` and `DiffConfig`, resulting in a traceback error being
emitted to stderr when the engine calls these, which is visible to
users. This `grpcio` regression has been fixed upstream, but the fix has
not been released yet. We've been waiting for a 1.60.1 patch release.

This has not been great for our Python users who are using Python 3.12.
It's particularly bad for new Pulumi users who are using Python 3.12 and
are trying to get started with Pulumi. For these users, when trying to
install the `pulumi` PyPi package (i.e. via `pulumi new python`) the
installation fails with an error because it is pinned to depending on an
older version of `grpcio` which doesn't work on Python 3.12.

This commit works around the problem by providing default
implementations of `CheckConfig` and `DiffConfig` for python dynamic
providers and the component provider API, so that no error is emitted to
stderr when the engine calls these methods. The default implementations
for these are the same behavior that the engine would use if these
methods had returned UNIMPLEMENTED. I believe these are the only two
methods affected by this. Other methods like `Invoke`, `Call`,
`StreamInvoke`, `Construct`, `Attach`, `GetMapping`, and `GetMappings`,
continue to return UNIMPLEMENTED for dynamic providers, which I think is
OK; I don't believe these will be called by the engine under normal
circumstances.

Out of an abundance of caution, the `pulumi` package continues to depend
on the pinned version of `grpcio` when installing on versions of Python
less than 3.12. On Python 3.12 or greater, we now depend on `grpcio`
`~=1.60.0`. 1.60.0 doesn't have the fix for the regression, but the
workaround should allow things to work on Python 3.12 as before.

Once 1.60.1 is released, we can look into updating the `grpcio`
dependency to `~=1.60.1` for all versions of Python, and possibly revert
the workarounds, if we want.

Note:  added a test for dynamic providers to ensure nothing is
written to stderr. The test would fail if the workaround in this PR did
not work as intended:
https://github.com/pulumi/pulumi/pull/14474/files#diff-d92ccd283e08eadab2597825103e45cdaa96fea93324bc4d4d3b1d2b83c51b76

This PR depends on several other smaller PRs:
- https://github.com/pulumi/pulumi/pull/15220
- https://github.com/pulumi/pulumi/pull/15221
- https://github.com/pulumi/pulumi/pull/15222
- https://github.com/pulumi/pulumi/pull/15223
- https://github.com/pulumi/pulumi/pull/15224
- https://github.com/pulumi/pulumi/pull/15225
- https://github.com/pulumi/pulumi/pull/15226

Fixes 
2024-01-24 22:24:34 +00:00
Thomas Gummerer 1421e4e65b
Revert "Disable `--rerun-fails` in tests" ()
Reverts . Unfortunately there seem to be too many
flakes left that we should address before doing this.
2024-01-24 18:13:21 +00:00
Justin Van Patten f756b83119
Disable `--rerun-fails` in tests ()
When `--rerun-fails` is specified and a test is re-run, the produced
coverage data only contains the coverage from the failed but re-executed
sub-tests. See https://github.com/gotestyourself/gotestsum/issues/274

This change sees how we fare with this disabled as we've recently done
some work to address test flakiness. We'll be relying on the much less
granular `./scripts/retry` for retries, which doesn't have the coverage
problem. The downside is it will re-run all the tests.
2024-01-23 17:52:10 +00:00
Julien P d52c0592ab
Delete obsolete release.sh script ()
# Description

This script is not used anymore for releases.
2024-01-18 14:40:07 +00:00
Thomas Gummerer 69ad9ae5bd
go-wrapper: fix script if PULUMI_TEST_COVERAGE_PATH is set ()
The intention if this environment variable is set, is that we want to
run in coverage mode. However in
6af5f0b39d that accidentally got lost. Fix
it.

I noticed this while looking at
https://github.com/pulumi/pulumi/pull/15120 and got confused what the
script is trying to do.
2024-01-10 19:08:31 +00:00
Justin Van Patten 234055bd76
Attempt to run Windows tests on small runners ()
In the past we've run into consistent timeouts running on smaller
Windows runners, but let's see how we currently fare.
2024-01-05 21:44:04 +00:00
Justin Van Patten c22ed38647
Temporarily disable large Windows runners ()
We're seeing a significant increase in costs with our use of large
Windows runners. Temporarily disable Windows runners while we root
cause.
2024-01-05 07:03:11 +00:00
Kyle Dixler 98805465b2
[ci] improve test logging on retries ()
CI added log output to clarify success despite test failure output.
- `run tests` may end with a failing test being the last thing printed,
but it was retried and passed.
2023-12-01 23:05:04 +00:00
Thomas Gummerer 13371f9865
Start policy packs in parallel ()
Currently we start up and thus compile policy packs one by one. When
multiple policy packs need to be loaded, this increases the start up
time substantially. In previous tests plugins took ~1-3s to start up, so
having multiple of these the time adds up quickly.

Loading them in parallel will help reduce the startup time here.

Fixes 

## 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. -->
2023-11-20 14:08:32 +00:00
Anton Tayanovskyy ba039c20f8
Support returning plain values from methods ()
Support returning plain values from methods.

Implements Node, Python and Go support.

Remaining:

- [x] test receiving unknowns
- [x] acceptance tests written and passing locally for Node, Python, Go
clients against a Go server
- [x] acceptance tests passing in CI
- [x] tickets filed for remaining languages
   - [x] https://github.com/pulumi/pulumi-yaml/issues/499
   - [x] https://github.com/pulumi/pulumi-java/issues/1193
   - [x] https://github.com/pulumi/pulumi-dotnet/issues/170 

Known limitations:

- this is technically a breaking change in case there is code out there
that already uses methods that return Plain: true

- struct-wrapping limitation: the provider for the component resource
needs to still wrap the plain-returning Method response with a 1-arg
struct; by convention the field is named "res", and this is how it
travels through the plumbing

- resources cannot return plain values yet

- the provider for the component resource cannot have unknown
configuration, if it does, the methods will not be called
- Per Luke https://github.com/pulumi/pulumi/issues/11520 this might not
be supported/realizable yet

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

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

## 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. -->
2023-11-18 06:02:06 +00:00
Justin Van Patten 3840f66073
Update test matrix to run on Python 3.8.x ()
In general, our test matrix runs on the minimum supported version and
latest version of each language runtime. Python 3.8.x is still a
supported version so try running the tests on 3.8.x.
2023-11-15 18:44:02 +00:00
Fraser Waters b17866bbe5
Update dotnet () 2023-11-15 16:09:15 +00:00
Fraser Waters 032292af68
Run dotnet tests on 8 ()
<!--- 
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. -->

.NET 8 is released, we should ensure tests run against that now.
2023-11-15 14:01:49 +00:00
Justin Van Patten c922c33862
Temporary changes to unblock v3.88.1 release ()
See individual commit descriptions for details.
2023-10-11 22:58:47 +00:00
Fraser Waters a1b52d6613
Make language-python it's own module ()
Fixes https://github.com/pulumi/pulumi/issues/13826.
    
This brings python inline with node and go as being it's own module and
running codegen via gRPC.

Also includes some improvements to the node and go codegen interfaces
from review.
2023-08-31 16:35:21 +00:00
Zaid Ajaj 0d15dc574c
[pkg] Update pulumi-yaml, pulumi-java and pulumi-dotnet ()
# Description

Update the following preparing for the CLI release
 - pulumi-yaml (v1.2.1 -> v1.2.2) 
 - pulumi-java (v0.9.0 -> v0.9.6)  
 - pulumi-dotnet (v3.54.0 -> v3.56.1)


## 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.
-->
- [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. -->
2023-08-24 22:15:53 +00:00
Justin Van Patten 2016359133
ci: Test with Go 1.20, 1.21 ()
Go 1.21 was recently released.
Switch to testing with Go 1.20 and 1.21.

Fixes 
2023-08-21 15:58:21 +00:00
Luke Hoban 46e2753d02
Require Go 1.20 for Go Programgen ()
We added program generation that assumes availability of generics as
part of https://github.com/pulumi/pulumi/pull/13149, but didn't bump the
version of Go required in the generated go.mod. Currently, Pulumi is
supported on the supported versions of Go, which includes Go 1.20 and
1.21, so here we bump the Go version to the minimum currently supported
version, which also supports all of the code we generate today.

I was curious how this was not already failing tests, and it appears
it's because we delete the `go.mod` file in our tests and recreate it
with `go mod init`. I am unclear why we do that, but it feels like we
should not, exactly to avoid this sort of problem in the future and to
test the actual code we generate.


8696695cdb/pkg/codegen/go/test.go (L25-L28)

Fixes .
2023-08-16 04:59:07 +00:00
Bryce Lampe 8696695cdb
ci: Remove linear history check ()
<!---
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

All commits will be squashed by default once we are using merge queues.
This
means there's no need for this linear-history check, since the queue
will
enforce linearity.

## 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. -->
2023-08-12 02:40:23 +00:00
Justin Van Patten 0a935f3e0f Fix `publish_npm.sh` script to handle `GITHUB_REF` without '/'
It looks like the intention of this script was to parse `GITHUB_REF`s in the form `refs/heads/<branch_name>` or `refs/tags/<tag_name>` per https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables, but we overwrite this envvar in the workflow:

53e205f08f/.github/workflows/release.yml (L54)

Which is passed along from here:

53e205f08f/.github/workflows/on-release.yml (L37)

Which is just the tag name.

Still unclear how this worked for previous releases, but the script errored with the latest release when `GITHUB_REF` was just `v3.74.0`.

This commit makes the script resilient to values of `GITHUB_REF` that don't have '/'.
2023-06-30 11:30:18 -07:00
Justin Van Patten 34fdcd3664 Revert "Temp changes to unblock the release"
This reverts commit 3a18c14586.
2023-06-30 10:00:27 -07:00
Justin Van Patten 3a18c14586 Temp changes to unblock the release
Publishing v3.74.0 to npm failed with `../../scripts/publish_npm.sh: line 13: my_array[2]: unbound variable`.

This commit temporarily changes the `publish_npm.sh` script to not have the unbound variable and comments out jobs in the release workflow that already succeeded, and adds a way to manually dispatch the release workflow to unblock the release. Will use that to re-run the release workflow.

Afterwords, we can revert and address the actual issue.
2023-06-30 07:42:06 -07:00
Abhinav Gupta 24895995f1
ci/build-binaries: Don't enable cgo for Darwin
Previously, it was necessary to enable cgo
and use the system's DNS resolver on macOS.
In Go 1.20, the `net` package was rewritten
to not use cgo at all,
so CGO_ENABLED no longer has any effect there.

In fact, ever since 389860058d,
this setting has been meaningless
because we've been building Darwin binaries
on Ubuntu machines (so cgo can't be enabled anyway).

This commit just deletes this now-unused block.
2023-06-29 14:53:05 -07:00
Abhinav Gupta 6af5f0b39d
ci: Track code coverage
**Overview**

This re-enables tracking of code coverage.
For Go, there are two kinds of coverage at play:
unit test and integration test coverage.

Unit tests follow the usual pattern of running
`go test -cover -coverprofile=whatever.cov`.

For integration tests, we use the new integration test profiling support
[added in Go 1.20](https://go.dev/testing/coverage/).
In short, the way it works is:

    # Build a coverage instrumented binary:
    go build -cover

    # Set GOCOVERDIR to a directory and run the integration tests
    # that will invoke this coverage-instrumented binary.
    GOCOVERDIR=$(pwd)/coverage
    go test ./tests

    # $GOCOVERDIR will now be filled with coverage data
    # from every invocation of the coverage-instrumented binary.
    # Combine it into a single coverage file:
    go tool covdata textfmt -i=$(GOCOVERDIR) -o=out.cov

    # The resulting file can be uploaded to codecov as-is.

The above replaces the prior, partially working hacks we had in place
to get coverage-instrumented binaries with `go test -c`
and hijacking the TestMain.

**Notable changes**

- TestMain hijacking is deleted from the Pulumi CLI.
  We no longer need this to build coverage-instrumented binaries.
- ProgramTest no longer tracks or passes PULUMI_TEST_COVERAGE_PATH
  because the Pulumi binary no longer accepts a test.coverprofile flag.
  This information is now in the GOCOVERDIR environment variable.
- We add an `enable-coverage` parameter to the `ci-build-binaries`
  workflow to mirror some of the other workflows.
  It will produce coverage-instrumented binaries if this is true.
  These binaries are then used by `ci-run-test` which will set
  `GOCOVERDIR` and merge the coverage results from it.
- Coverage configuration no longer counts tests, testdata,
  and Protobuf-generated code against coverage.
- go-wrapper.sh:
  Because we're no longer relying on the `go test -c` hack,
  this no longer excludes Windows and language providers
  from coverage tracking.
- go-test.py and go-wrapper.sh will include pulumi-language-go and
  pulumi-language-nodejs in covered packages.

*Other changes*

- go-test.py:
  Fixed a bug where `args` parameters added for coverage were ignored.

Note that this change DOES NOT track coverage for calls made to Pulumi
packages by plugins downloaded from external sources,
e.g. provider plugins. Arguably, that's out of scope of coverage
trackcing for the Pulumi repository.

Resolves , 
2023-06-28 13:30:13 -07:00
Justin Van Patten 14813a6412 Temporarily bump Windows runner size to unblock merging 2023-06-21 13:13:25 -07:00
Robbie McKinstry 0cf19786f6
CI: Node 14 => Node 16 2023-05-09 17:02:08 -04:00
Robbie McKinstry d9a80217fb
Bump NodeJS CI version. 2023-04-28 12:44:13 -04:00
Kyle Pitzen 470ddf4fb9 chore(ci): bumps python version in matrix to 3.11 2023-03-22 07:23:46 -07:00
Justin Van Patten 4e848531aa Unpin Node back to 19.x
Node v19.8.1 was just released with the upstream fix for the internal assert we were hitting. This change unpins us back to 19.x.
2023-03-15 10:52:05 -07:00
Justin Van Patten 0bc171825c Pin CI to Node 19.7.x to avoid hitting assert in 19.8.0
Node 19.8.0 was released ~5 hours ago and we're consistently hitting internal asserts. Pin to 19.7.x to unblock CI until we understand what's going on with 19.8.0.
2023-03-14 17:13:43 -07:00
Abhinav Gupta 8f594326a2
ci: Don't run codegen tests for PRs
We currently run all codegen tests in pkg/codegen/$lang
for every PR.
These tests take quite a while to run and lock up many GitHub workers
for this entire duration.

This change attempts to address this issue
by running codegen tests only for those PRs
that touch the codegen directories.

The machinery to make this work is roughly as follows:

- In the on-pr workflow, when we're figuring out what we're doing,
  we check if we've changed codegen files.
  We use [paths-filter] to do this.
- We decide whether we want to run codegen tests based on those files,
  and pass that onto the test matrix generator.
- The test matrix generator filters out these packages
  and their subpackages from the list of tests under consideration.
- Everything else proceeds as normal.

[paths-filter]: https://github.com/dorny/paths-filter

Things to note:

- The test-codegen input defaults to true.
  All other invocations will run with codegen tests
  so these will continue to run on merge.
  Only PRs (from on-pr.yml) set it to false.
- Since the number of tests is remarkably smaller without these tests,
  we can significantly reduce the number of partitions we use
  for pkg/ unit tests.
  This should alleviate pressure on GitHub workers further.

This is a pretty blunt approach to the problem.
If we wanted to be more targeted,
instead of filtering at the get-job-matrix.py level,
we could instead set an environment variable
and add t.Skips in {program,sdk,type}_driver
if that environment variable is set.
And we can still do that in the future
if we decide that maintaining this list is too much.

Resolves 
2023-03-13 11:18:38 -07:00
Abhinav Gupta 49433cac65
scripts/retry: set-output is deprecated
The set-output command has been deprecated by GitHub.
Replace it with the GITHUB_OUTPUT based variant.

This was the only remaining instance of `::set-output`
in the repository after e4e96c96d.
2023-03-01 14:11:23 -08:00
Zaid Ajaj fb71145869 Update pulumi-dotnet to v3.54.0 2023-02-14 10:57:46 +01:00
Abhinav Gupta 148f040faf
ci: Test with Go 1.19, 1.20
Go 1.20 was just released.
Switch to testing with Go 1.19 and 1.20.
2023-02-03 14:19:30 -08:00
Abhinav Gupta 4955f3d8ae
ci: Use macos-latest
In , we pinned CI to macos-11
because we want to continue to support macOS 11.

This, however hsa created a new issue:
grpcio does not publish wheels for macos-11 anymore
and building it from source takes long enough to kill our CI
(see  ).

To fix the issue while continuing to support older macOS,
run CI on macos-latest, but leave build jobs and friends on macos-11.

Resolves , 
2023-02-03 12:46:14 -08:00
Robbie McKinstry a96a69db28
Rename "Smoke" test to "Acceptance" tests
After internal discussion, we determined "smoke" is a misleading
adjective for this category of tests. What we called "smoke tests"
are short integration tests for basic cross-platform functionality.
As a result, these are better named "acceptance" tests, since smoke
tests are intended to be a low water mark at the unit level to sniff
out bigger issues with the build as a whole.
2023-01-30 15:38:37 -05:00
Aaron Friel cee51919ff ci: Resume testing on Node current with 19.4 release
Fixes .

Upstream PR to Node was merged and included in 19.4:
https://github.com/nodejs/node/releases/tag/v19.4.0
2023-01-19 17:23:29 -08:00
Kyle Dixler 79cd7f2243
Bump pulumi-dotnet to 3.52.0 2023-01-18 08:27:40 -08:00