Skip to content

feat: add multichain support to endpoint resource#71

Merged
wparr-circle merged 1 commit into
circlefin:mainfrom
andreclaro:multichain
May 7, 2026
Merged

feat: add multichain support to endpoint resource#71
wparr-circle merged 1 commit into
circlefin:mainfrom
andreclaro:multichain

Conversation

@andreclaro

@andreclaro andreclaro commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional multichain boolean attribute to the quicknode_endpoint resource, wiring the QuickNode Admin API enable_multichain and disable_multichain endpoints into Create/Update.

Read reconciles data.multichain from the is_multichain field on the show-endpoint response, so drift is detected if multichain is toggled outside Terraform.

Changes

  • New multichain attribute on quicknode_endpoint (optional, default false).
  • Create enables multichain when multichain = true. State is saved before the enable call so a failure leaves the caller with a valid resource id to recover from rather than orphaning the endpoint in QuickNode.
  • Update calls enable/disable based on the diff between plan and prior state. Diff uses ValueBool() comparison so upgrading a state file where the attribute is null to false does not trigger a spurious disable.
  • Read populates multichain from is_multichain on the API response.
  • setMultichain treats a (nil, nil) response from the client as an explicit internal error instead of a misleading status 0 / empty body diagnostic.
  • New example under examples/multichain-endpoint/.
  • Unit tests for setMultichain covering enable/disable success, transport errors, non-200 responses, and nil responses. Plus a test for the null-vs-false diff logic. All added to the existing endpoint_resource_test.go.

Side effects from make vendor

  • api/quicknode/openapi.json and its generated client were refreshed, which adds is_multichain (plus incidental new fields like name, is_dedicated, is_flat_rate, status) to the endpoint types.
  • api/streams/streams-openapi.json and its generated client also refreshed — make vendor refreshes both together.
  • The upstream QuickNode spec reuses the deleteTag operationId for two distinct paths, which trips up oapi-codegen. The vendor target now patches the spec in-flight with jq to rename the account-level op to deleteAccountTag until upstream fixes it. A comment in the Makefile documents this so the next refresh does not silently regress. Worth flagging to QuickNode separately.

Test plan

  • go test ./... passes locally (includes new unit tests).
  • go vet ./... passes.
  • make generate regenerates docs cleanly (docs/resources/endpoint.md updated).
  • End-to-end against a real QuickNode account via dev_overrides: Read correctly reconciles state from the API and plan diffs surface both true -> false and false -> true drift on real endpoints. No-op plans where config already matches the API, as expected.

Adds an optional `multichain` boolean attribute to the `quicknode_endpoint`
resource. Wires the QuickNode Admin API enable_multichain and
disable_multichain endpoints into Create/Update, and reads the current
state back via the `is_multichain` field on the show endpoint response so
drift is detected.

Side effects from `make vendor`:
- Refresh of api/quicknode/openapi.json and the generated client, which
  adds `is_multichain` (plus other new fields like `name`, `is_dedicated`,
  `is_flat_rate`, `status`) to the endpoint types.
- Refresh of api/streams/streams-openapi.json and the generated client.
- Local rename of a duplicate `deleteTag` operationId (two different paths
  upstream share the same id) to unblock code generation.

Tests:
- Unit tests for the new setMultichain helper covering enable/disable
  success, transport errors, and non-200 responses.
@andreclaro andreclaro marked this pull request as ready for review May 6, 2026 16:51

@wparr-circle wparr-circle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wparr-circle wparr-circle merged commit fae6895 into circlefin:main May 7, 2026
11 checks passed
andreclaro pushed a commit that referenced this pull request May 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.8.0](v0.7.2...v0.8.0)
(2026-05-08)


### Features

* add multichain support to endpoint resource
([#71](#71))
([fae6895](fae6895))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants