denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

Definitions commit info in object_metadata #68

Closed gjost closed 5 years ago

gjost commented 6 years ago

The object_metadata section on repository objects' JSON files contains the filepath of the ddr-defs file used to write the object, but it does not include the file's Git commit which indicates which version of the file was used. Instead of (or alongside) the file path, we should store the ddr-defs Git origin remote and the commit hash.

UPDATE: Grab the Git info at the time definitions are imported and cache so we're not running git-status on each page save.

gjost commented 6 years ago

Relevant values in the object file "metadata pod":

Note: These values are used in ddr-local to generate those messages about whether document model definitions are SAME/AHEAD/BEHIND.

ddr-local settings.py runs dvcs.latest_commit on the ddr-defs repository (also ddr-cmdln and ddr-local itself) when settings.py is first imported.

ddr-cmdln (which actually writes object metadata files, gets commits for the "metadata pod" at write time.

gjost commented 5 years ago

models_commit was always what we were looking for. Changed to defs_commit to fit current terminology.

Fixed in commit 81f981b