Skip to content

Add a button on the results page to export the raw results_data JSON #17252

Description

@jaredlockhart

Problem

The results page renders a curated view of NimbusExperiment.results_data, but there is no way to get the underlying JSON out of the UI. Anyone who wants the raw analysis payload (to diff against Jetstream's GCS output, to script over, or to hand to DS) has to go through the Django admin or query the DB.

results_data is a plain JSONField on the model, so exporting it is a straight serialization of one field.

Proposed change

  • New nimbus_ui view at <slug>/results/export/ returning experiment.results_data as application/json with a Content-Disposition: attachment header so the browser downloads it as <slug>-results.json.
  • A download button in the results page Overview header, next to "Results last calculated".

No changes to how results_data is computed, stored, or rendered.

Acceptance criteria

  • The results page has a visible export button that downloads the experiment's results_data as a .json file.
  • An experiment with no results yet exports an empty JSON object rather than erroring.
  • The endpoint is covered by a view test.

┆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