Open CodeGat opened 2 weeks ago
Do we need the spack parsing functionality in more than one place? If so I'm starting to think it would be good to have a little python library of functions to call for this stuff. It could be something that exposes existing functionality in spack
, or if that isn't convenient, then roll something ourselves.
In the web interface of the build provenance DB, the model components of
access-esm1p5
have an incorrect Version field ofaccess-esm1.5
.This is due to https://github.com/ACCESS-NRI/experiment-metadb/blob/6c78365816419a5bda8e5f1fa116456e53764e49/frontend/src/app/release-provenance/page.js#L33-L34 taking
split("=")[1]
of spec. This is usually okay (see other models), but inaccess-esm1.5
we specifically set the right side of the equals to something that isn't the version.Solution
Update the above linked
split(...)
function to instead take the first capture of the regex^.*@(?:git.)?([^=]+)(?:=.*)?$
instead. For a spec string of the formMODEL@git.TAG=VERSION
, we essentially want theTAG
:^.*@
is the model name and start of version specifier (ex.mom5@
,cice4@
...)(?:git.)?
is a noncapturing optionalgit.
section([^=]+)
is the only captured group, anything before a=
(ex.2024.03.01
,13
,development
...)(?:=.+)?
is a noncapturing optional VERSION section (ex.=2024.03.02
,=access-esm1.5
...)