-
Notifications
You must be signed in to change notification settings - Fork 17
Make the cpx cache layer atomic and concurrent-safe #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4c80c7a
Add locking and atomic filesystem primitives
WendellAdriel 2d87a12
Rework package cache and metadata for atomic, concurrent-safe writes
WendellAdriel e90eb8f
Wire commands and exec cache onto the new metadata layer
WendellAdriel 7da8dd3
Protect freshly installed packages from clean
WendellAdriel 4195417
Name the seconds-per-day magic number in clean
WendellAdriel b1cf503
Drive the clean command with an interactive Prompts UX
WendellAdriel a528779
Harden the exec sandbox and metadata cache layer
WendellAdriel b3ff829
formatting
joetannenbaum d79206d
remove redundant check
joetannenbaum 4b9d12f
tighten normalize timestamp
joetannenbaum afbcb1e
extract resolve days to method
joetannenbaum c738602
Update CleanCommand.php
joetannenbaum 34fbcc2
Drop the unused aliases scaffolding from the metadata cache
WendellAdriel 2b31c51
Prune empty parent directories after clean removes a cache
WendellAdriel 364325f
Guard the exec output flush against a failed buffer read
WendellAdriel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Cpx\Cache; | ||
|
|
||
| class ExecSandboxMetadata | ||
| { | ||
| /** | ||
| * @param list<string> $packages | ||
| */ | ||
| public function __construct( | ||
| public readonly string $key, | ||
| public array $packages = [], | ||
| public ?int $lastUpdatedAt = null, | ||
| public ?int $lastRunAt = null, | ||
| ) { | ||
| // | ||
| } | ||
|
|
||
| public static function rootPath(): string | ||
| { | ||
| return cpx_path('.exec_cache'); | ||
| } | ||
|
|
||
| public static function pathFor(string $key): string | ||
| { | ||
| return cpx_path(".exec_cache/{$key}"); | ||
| } | ||
|
|
||
| public function path(): string | ||
| { | ||
| return self::pathFor($this->key); | ||
| } | ||
| } |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just setup for another PR? Looks like it's just scaffolding in this context, should we hold off on this until we know how we're going to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was just scaffolding, I'll remove it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once removed merge away 🫡