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:
- 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.
- Editor emails — distinct
changes.changed_by.email, excluding the automated settings.KINTO_DEFAULT_CHANGELOG_USER.
- Jetstream error counts —
results_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.
- 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
┆Issue is synchronized with this Jira Task
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:
NimbusExperimentUsageStatsView._generate_usage_csv: changelogs withold_publish_status=REVIEW,new_publish_status=APPROVED, takingchanged_by.email.changes.changed_by.email, excluding the automatedsettings.KINTO_DEFAULT_CHANGELOG_USER.results_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.takeaways_metric_gain,takeaways_gain_amount,takeaways_qbr_learning,takeaways_summary) are already there, and the YAML additionally carriesconclusion_recommendation_labels,project_impactandnext_steps. The CSV should carry the same takeaways set as the YAML.Approach
Add short convenience properties to
NimbusExperimentfor each value, unit test those directly, then add the field names toNimbusExperimentCsvSerializer.Meta.fieldsandNimbusExperimentYamlSerializer.Meta.fields.NimbusExperimentCsvRendererderives its header fromNimbusExperimentCsvSerializer.Meta.fields, so new CSV columns appear automatically.Performance
Both list views serialize the full experiment set (non-archived for the CSV,
Completefor the YAML), so the reviewer/editor properties need a changelog prefetch on both querysets. The prefetch must deferNimbusChangeLog.experiment_data, which holds a full experiment JSON snapshot per changelog row.Acceptance criteria
NimbusExperimenthas a convenience property per value above, each with direct unit testsexperiment_datadeferred┆Issue is synchronized with this Jira Task