Skip to content

commit metadata file to repo and explicit cll to save from git_worktree_example.py#6

Open
codeskipper wants to merge 10 commits into
MScottBlake:mainfrom
codeskipper:save-and-commit-metadata
Open

commit metadata file to repo and explicit cll to save from git_worktree_example.py#6
codeskipper wants to merge 10 commits into
MScottBlake:mainfrom
codeskipper:save-and-commit-metadata

Conversation

@codeskipper

@codeskipper codeskipper commented Mar 7, 2026

Copy link
Copy Markdown
  • commit metadata file to repo instead of cache is the easiest way to allow it to be updated. Needed because GitHub Action cache has no update feature for the cache, see update-a-cache and workaround by deleting and re-creating cache.
  • fix to save metadata in git_worktree_example.py by explicit call to cache plugin save(), it was expected to do this implicitly but did not somehow

 ...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
...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
Comment thread examples/git_worktree_example.py Outdated
)
# 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()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants