influxdata / influxdata/influxdb

Make resource-type-filter specification case insensitive in `/templates/export` API

Open
#21,729 0 comments 0 reactions 0 assignees View on GitHub
area/2.x area/templates
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Proposal:__
Users of the `/templates/export` API shouldn't need to know that filters on resource-types must be specified in TitleCase.

__Current behavior:__
If a user passes `--filter kind=bucket` to `influx export all`:
1. The CLI complains about an "unsupported kind"
2. With an updated CLI that doesn't try to parse resource-kinds, the server also rejects the value as an "unsupported kind"

__Desired behavior:__
It would be nice if the server used a case-insensitive match when parsing filters on resource type.

__Alternatives considered:__
We could keep the strict case-sensitivity of the filters, and push the list of possible values through to the "edges" of our clients. IMO this creates an unnecessarily tight coupling between client and server, and can lead to situations where the client breaks because the server it's talking to was updated & started exporting new API types that aren't in the list the client was hard-coded to accept.

__Use case:__
* Improves the UX of `export` commands in the CLI
* Allows for loose coupling between CLI and server versions

Contributor guide

Open the contributing guide

Research direction

Start at the `/templates/export` API filter parsing entry point and the `influx export all` CLI path, tracing how `kind` values are validated on each side. Confirm the desired behavior with existing export-related tests or add coverage showing that resource-type filters match regardless of case, while unsupported kinds remain rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.