Skip to content

DRY/Refactor hard coded config file keys #1646

@dliappis

Description

@dliappis

The motivation of this issue is to prevent bugs like #1645.

The Config object uses various keys for storing configuration properties. Currently many of those get populated during argument parsing (e.g.

rally/esrally/rally.py

Lines 1024 to 1029 in 4c7141a

cfg.add(config.Scope.applicationOverride, "system", "list.config.option", args.configuration)
cfg.add(config.Scope.applicationOverride, "system", "list.max_results", args.limit)
cfg.add(config.Scope.applicationOverride, "system", "admin.track", args.track)
cfg.add(config.Scope.applicationOverride, "system", "list.races.benchmark_name", args.benchmark_name)
cfg.add(config.Scope.applicationOverride, "system", "list.from_date", args.from_date)
cfg.add(config.Scope.applicationOverride, "system", "list.races.to_date", args.to_date)
), and the same keys are referenced, again as strings, in other code locations e.g. in metrics.py.

This approach is brittle and error prone. We should DRY things up and instead reference the config options via meaningful variable names in some module (e.g. config.py) such that a typo becomes a real error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueSmall, contained changes that are good for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions