Commit graph

28 commits

Author SHA1 Message Date
Sarah French
2e5b5dee5d
Upgrade protoc and protoc-gen-go-grpc versions to matching terraform-plugin-go (#37647)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
* Update protoc version in downloader script

* go get google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1

This matched terraform-plugin-go

* make protobuf

* Run `make protobuf`

* Update generator to handle generic types from google.golang.org/grpc

Looks like this was added in v1.69.3 in https://github.com/grpc/grpc-go/pull/7057 ?

* Run `make generate`

* Fix "cannot infer Res" compile error - more usage of generics

* More fixing compile errors due to switching to use of a generic

* Make putting `google.golang.org/grpc` import into generated files conditional

* Run `make generate`

* Update more places where generics now need to be used

* Update generator to handle any types from google.golang.org/grpc in same switch case.
2025-10-22 14:46:18 +01:00
Sarah French
2657a4daec
Set let require_unimplemented_servers default to true when generating code from .proto files (#37737)
* Remove `require_unimplemented_servers=false` option when generating code from proto files. Run `make protobuf`.

This allows require_unimplemented_servers to default to true, and the generated code shows the impacts of that.

* Update generator script to embed 'UnimplementedFoobarServer' structs and skip generating code for the `mustEmbedUnimplementedFoobarServer` method that is implemented via that embedding.

* Run `make generate`

* Embed UnimplementedProviderServer into implementations of ProviderServer

* Embed UnimplementedProvisionerServer into implementations of ProvisionerServer
2025-10-09 11:18:13 +01:00
Sarah French
ffbb62b369
Swap to using google.golang.org/protobuf/cmd/protoc-gen-go instead of github.com/golang/protobuf/protoc-gen-go (#37685)
* Reformat Args in steps definitions

* Swap to using the new version of protoc-gen-go that doesn't include grpc support (instead it relies on protoc-gen-go-grpc).

Update command flags to reflect this change in tooling.

See this comment for explanation: https://github.com/golang/protobuf/issues/1070#issuecomment-607293496

* Run `make protobuf` with problem generate steps commented out.

* Use `require_unimplemented_servers=false` to minimise changes at the time of upgrading tooling

In future we can navigate the consequences of this in its own PR.

* WIP

* Fix out/opt typo, add remaining flags once terraform1.proto was being found ok

* Run `make protobuf`

* `go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0` && `go mod tidy`

This version includes a feature that allows the copyright comment in the .proto file to be pulled across to generated _grpc.pb.go files.

* Run `make protobuf` with new version of protoc-gen-go-grpc that allows copyright comment to be copied to generated output files

* Potential fix for `internal/rpcapi/dynrpcserver/generator`
2025-09-30 11:52:24 +01:00
Daniel Banck
1ac8497994
Add support for Terraform Search in the cloud backend (TF-25935) (#37479) 2025-09-15 13:21:05 +02:00
James Bardin
7ed24d208a make protobuf 2025-08-12 14:05:10 -04:00
UKEME BASSEY
3bc13593f9 add proto files gen for stacks plugin, & regenerate protofiles
add tests

update changelog
2025-05-05 16:06:49 -04:00
UKEME BASSEY
91b1dd3cc3 extend existing cloud plugin to accomodate new plugin 2025-04-28 12:54:23 -04:00
Sarah French
6ef0498f9c
Update to Go 1.24.1, update dependencies (#36790)
* go get github.com/hashicorp/go-azure-helpers@v0.72.0

* .go-version to 1.24.1

* Run `./scripts/syncdeps.sh`

This propagates the Go version upgrade

* gcs : go get google.golang.org/api@v0.155.0

* gcs: go mod tidy

* Run `./scripts/syncdeps.sh`

* make generate && make protobuf
2025-03-27 17:15:46 +00:00
Sarah French
a04664a2e5
Update hashicorp/go-plugin dependency (#36561)
* go get github.com/hashicorp/go-plugin

* ./scripts/syncdeps.sh

* make protobuf
2025-03-26 12:09:01 +00:00
James Bardin
3b3e4bf003 update the rest of the go:generate calls 2025-02-12 12:25:58 -05:00
James Bardin
9ff727440e udpate generated files 2024-09-11 14:09:42 -04:00
Jeff Bonhag
8b2941455a
Upgrade go-tfe from 1.51.0 to 1.58.0 (#35495)
* go get github.com/hashicorp/go-tfe@v1.58.0

* Switch to go.uber.org/mock for mocks
2024-08-08 11:31:49 +02:00
Sebastian Rivera
015f795ff0 Rebrand Terraform Cloud to HCP Terraform 2024-04-23 16:12:59 -04:00
Martin Atkins
d3b8a55781 go.mod: go get google.golang.org/protobuf@v1.33.0
Many of the changes between these two versions seem to be in parts of the
library that Terraform doesn't use, but there are a few sensitive parts:
  - Slight changes to details of how the library implements the JSON
    encoding of protobuf. Terraform CLI/Core don't use this, but some
    of the backends might use it indirectly when talking to their
    underlying APIs.
  - Some details of the "protoreflect" package for working with
    protobuf descriptors dynamically (rather than using generated stubs)
    have changed, but it seems pretty marginal and unlikely to cause
    problems.
2024-03-21 08:05:58 -07:00
Nick Fagerlund
7a1c49c61d Append cloud plugin config metadata in plugin client requests
- The cloud plugin wants a go-tfe client to get stuff from TFC.

- Terraform knows how to find all the info you need in order to configure a
go-tfe client, but it's sometimes scattered across configs and env vars and
credentials helpers, and trying to re-implement the resolution logic identically
in another codebase would be error-prone.

- Therefore, it'd be best if Terraform did that resolution and just passed the
plugin all the config info it needs.

There are two options for that handoff:

1. Adding it as an additional argument to the primary Execute RPC interface.

2. Passing it as gRPC metadata, which is a pile of arbitrary key => list-of-strings
   pairs transmitted via HTTP/2 headers.

The crux of the decision here is whether a proliferation of plugin protocol
versions whenever we need to add more config data is better or worse than a
fuzzy and typeless key/value bag.

This PR is an implementation of option 2, for discussion and evaluation. (And
after all, this is considered an experimental feature anyway.) It assembles the
necessary information, translates it to the required metadata format, and
attaches it to the request at the proper moment to get everything over to the
plugin.

As previous commits foreshadowed, we're leaning on the existing logic in the
Cloud backend for pretty much all of this.
2024-01-04 14:42:36 -08:00
Nick Fagerlund
d2e07f6f03 Add TF_CLOUD_PLUGIN_DEV_OVERRIDE to enable cloudplugin dev
Currently, Terraform will only run properly signed versions of the experimental
cloud plugin that were downloaded from a TFC instance that provides the
appropriate service. That obstructs development on new cloud plugin features!
Our internal teams will need a "dev override" capability, like what we offer
provider authors.

However, unlike with providers, we don't have to integrate this into a
heterogeneous mix of sources for mirroring and caching a wide range of binaries.
There's only one cloud plugin, HashiCorp controls it, and end users should never
need to override the location of the binary for non-development reasons.

Thus, we have the luxury of being quite a bit stupider in how we handle the
override signal. Instead of adding it to the CLI config file schema, we'll just
use a single environment variable whose value is the path to an alternate
binary.

Enter: `TF_CLOUD_PLUGIN_DEV_OVERRIDE`.
2023-12-04 18:09:37 -08:00
Brandon Croft
7acde98806
cloudplugin: change manifest format to match releases API
Changes the release manifest format to more closely match the releases API V1 (example https://api.releases.hashicorp.com/v1/releases/terraform-cloudplugin/0.1.0-prototype)

- The new format doesn't carry the SHASUM for each build, so it made the matching_sums check in releaseauth redundant.
- Added tests for checksum parsing
- Added ID-based selection of signature file
2023-09-06 14:03:24 -06:00
CJ Horton
1706d643d6 more missing headers 2023-08-30 14:55:24 -07:00
Brandon Croft
114f876f81
Merge pull request #33602 from hashicorp/TF-8071-download-and-verify-the-plugin-in-terraform
Download and authenticate the cloudplugin
2023-08-18 07:08:33 -06:00
Brandon Croft
3d1e07dcf3
Write command output to Meta.Streams, more plugin err handling 2023-08-18 06:53:25 -06:00
Brandon Croft
8f4a430e41
refactor: cloudplugin VersionManager -> BinaryManager 2023-08-17 15:00:16 -06:00
CJ Horton
98b81d3c50 add missing copyright headers 2023-08-16 11:21:49 -07:00
Brandon Croft
63e017b81b
cloudplugin: download and verify plugin
Adds a client that encapsulates the process of downloading a cloudplugin manifest from a Terraform Cloud, downloads the appropriate binary to the specified location, and validates that it was distributed by HashiCorp
2023-08-14 14:07:20 -06:00
hashicorp-copywrite[bot]
53c34ff49c
Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
Brandon Croft
14628b9246
Update cloudproto1.pb.go 2023-07-25 09:30:25 -06:00
Brandon Croft
e5ce25099c
Apply suggestions from code review
Co-authored-by: Sebastian Rivera <sebastian.rivera@hashicorp.com>
2023-07-25 09:28:32 -06:00
Brandon Croft
a806f6220a
Tests the cloudplugin1 gRPC client 2023-07-25 09:28:31 -06:00
Brandon Croft
539e140d3e
Introduces cloudproto1 plugin interface 2023-07-25 09:28:31 -06:00