Repository navigation
feat: provider skeleton with endpoint resource and chains data source - #1
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AlejandroFabianCampos
force-pushed
the
feat/provider-skeleton
branch
from
September 22, 2026 16:57
b319f52 to
31cb137
Compare
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR for the official Quicknode Terraform provider. It establishes the codegen pipeline, the client, the first resource, and everything the repo needs to be public and publishable to the Terraform Registry.
Nothing is published to the Registry yet — see Not done below.
Provider
Code generation (
api/admin/)The Go client is generated from the Admin API's OpenAPI spec. The spec is vendored verbatim and a separate patch file carries the local schema corrections, so the vendored copy can be refreshed without losing local changes to a merge conflict:
openapi.upstream.json— vendored verbatim, refreshed withmake vendorpatches.json— JSON Pointer corrections applied before generationgen/main.go— applies the patches, emitsopenapi.jsonadmin.gen.go— generated client, committed so builds don't require the toolchainClient (
internal/client/)Hand-written domain layer over the generated client, which produces anonymous inline structs unusable as a public surface. Owns the domain model (
Endpoint,Chain,Tag) and normalizes the API's response envelopes into a single error type.Includes a retry transport with client-side rate limiting, exponential backoff with jitter,
Retry-Afterhonoring, and retries on 429/502/503/504. Terraform parallelizes applies ten ways by default, so throttling belongs in the provider rather than in the user's config.Provider (
internal/provider/)quicknode_endpoint— create, read, update, delete, importquicknode_chains— data sourceRegistry publishing
terraform-registry-manifest.jsondeclaring protocol 6.0. Without it the Registry assumes protocol 5 and everyterraform initfails..goreleaser.ymlproducing the multi-platform zips,SHA256SUMSand detached GPG signature the Registry requires.goreleaser checkpasses..github/workflows/release.yml— tag-triggered, imports the signing key, runs GoReleaser.Two secrets need to exist before the first tag:
GPG_PRIVATE_KEYandPASSPHRASE, with the public half registered on the Registry.Documentation
docs/is generated bytfplugindocsfrom the provider schema plusexamples/, withtemplates/index.md.tmplcarrying the provider overview.examples/follows the layout the generator reads, so resource examples and the import command appear in the published docs automatically.CI fails if
docs/is stale relative to the schema.CI and conventions
.github/workflows/test.yml— build, golangci-lint, docs freshness, unit tests, and acceptance tests gated to pushes onmain.golangci.yml— standard set plusbodyclose,errorlint,nilerr,misspelland others, with generated code excluded. Zero issues..gitattributesmarking generated and vendored files so GitHub collapses them in diffs and language statsCONTRIBUTING.md,SECURITY.md,CHANGELOG.md,CODEOWNERS, DependabotThe README was rewritten to match the convention across published providers — contributor-facing, with usage reference living in
docs/rather than duplicated in the README.Two bugs worth calling out
Both were caught during review of this branch.
URL composition. The auth token is not at a fixed position in an endpoint URL — some chains append a path suffix after it (
https://<host>/<token>/evm). Telling callers to join a base URL to a token produces a broken URL on those chains and a working one everywhere else, which is the worst failure mode available. The resource exposeshttp_url_with_tokenandwss_url_with_tokenstraight from the API so nothing has to be composed.Non-convergent plans.
chainandnetworkcarryRequiresReplace, andReadwrites the API's canonical slug back into state. Matching the configured slug case-insensitively at plan time therefore meanschain = "ETH"validates, gets stored, gets overwritten withethon the next refresh, and proposes a destroy-and-recreate on every plan forever.validateChainNetworkmatches exactly and emits a diagnostic naming the canonical spelling.Reconciliation
The endpoint resource is identified solely by the API's numeric ID. There is no user-settable unique name, so a provider cannot adopt an existing endpoint or detect a duplicate create. The mitigation is remote state plus
terraform import.A 404 on read removes the resource from state instead of erroring, so deleting an endpoint in the dashboard proposes a recreate rather than wedging every subsequent plan until someone runs
terraform state rmby hand.Not done
QUICKNODE_API_KEYin secrets.security_optionson the endpoint, per-entry security resources, rate-limit resources, anddata.quicknode_endpoint(s)are designed but unimplemented.quicknode/quicknodenamespace and is effectively permanent.Verification
make lint(gofmt,go vet, golangci-lint) — zero issues.make testpasses.make docsis clean.goreleaser checkpasses.terraform fmt -checkonexamples/is clean.TestProviderSchemaexercisesGetProviderSchemaover real protocol v6, so the schema is known to serve.