refactor: structural cleanups + datasource-selector consistency#115
Merged
Conversation
bbba88b to
b5d0f46
Compare
- clickhouse: rename the query/query-raw datasource selector from "cluster" to "datasource", matching prometheus/loki/dora (CLI arg, op key, Python wrapper + docs). Schema-side "cluster" (the logical CH cluster term from #110) is left intact; identifiers remain xatu/xatu-cbt. - eips/consensusspecs: extract the duplicated on-disk JSON cache scaffold into internal/githubapi (generic ReadCache/WriteCache) - proxy binary: serve metrics via pkg/observability so it also exposes /health and /ready - add unit tests for searchsvc, searchruntime, and consensusspecs
All *.list_datasources / *.list_networks operations now emit one item shape
{name, description, url, type, extra}, rendered by a single CLI helper
(printListing) and documented uniformly in the Python wrappers. Type-specific
fields (clickhouse database; block_archive status/source/chain_id/polling) move
into `extra`. datasource vs network top-level keys are kept where the concept
genuinely differs.
…wave 2b) - extract a generic datasourceHandler (X-Datasource lookup, 404/error handling, prefix strip, ReverseProxy build) that the ClickHouse/Prometheus/Loki handlers configure with their per-type target/director and transport; routing, credential-strip-then-SetBasicAuth, timeouts and TLS are unchanged and the existing handler tests pass - route proxy datasource handler errors through the JSON writeError helper - Client now embeds Service (removes the duplicated 11-method block) - drop the unused PrometheusDatasources()/LokiDatasources() from the Service interface (concrete methods kept for the status endpoint)
…ve 2c) Pure refactor of the GitHub-backed OAuth authorization server, no behavior change. - rename SimpleService/simpleService/NewSimpleService -> AuthorizationServer/authorizationServer/NewAuthorizationServer, and the pkg/proxy alias simpleauth -> auth (+ the wrapper authenticator names) - split the ~1334-line auth_simple.go into cohesive files: authorization_server (type + lifecycle + routing), middleware, metadata, authorization_code, device, token, response
- cbt: centralize the per-network base URL in cbt.NetworkBaseURL (was duplicated in the module's SandboxEnv and the server cbtNetworks operation) - ethnode: add proxy.Service.EthNodeDatasourceInfo so the app kernel no longer fabricates a synthetic datasource entry - proxy: drop the dead executionID param from RegisterToken/RevokeToken (the per-execution token lifecycle went away with AuthModeToken); replace the "none" sentinel with proxy.NoAuthToken - prometheus: default query-range --start/--end like loki, and accept --start/--end on labels/label-values (parity with loki) - version: extract shared print logic into internal/version (cli/server/proxy) - types: rename Example.Cluster -> Example.Target (it labels non-cluster datasources too); examples.yaml cluster: -> target:
…cal mode, enforced by topology in hosted-proxy mode
b5d0f46 to
d27989f
Compare
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.
Builds on #114 with the structural refactors and datasource-selector consistency work split out of the housekeeping PR: ClickHouse's query selector renamed to
datasourceto match the other modules, a unified{name, description, url, type, extra}listing envelope across alllist_datasources/list_networksoperations, a generic reverse-proxy handler replacing the duplicated ClickHouse/Prometheus/Loki handlers, andauth_simple.gosplit into cohesive files withSimpleServicerenamed toAuthorizationServer. Also dedupes the eips/consensusspecs on-disk cache, reusespkg/observabilityin the proxy binary, aligns prometheus/loki query args, removes a deadexecutionIDparameter, renamesExample.ClustertoTarget, and adds unit tests for searchsvc/searchruntime/consensusspecs.Stacked on #114 (base is
preship-housekeeping, not master); rebase onto master once #114 merges.