Skip to content

[unified analytics] add utilities to compute analytics ENV vars #2343

Description

@pq

Clients that want to flow top-level tool and analytics suppression to sub-tools via the system environment will benefit from a few shared utility methods.

Tentatively:

/// Compute whether to suppress analytics based on the environment variable
/// `DASH__SUPPRESS_ANALYTICS`.
bool computeSuppressAnalytics({bool defaultValue = false})

/// Compute the top-level tool from the environment variable `DASH__TOOL`.
DashTool computeTopLevelTool(DashTool current)

and a new enum:

/// Environment variables used by the unified analytics package.
enum DashEnvVar {
  /// Environment variable used to suppress analytics.
  suppressAnalytics('DASH__SUPPRESS_ANALYTICS'),

  /// Environment variable used to specify the top-level tool.
  tool('DASH__TOOL');

  final String name;
  const DashEnvVar(this.name);
}

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failurespackage:unified_analytics
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions