Repository navigation
feat: serve gateway version and indexer requirements at /version - #1229
Open
chriswessels wants to merge 1 commit into
Open
chriswessels wants to merge 1 commit into
chriswessels wants to merge 1 commit into
Conversation
Indexers can't tell why the gateway stops sending them queries after an
upgrade unless they know the gateway's minimum indexer-service and
graph-node versions. Those minimums live only in the gateway's config.
Add GET /version, which returns the gateway's crate version and the
configured minimums as semver requirements:
{"version": "27.7.1",
"indexer_requirements": {"indexer_service": ">=1.0.0",
"graph_node": ">=0.35.0"}}
The route is public, like /ready and /blocklist.
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.
Adds
GET /version, which returns the gateway's version and the minimum indexer-service and graph-node versions it requires of indexers:{ "version": "27.7.1", "indexer_requirements": { "indexer_service": ">=1.0.0", "graph_node": ">=0.35.0" } }Today those minimums (
min_indexer_version,min_graph_node_version) exist only in the gateway's config. When a gateway raises them, an indexer that stops receiving queries can't see why. This endpoint lets indexers and operators check compatibility directly. It mirrors indexer-service's own/version.versionis the crate version (CARGO_PKG_VERSION).>=requirements built from the configured minimums. They admit the same versions thatVersionFilteradmits (version >= minimum), and a test checks this.graph_nodeis enforced only when graph-node reports its version, asVersionFilter::checkdoes today. The README says so./readyand/blocklist, and the payload is computed once at startup.Validation:
cargo +nightly fmt --all -- --checkcargo +stable clippy --all-targets -- -Dwarnings --force-warn deprecated --force-warn dead-codecargo +stable test: 53 passed, including 3 new tests for the payload shape, requirement semantics, and the route's JSON response.