Add repository caching and enqueue clone on startup#721
Open
reddevilmidzy wants to merge 3 commits intorust-lang:mainfrom
Open
Add repository caching and enqueue clone on startup#721reddevilmidzy wants to merge 3 commits intorust-lang:mainfrom
reddevilmidzy wants to merge 3 commits intorust-lang:mainfrom
Conversation
reddevilmidzy
commented
Mar 26, 2026
Comment on lines
+25
to
+26
| /// Special pull request number used for clone operations. | ||
| const CLONE_PR_NUMBER: PullRequestNumber = PullRequestNumber(0); |
Member
Author
There was a problem hiding this comment.
I use CLONE_PR_NUMBER = 0 as a synthetic PR ID for clone tasks. Is this OK?
Comment on lines
+185
to
+197
| #[cfg(test)] | ||
| let cache_dir = tempfile::Builder::new() | ||
| .prefix("bors-gitops-cache-") | ||
| .tempdir() | ||
| .expect("Cannot create gitops cache temp dir"); | ||
| #[cfg(not(test))] | ||
| let cache_dir = { | ||
| let base_dir = std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")); | ||
| tempfile::Builder::new() | ||
| .prefix("gitops-cache-") | ||
| .tempdir_in(&base_dir) | ||
| .expect("Cannot create gitops cache temp dir") | ||
| }; |
Member
Author
There was a problem hiding this comment.
I create the cache TempDir internally. Would it be more reasonable to pass the cache directory in as a parameter instead?
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.
close: #693
Add gitops cache with
CloneRepository. and reuse cached bare repos for squash commit transfer.