Consider Write out OCI layers as binary files instead of main.json/source.zip/etc - may require versioning the module cache
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 81
Description
We don't need to do this now, but the next time we add new files, we should discuss it. Right now, there is an optional source.gzp file that is added to the module cache when restoring a module with source code. But old versions of bicep don't know about it. So if an older version of bicep restores a module, and then the user uses a newer version that supports sources, it will not see the source code unless the user explicitly force restores modules in the newer version.
This could happen whenever we add a new optional file.
Best solution I think is to write out all the OCI layers as separate files into the module cache, e.g.:
layer.1
layer.2
layer2. might be source code, or it might be something else. Older versions of bicep can restore all layers in the OCI but don't have to process them if they don't know what they are. The newer versions will know how to deal with them, but either version will correctly restoroe modules.
We might also need to consider versioning the module cache for the same reason - having a module cache stored among all versions of bicep means it has to be both backwards and forwards compatible.
Regarding versioning the cache, from @shenglol:
> Personally I prefer
> cacheroot/br/modules/v2
> cacheroot/br/providers/v2
> cacheroot/ts
Contributor guide
Research direction
The issue names no files or tests; start by tracing module restore and the OCI layer/module-cache layout, including cacheroot/br/modules/v2 and cacheroot/br/providers/v2. Done means agreeing on a backward- and forward-compatible cache design for all OCI layers and any required cache versioning.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100