graphprotocol / graphprotocol/indexer-rs

Warn messages while using env prefix

Open
#482 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

low meta:good-first-issue p3 pkg:config repo:indexer-rs size:small type:bug
Dominant language
Rust
Stars
31
Forks
29
Avg merge
13h 9m
Merged PRs (30d)
13

Description

We have people using environment variables to set config values. This is currently backward compatible but people are receiving messages because of the prefix:

  2024-11-10T16:07:38.447746Z  WARN indexer_config::config: Ignoring unknown configuration field: _host_and_port
    at config/src/config.rs:59

  2024-11-10T16:07:38.447805Z  WARN indexer_config::config: Ignoring unknown configuration field: _serve_escrow_subgraph
    at config/src/config.rs:59

  2024-11-10T16:07:38.447808Z  WARN indexer_config::config: Ignoring unknown configuration field: _serve_network_subgraph
    at config/src/config.rs:59

  2024-11-10T16:07:38.447810Z  WARN indexer_config::config: Ignoring unknown configuration field: _tap
    at config/src/config.rs:59

  2024-11-10T16:07:38.447811Z  WARN indexer_config::config: Ignoring unknown configuration field: _url_prefix
    at config/src/config.rs:59

This happens because we have in our config the following entries:

[service]
host_and_port = "0.0.0.0:7600"
url_prefix = "/"
serve_network_subgraph = false
serve_escrow_subgraph = false

And the way our prefix works, these environment variables are having some messages because of that:

INDEXER_SERVICE__SERVE_NETWORK_SUBGRAPH
INDEXER_SERVICE__SERVE_ESCROW_SUBGRAPH
INDEXER_SERVICE__HOST_AND_PORT
INDEXER_SERVICE__URL_PREFIX

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at config/src/config.rs:59 and inspect how the INDEXER_SERVICE__ prefixed variables are handled for the listed configuration fields. Reproduce the warnings with the provided configuration and environment variable names; done means supported prefixed variables remain backward compatible without producing unknown-field warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.