Page MenuHomeSoftware Heritage

web app: use SWHIDs everywhere in metadata view
Closed, MigratedEdits Locked

Description

Reworking the "show metadata" pop-up in the Web UI is a long-running theme and probably won't be completed soon.

But there is an important low-hanging fruit that we can easily fix: when opening the widget, e.g., from https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/torvalds/linux , the directory, object_id, revision, etc. fields are all showing raw sha1 checksums.
We should instead use SWHIDs everywhere.
It would also be nice to move all SWHIDs to the top of the fields list, because they denote the outgoing edges from the Merkle DAG node that is currently being visited.

Event Timeline

zack triaged this task as Normal priority.Dec 2 2020, 7:40 PM
zack created this task.

For the record, the "show metadata" pop-up was publicly reinstated in order to be able to display the revision metadata associated to a HAL push deposit (CodeMeta format).

Instead of replacing the object ids by SWHIDs (which are already available in the "Permalinks" tab), I propose to simply modify the popup to only display
the metadata associated to a SWH object and hide the "Show metadata" button when there is none.

@zack, @moranegg What do you think about that proposal ?

Oh, good point about the SWHIDs being already available as Permalinks.
I don't know exactly what you mean with "metadata associated to a SWH object", but I'm certainly in favor of reducing information duplication.

In T2848#53963, @zack wrote:

Oh, good point about the SWHIDs being already available as Permalinks.
I don't know exactly what you mean with "metadata associated to a SWH object", but I'm certainly in favor of reducing information duplication.

I mean the metadata stored in a SWH object model. See that revision for instance, the CodeMeta information in JSON format are stored in the metadata field of the Revision model and can only be displayed through the "Show metadata" button. My point is to keep that button in the Web UI only if such metadata exist in the current browsed object and only display those metadata as other displayed info are redundant with the rest of the Web UI.

Sounds good to me.

Everything else currently shown under "show metadata" seems to be either already rendered elsewhere in the page and/or a machine-readable presentation of the same information, which would be best consumed via the Web API for programmatic needs.

(In the feature we will also need to show under "show metadata" other metadata about the object, e.g., from the metadata storage, but that need is already tracked in other tasks.)

Sounds good to me.

Everything else currently shown under "show metadata" seems to be either already rendered elsewhere in the page and/or a machine-readable presentation of the same information, which would be best consumed via the Web API for programmatic needs.

Great, this redundant object metadata display is a relic from the early version of swh-web/browse and only the real object metadata should remain.
Plus this will simplify the Web UI for the majority of swh objects as only a few have metadata stored in their model.

(In the feature we will also need to show under "show metadata" other metadata about the object, e.g., from the metadata storage, but that need is already tracked in other tasks.)

From my point of view, those will need a dedicated tab for displaying them instead of a popup. I think this should be one of the focus for the swh 2021 roadmap.
For the moment, let's implement what proposed above as it will simplify the Web UI while keeping the ability to show stored object metadata.