Skip to content

Add reviewer/editor emails, jetstream error counts, and conclusion recommendations to the CSV and YAML reports #17249

Description

@jaredlockhart

The CSV report (/api/v5/csv/) and the YAML export (/api/v5/yaml/) are missing information that consumers of those dumps need. The usage stats report (/api/v5/csv/usage/) is out of scope.

Add four things to both the CSV and YAML serializers:

  1. Reviewer emails — who approved the experiment. Same definition the usage report already uses in NimbusExperimentUsageStatsView._generate_usage_csv: changelogs with old_publish_status=REVIEW, new_publish_status=APPROVED, taking changed_by.email.
  2. Editor emails — distinct changes.changed_by.email, excluding the automated settings.KINTO_DEFAULT_CHANGELOG_USER.
  3. Jetstream error countsresults_data["v3"]["errors"] is {metric_slug: [AnalysisError, ...], "experiment": [...]}. A total count on the CSV, per-key counts on the YAML. Related existing property: NimbusExperiment.has_results_errors.
  4. Conclusion recommendations on the CSV. The other takeaways fields (takeaways_metric_gain, takeaways_gain_amount, takeaways_qbr_learning, takeaways_summary) are already there, and the YAML additionally carries conclusion_recommendation_labels, project_impact and next_steps. The CSV should carry the same takeaways set as the YAML.

Approach

Add short convenience properties to NimbusExperiment for each value, unit test those directly, then add the field names to NimbusExperimentCsvSerializer.Meta.fields and NimbusExperimentYamlSerializer.Meta.fields. NimbusExperimentCsvRenderer derives its header from NimbusExperimentCsvSerializer.Meta.fields, so new CSV columns appear automatically.

Performance

Both list views serialize the full experiment set (non-archived for the CSV, Complete for the YAML), so the reviewer/editor properties need a changelog prefetch on both querysets. The prefetch must defer NimbusChangeLog.experiment_data, which holds a full experiment JSON snapshot per changelog row.

Acceptance criteria

  • NimbusExperiment has a convenience property per value above, each with direct unit tests
  • Both new columns/keys appear in the CSV and the YAML export
  • The CSV carries the same takeaways set as the YAML
  • Both list querysets prefetch changelogs with experiment_data deferred
  • Usage stats report unchanged

┆Issue is synchronized with this Jira Task

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions