commit metadata file to repo and explicit cll to save from git_worktree_example.py#6
commit metadata file to repo and explicit cll to save from git_worktree_example.py#6codeskipper wants to merge 10 commits into
Conversation
...to the repo from the cloud-AutoPkg-runner workflows
...to the repo from the cloud-AutoPkg-runner workflows
...to ensure cache is updated in git_worktree_example.py
…n for cache not getting called
...to troubleshoot save function for cache not getting called automatically by __aexit__ method of the context manager
...and some comments to explain the new steps to commit metadata instead of using the GitHub Action cache and the reasoning behind it
| ) | ||
| # Explicitly save the cache after all recipes are processed. | ||
| # The __aexit__ method of the context manager should handle saving automatically, but it does not somehow. | ||
| await cache_plugin.save() |
There was a problem hiding this comment.
Where were you checking for this? Was your check within the async with cache_plugin: block or was it on the same level as the logger below? I know the save works as part of the context manager, so I don't think this line is necessary.
There was a problem hiding this comment.
Sorry I missed your comment earlier.
I put a log debug statement just outside the async with cache_plugin: block when testing in this fork, here.
I just retraced my steps in reverse, and you're right, the save actually DOES get done without the explicit await cache_plugin.save() call. At least when testing this time around.
I must have been misled to believe the cache did not get saved because I was expecting debug output like
shell DEBUG Command output:
json_cache DEBUG Saved all metadata to metadata_cache.json
and there was none in that run.
Neither were there any changes detected in 'metadata_cache.json' in that run even though I expected updated metadata for Chrome recipe in that file in that run. Still unclear to me how that happened.
After commenting out again await cache_plugin.save(), deleting 'metadata_cache.json' from the repo, I can see it gets stored in a new run, even though there is no output like
json_cache DEBUG Saved all metadata to metadata_cache.json
I'll keep an eye out for this going forward when implementing the new design in the Python script for our runner. I need to rework other changes first, so it will be some time before I get to that.
…o check if it is needed Comment out the cache_plugin.save() call to prevent execution.
to check if we need the explicit call to cache_plugin.save() in git_worktree_example.py at https://github.com/codeskipper/cloud-autopkg-runner-examples/blob/943b82c7dac043e5077f3f645f35b04a039eea89/examples/git_worktree_example.py#L135
Uh oh!
There was an error while loading. Please reload this page.