summaryrefslogtreecommitdiff
path: root/topics/editing/improving-metadata-audit.gmi
blob: 5bcf01c37f1192a472660f3427e1c47a5894dd05 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Improving Metadata Audit

## Tags

* assigned: fredm
* priority: high
* keywords: editing, metadata, metadata audit
* type: documentation
* status: open

## Introduction

There is an existing metadata audit system that tracks the diffs that are added to the system.

The existing system is missing a few things:

* No way to tell the status of the diffs
* Inconsistent way of tracking the user that did the changes
* No way to tell what the dataset type is (Phenotype, Genotype, ProbeSet, ...)
* ...

This document proposes that we do improvements to the existing system to mitigate the list of shortcomings above. Once that is done, it will open up the system for some interesting opportunities, e.g. showing when a trait was last edited and by whom.

## Notes

### Saving Diffs in Database

It turns out, we only store diffs in the database that have been approved. The diffs awaiting processing, or those that have been rejected are not stored.

This makes it a little easier to handle some of the newer features requested.

### Identifying Trait Diffs

* Phenotype diffs can be identified with the `trait_name` and `phenotype_id` keys in the `json_diff_data` field
* Probesets diffs can be identified with the `probeset_name` key in the `json_diff_data` field
* Currently there are no genotype diffs, but following the theme, we should get a `genotype*` key in the `json_diff_data` field

This still means that we cannot simply query data from the table for a specific trait - instead, we will have to query for the dataset_id, and then filter by `(trait/probeset/genotype)_name` as is appropriate for phenotypes, probesets and genotypes respectively.

---

For auth purposes, we will need to fetch the name(s) of the datasets. The authorisation privileges are necessary for filtering out the diffs that a user can act on.