MetOffice / MetOffice/CMEW

Create new file rather than overwrite original recipe in `configure_for`/`update_recipe`

Open
#237 0 comments 0 reactions 0 assignees View on GitHub
configure enhancement needs refinement recipe rose technical debt
Dominant language
Python
Stars
5
Forks
3
Avg merge
5d 6h
Merged PRs (30d)
8

Description

Issue #18 / #227 automated the modification of the ESMValTool recipe. The code currently overwrites the original recipe with the modified version.

The code should not do this. It should retain the original file and create a modified version as a new file.

Per this @ehogan comment from the PR:

> I notice that the tests have some additional code to handle that the recipe is being overwritten and I also notice the mv step above. I wonder whether there is a way to have the input (original) recipe and the output (modified) recipe in separate locations so that the additional code from the tests (and potentially the mv above) can be removed?

The mv step being referred to is `=mv ${RECIPE_NAME} ${RECIPE_PATH}`.

To consider: by default, `esmvaltool recipes get ${RECIPE_NAME}` doesn't take a directory argument. From memory (needs checking!) the default save location is `{CYLC_WORKFLOW_SHARE_DIR}` itself - which would possibly be undesirable.

Contributor guide

Open the contributing guide

Research direction

Start by locating the configure_for and update_recipe entry points and the tests that account for the recipe being overwritten; inspect the `mv ${RECIPE_NAME} ${RECIPE_PATH}` step and the `esmvaltool recipes get` behavior. Done means the original recipe is retained, a modified recipe is written separately, and the default output location is resolved and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.