mirror of
https://github.com/oscarhermoso/terraform-provider-binarylane
synced 2026-10-17 13:28:08 +11:00
77271b0efd
* Initial plan * Initial plan for separate_private_network_interface support Agent-Logs-Url: https://github.com/oscarhermoso/terraform-provider-binarylane/sessions/df438ec9-fdbb-47a3-8ebb-592ee2843eed * Add separate_private_network_interface to server resource and data source Agent-Logs-Url: https://github.com/oscarhermoso/terraform-provider-binarylane/sessions/df438ec9-fdbb-47a3-8ebb-592ee2843eed * Run go fmt and add AGENTS.md Agent-Logs-Url: https://github.com/oscarhermoso/terraform-provider-binarylane/sessions/1f274b93-d7c2-4547-a24d-8d36472c8092 * Add source_and_destination_check assertion to data source test checks Agent-Logs-Url: https://github.com/oscarhermoso/terraform-provider-binarylane/sessions/8684d505-33e7-407c-a4fb-c6260ffdb2ea * go generate: update types_gen.go with latest API schema (Action.Reason, Action.Title, Invoice.InvoiceViewUrl) Agent-Logs-Url: https://github.com/oscarhermoso/terraform-provider-binarylane/sessions/1baa947c-aaee-4c45-b2b8-9495ccf38b82 * Fix separate_private_network_interface: add ModifyPlan unknown handling and IsUnknown guard in Update Agent-Logs-Url: https://github.com/oscarhermoso/terraform-provider-binarylane/sessions/e9b9d51d-8447-48a5-8c61-9c749562c3e1 * Simplify separate_private_network_interface description and remove dead code Match the OpenAPI schema phrasing for consistency with other attribute descriptions, and drop the defensive IsUnknown guard in Update — ModifyPlan already resolves Unknown to Null/false before Update runs. --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1.6 KiB
1.6 KiB
AGENTS.md
Before starting
Run go generate to pull in the latest API schema before making changes.
Code style
- Follow patterns in existing resources, especially
server_resource.goandserver_data_source.go. - New server attributes that map to a post-creation API action (e.g.
change_*) follow thesource_and_destination_check/separate_private_network_interfacepattern: read the planned value before the first state save, call the action after creation if the value differs from the server default, and handle updates in theUpdatemethod. - Run
go fmt ./...before finishing — the CI will fail without it. - Don't add
Required: falsewhenOptional: trueis already set; it is redundant.
Testing
- Tests live in
internal/provider/*_test.go. - A valid
BINARYLANE_API_TOKENis required; tests create real servers that cost money — be conscientious. - Always run the sweeper after tests, regardless of success or failure:
go test -v ./internal/provider/... -sweep=all - Run a specific test with:
go test -v -run TestServerResource ./internal/provider/... - New attributes on the server resource should be exercised inside an existing test step where possible (e.g. the first step of
TestServerResourcealready provisions a VPC server).
Workflow
go generate— fetch latest OpenAPI spec and regenerate code + docs.- Make changes.
go fmt ./...— format code.go build ./...— verify it compiles.go vet ./...— catch common mistakes.- Run relevant tests, then sweep.
go generateagain to regenerate docs if schema or descriptions changed.