ACCESS-NRI / access-nri-intake-catalog

Tools and configuration info used to manage ACCESS-NRI's intake catalogue
https://access-nri-intake-catalog.rtfd.io
Apache License 2.0
8 stars 1 forks source link

[BUG] handle case where there is an existing catalog that doesn't conform to new catalog format #246

Closed marc-white closed 1 week ago

marc-white commented 1 week ago

Describe the bug

Of course I realized something just after the PR #243 was merged... (following on from #191)

The catalog builder is going to have issues the first time we run it, because there is an existing catalog in the live directory, but it doesn't match the new catalog.yaml structure. Specifically, there isn't a min or max version in the old catalog, so cli::build will throw a KeyError when it tries to read them.

To Reproduce

Will only occur if a live build process is triggered (not recommended right now).

Additional context

We could, of course, solve this outside code by simply deleting the existing catalog.yaml before we do our first new catalog build. However, this would leave users inexplicably unable to access intake.cat.access_nri for a few hours while that happens.

My solution will be to effectively treat this situation as if there is no existing catalog.yaml, but without having to cripple the system while the new catalog builds.

marc-white commented 1 week ago

The complication is we want to keep the storage flags from the old catalog. I'm re-jigging the catalog overwrite/move logic to accommodate this.