Commit graph

122 commits

Author SHA1 Message Date
Austin Valle
a48e873790
PSS: Adjust StateRange.End logic in ReadStateBytes and WriteStateBytes (#38127)
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
* fix usage of StateRange.End

* add test for last chunk is single byte
2026-02-05 17:25:25 +00:00
Radek Simko
922fdb2382
Implement LockState & UnlockState provider methods (#37711) 2025-10-03 10:02:02 +01:00
Radek Simko
51fc4c161f
PSS: Implement ReadStateBytes + WriteStateBytes (#37440)
* Implement ReadStateBytes + WriteStateBytes

* [WIP] -  Testing ReadStateBytes and WriteStateBytes (#37464)

* Fix nil pointer error

* Add WIP test for ReadStateBytes

* Move test mock to separate testing file

* Update mock to send unexpected EOF when there's a problem returning data and it's not a true EOF

* Add test case for when length != expected length

* Add test for when trying to read state from a store type that doesn't exist

* Change symbol names to lowercase

* Add ability to force a diagnostic to be returned from `mockReadStateBytesClient`'s `Recv` method

* Add test showing error diagnostics raised by the ReadStateBytes client are returned

* Add missing header

* Simplify mock by using an embedded type

* Rename `mockOpts` to `mockReadStateBytesOpts`

* Update existing tests to assert what arguments are passed to the RPC method call

* Add mock WriteStateBytesClient which uses `go.uber.org/mock/gomock` to enable assertions about calls to Send

* Add a test for WriteStateBytes that makes assertions about calls to the Send method

* Update test case to explicitly test writing data smaller than the chunk size

* Implement chunking in WriteStateBytes, add test case to assert expected chunking behaviour

* Add generated mock for Provider_WriteStateBytesClient in protocol v6

* Update tests to use new `MockProvider_WriteStateBytesClient`, remove handwritten mock

* Update code comments in test

* Add tests for diagnostics and errors returned during WriteStateBytes

* Add generated mock for Provider_ReadStateBytesClient in protocol v6, replace old mock

* Add test case for grpc errors in ReadStateBytes, fix how error is returned

* Typo in comment

* Add missing warning test, rename some test cases

* Update proto file definition of Read/WriteStateBytes RPCs (#37529)

* Update Read/WriteStateBytes RPCs to match https://github.com/hashicorp/terraform-plugin-go/pull/531

* Run `make protobuf`

* Run `make generate`

* Update use of `proto.ReadStateBytes_ResponseChunk` in tests

* Fix how diagnostics are handled alongside EOF error, update ReadStateBytes test

* More fixes - test setup was incorrect

I think? I assume that a response would be returned full of zero-values when EOF is encountered.

* WIP - avoid crash if chunk is nil

* Sarah's updates to radek/pss-read-write (#37642)

* Update code to not expect a chunk when EOF encountered

* Return early if any grpc errors are encountered during ReadStateBytes

* Close the stream with CloseSend once everything's read without error. Add test case about handling grpc errors from CloseSend.

* Fix test case about warnings: We would expect to receive a chunk with data alongside the warning and have a normal closing of the stream after EOF

* Add log line, remove unneeded type info

* Implement configurable state chunk size

* handle metadata in WriteStateBytes correctly

* validate chunk sizes received from provider

* ReadStateBytes: avoid early return on warnings

---------

Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
2025-09-26 17:03:02 +01:00
Andrew Babichev
8097ce9e57 docs(destroying): fix typos 2025-09-23 10:50:55 -07:00
Daniel Schmidt
871451122f actions: move schema to single action type and remove linked resources
we want to leave the door open to evolve the design in the future based on feedback
2025-09-15 17:09:22 +02:00
James Bardin
3a2409e3dc generate capability 2025-08-29 15:00:30 -04:00
James Bardin
db98d67774 GenerateResourceConfig protobuf 2025-08-29 15:00:30 -04:00
Daniel Schmidt
176263d936 actions: remove future action types
removing them for now, this gives us more flexibility in the future since the schema is not yet locked in
2025-08-29 16:25:41 +02:00
Daniel Schmidt
17e7338b0f add client capabilites across the board 2025-08-05 15:34:13 +02:00
Austin Valle
184175761b fix protocol field numbers 2025-07-30 09:59:46 +02:00
Daniel Schmidt
7bf6629ae7 fix protobuf typo 2025-07-24 11:28:29 +02:00
Daniel Schmidt
c11a85493e mark field 10 as reserved
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
2025-07-24 11:28:29 +02:00
Daniel Schmidt
972427d70a use same attribute mapping as provider protocol 2025-07-24 11:28:29 +02:00
Kristin Laemmert
0374f04424
Add ValidateActionConfig to provider interface, protocol & internal implementations (#37345)
* Add ValidateActionConfig to provider interface and protocol

* Update internal/provider-simple-v6/provider.go

Co-authored-by: Daniel Schmidt <danielmschmidt92@gmail.com>

---------

Co-authored-by: Daniel Schmidt <danielmschmidt92@gmail.com>
2025-07-18 14:14:44 -04:00
Daniel Schmidt
d0e5c3cc7b address review feedback 2025-07-10 16:06:44 +02:00
Daniel Schmidt
e6b848d5ab add actions protobuf definitions 2025-07-10 16:06:44 +02:00
Sarah French
0f8e77a50f
PSS: Add GetStates and DeleteState RPCs to plugin protocol v6 (#37288)
* Add GetStates RPC method to Plugin Protocol v6

* Add DeleteState RPC method to Plugin Protocol v6

* Add methods to provider-simple

* Fix error messages

* Apply suggestions from code review

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>

* Change how GetStates RPC returns the list of state names

* Change GetStates implementation to use new data type

* `make protobuf` to accommodate new code comments

---------

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
2025-07-07 10:40:45 +01:00
Samsondeen
79187d579d
Validate list block meta-arguments (#37281) 2025-07-04 10:42:06 +02:00
Daniel Banck
cb58a15f3d
Implement ListResource RPC (TF-25509) (#37092)
* Implement ListResource RPC via callbacks

* Implement ListResource with iterators

* Change `ListResourceResponse` to slice

* Turn ListResourceResponse into a struct

* Add a limit for ListResource

* explicitly cancel stream when listing resources

---------

Co-authored-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
2025-06-04 09:40:10 +02:00
Radek Simko
643266dc90
Add initial state store protocol skeleton (#37197)
* Add initial state store protocol skeleton

Introduce ValidateStateStoreConfig + ConfigureStateStore
Update GetProviderSchema + GetMetadata (for mux)

* address PR feedback
2025-06-03 13:52:35 +00:00
Radek Simko
dd4bf55dca
docs/plugin-protocol: Clarify use of GetMetadata (#37181)
* docs/plugin-protocol: Clarify use of GetMetadata

* Run `make protobuf`

---------

Co-authored-by: Sarah French <sarah.french@hashicorp.com>
2025-06-02 09:18:39 +01:00
Baraa Basata
d8d890f3b2
Minimize text diff between tfplugin{5,6}.proto (#37093)
* Minimize text diff between tfplugin{5,6}.proto

This is a no-op change that moves two definitions in tfplugin5.proto to
match their relative location in tfplugin6.proto. The effect is to
remove an incidental part of the text diff between the two files for
easier comparison.

* fixup! Minimize text diff between tfplugin{5,6}.proto
2025-05-21 18:15:27 +02:00
Leonid Andrianov
e9a7080831
few minor improvements of grammar (#35943)
* few minor improvements of grammar

* Update docs/unicode.md

Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>

---------

Co-authored-by: aleonidex <lyonya-4spam@yandex.ru>
Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>
2025-05-20 09:08:34 +00:00
Daniel Banck
44ae7da18e
Update Plugin Protocol for List and Implement ValidateListResourceConfig (#37007)
* Minor auto-formatting changes

* Add list RPC and schema protobuf definitions

* make protobuf

* make generate

* Add ValidateListResourceConfig implementation
2025-05-19 10:20:52 +02:00
Daniel Banck
dd10cfc048
Cleanup Terraform Plugin Protocol Files (#37005)
* Rename tfplugin5.9.proto and remove other files

* Rename tfplugin6.9.proto and remove other files

* Update symlinks

* Update protocol related docs
2025-05-09 15:23:38 +02:00
Sarah French
371e625ea9
Update URLs from www.terraform.io to developer.hashicorp.com (#36792)
* Update URLs from www.terraform.io to developer.hashicorp.com

* More updates to URLs linking to documentation in documentation and user-facing warnings/errors

* More updates to URLs linking to documentation, in docs, code, test fixtures

* Replace www.terraform.io/community with link to Community Forum

* Apply suggestions from code review

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>

---------

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
2025-04-01 09:37:12 +01:00
Daniel Banck
5b48de5a4e
Update identity related fields in protocol move request (#36662)
* Update source identity type in move request

* make protobuf

* Update type for identity upgrade

* make protobuf
2025-03-10 18:00:29 +01:00
Sarah French
4facc97e7c
Add documentation describing how to update the plugin protocol (#36592)
* Add documentation describing how to update the plugin protocol

* Fix typo

* Minor edits

* Refactor docs to ensure the protocol semver goes up by one minor once per Terraform minor release.

* Edit a word
2025-02-28 10:04:16 +00:00
Sarah French
6784407b65
Add .vscode/ to .gitignore, add launch configuration samples elsewhere in repo, update debugging docs (#36527)
* Remove .vscode/ from version control

* Add section about debugging automated tests

* Update existing debugging advice to reference  example file, deduplicate text about automated tests

* Add details about launching TF ni debug mode from within VS Code

* Respond to review feedback, other small edits like full-stops
2025-02-19 10:04:33 +00:00
Daniel Banck
857d188308
Add resource identity message to protocol (TF-23178) (#36451)
* protocol: create new 5.9 and 6.9 protocol versions

* protocol: add resource identity messages to 5.9 & 6.9

* make protobuf

* make generate

* grpcwrap: Add RPC calls skeleton
2025-02-10 16:31:50 +01:00
Hadi Cherkaoui
dbaed4e2e9
Update dependency-upgrades.md 2025-01-21 20:00:08 +01:00
Hadi Cherkaoui
3fa7344017
Small docu typo fixes in debugging.md
fixed a typo and changed all lower case delve to Delve since thats how delve them selfs write it
2025-01-18 14:04:04 +01:00
Daniel Schmidt
e29708c4d9
ephemeral: add WriteOnlyAttributesAllowed client capability to validate resource 2024-12-18 09:30:32 +01:00
Daniel Schmidt
3a962e8e7e
ephemeral: add WriteOnlyAttributesAllowed client capability
we allow it for all requests
2024-12-12 10:56:40 +01:00
Sarah French
f031b14ece
Update architecture.md docs (#36167)
* Update references to structs and interfaces used for Backends

* Replace links to old www.terraform.io/docs website

These all had active redirects to the new site, except for https://www.terraform.io/docs/backends/index.html, which 404'd

* Make bullets' formatting consistent

* Update link to non-existent Execute type in docs
2024-12-10 10:39:24 +00:00
Sarah French
0d6c1d315d
Fix hyperlink in docs/architecture.md (#36166) 2024-12-05 20:22:44 +00:00
Radek Simko
f57c3c768a
docs: Add notes about debugging (#35714) 2024-11-13 09:33:37 +00:00
Daniel Schmidt
50b3732f72
write-only attributes: add to provider schema 2024-11-12 16:42:05 +01:00
James Bardin
3a1a9408d9 fix Descendants spelling
this has proliferated everywhere
2024-10-09 11:09:02 -04:00
James Bardin
5a7a113863 remove state from proto6 ephemeral calls 2024-10-01 10:26:32 -04:00
James Bardin
9899d59a22 add deferrals to ephemeral proto and remove state
Add deferrals to the protocol.
The renew and close calls had an extra state field which was unneeded.
2024-09-30 10:49:52 -04:00
James Bardin
9c3dc8f73a ephemeral protocol rename
Add `Resource` to all the ephemeral protocol symbols to make them
consistent with existing naming conventions.
2024-09-20 11:08:53 -04:00
James Bardin
5ecd6d0854 new proto files for ephemeral resources 2024-09-19 10:02:45 -04:00
kmoe
3946b8c0df
Update Go doc links in architecture.md (#35629)
* docs: update godoc links

The pkg.go.dev links are no longer usable, so use local godoc instead.

* docs: add pkgsite instructions
2024-08-22 18:18:56 +01:00
Jack Whitter-Jones
ad8691745a
Update architecture.md
Updated a broken link due to spelling mistake
2024-05-18 11:00:09 +01:00
Liam Cervante
055dd27e53
deferred actions: implement latest provider protocol changes (#35063) 2024-04-24 14:10:08 +02:00
Rose
1b5966dd50 Small TFC fixes in md files 2024-04-19 06:58:43 -07:00
Daniel Schmidt
561e74b190
Merge pull request #34880 from hashicorp/TF-13954
stacks: add deferred to protobuf
2024-04-02 14:05:00 +02:00
Martin Atkins
f0ec576fea docs: Dependency upgrading
This new document is a mixture of context that was previously just
institutional knowledge held by me and a few other Terraform Core members,
and of new information I've learned while practicing dependency upgrades
under our new multi-module repository layout.

I've documented this as a starting point for those who are completely new
to the codebase, and for those who were already familiar but haven't yet
performed upgrades in the new multi-module layout.

This all still remains slightly in flux because I'm using real dependency
upgrades to practice different interactions between the different modules,
and so this is likely to evolve as we learn more, but we need to have at
least some initial docs on this around in case we need to perform upgrades
in an emergency situation where I am not around to assist directly.
2024-04-01 08:16:45 -07:00
Daniel Schmidt
45e9530d12
stacks: remove deferred actions for UpgradeResourceState
UpgradeResourceState is offline; it does not need a configured provider

therefore it can not be deferred
2024-03-26 17:34:24 +01:00