feat: add historic git-backed filesystem#217
Open
dmcilvaney wants to merge 4 commits into
Open
Conversation
When creating synthetic dist-gits, there are certain packages that use overlays which mutate the calculated release value for a package. If the overlays are only applied to the last commit in the dist-git, then if a package changes the 'version' of a package the autorelease tool will see the version change ONLY on that last commit, and conclude the release should be reset back to '1'. If we then add another commit to the dist-git, the version should be '2', but the autorelease tool will still see the version bump happen only on the last commit, and again reset the release to '1'. (see kernel-headers for an example) To avoid this, we must apply the overlays to all commits in the dist-git, as they would have appeared at the time of the commit. azldev already abstracts filesystem access through 'fs', so we can implement a 'gitfs' that loads toml configs from the project's git history. A copy-on-write in-memory filesystem allows for writing if necessary.
Contributor
Author
|
Requires #216 for tests to pass |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds infrastructure to load project configuration from a repository’s historical git state, enabling “replay” of overlays across all commits when generating synthetic dist-gits.
Changes:
- Introduces
internal/utils/gitfs— a read-onlyafero.Fsbacked by a git tree at a specific commit, compatible with existing glob/include behavior. - Adds historic project-config entry points (
LoadProjectConfigAtCommit,ResolveComponentOverlaysAtCommit) that read config from git history usinggitfsplus a writable in-memory overlay. - Extends
filepermswith read-only permission constants used by the synthetic/historic filesystem view.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/utils/gitfs/gitfs.go | Implements the git-backed read-only afero.Fs used to read files at a specific commit. |
| internal/utils/gitfs/gitfs_test.go | Validates reading, stat, readdir, doublestar globbing, and read-only behavior for gitfs. |
| internal/utils/fileperms/fileperms.go | Adds ReadOnlyFile / ReadOnlyExec modes for immutable filesystem views. |
| internal/projectconfig/historic.go | Adds APIs to load and resolve project config/overlays at a specific commit using gitfs. |
| internal/projectconfig/historic_test.go | Tests historic config loading and overlay resolution across commits and permissive parsing behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When creating synthetic dist-gits, there are certain packages that use overlays which mutate the calculated release value for a package. If the overlays are only applied to the last commit in the dist-git, then if a package changes the 'version' of a package the autorelease tool will see the version change ONLY on that last commit, and conclude the release should be reset back to '1'. If we then add another commit to the dist-git, the version should be '2', but the autorelease tool will still see the version bump happen only on the last commit, and again reset the release to '1'. (see kernel-headers for an example)
To avoid this, we must apply the overlays to all commits in the dist-git, as they would have appeared at the time of the commit. azldev already abstracts filesystem access through 'fs', so we can implement a 'gitfs' that loads toml configs from the project's git history. A copy-on-write in-memory filesystem allows for writing if necessary.