-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use cache to prevent cloning when onboarding repos #17839
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Blocked by #20537 |
After the PR #20537 is merged we won't need to handle the issues (2) and (3) mentioned in the description. A possible solution is discussed in the description I am repeating it here again. For issue (1) (prevent cloning just to check onboarding state)
|
If the commit sha of the default branch and the commit sha of the onboarding branch are unchanged, we 100% should not clone or do any work. If the commit sha of the onboarding branch is changed then we should clone and do work. If only the commit sha of the default branch is changed then I would like to skip cloning unless the onboarding PR has been checked. Like this:
|
Here we decided to skip the PR/branch if checkbox is unchecked regardless the onboarding branch commit sha has changed or not. Except this part what you said above seems fine. |
Yes, please use this logic instead (it makes sense to run/update if the user modifies the config in the onboarding branch) |
Describe the proposed change(s).
Today, while processing repos that are not onboarded, we clone each repo. We can prevent cloning of the repos for which the following conditions match:
I've included the situations that cause in cloning on re-runs below, along with potential workarounds which use cached info:
1. The computation of
isOnboarded
Working:
a) first using API , then the file is absent
b) clone repo and check for the file again
Problem:
API call always returns false for unmerged onboarding PR so we endup cloning on each re-run.
Solution:
Cache an onboarding object while creating onboarding PR and delete it when the PR is merged. That way it's presence will be enough to decide
isOnboarded=false
.We will also need to add logic to invalidate the cache whenever the baseBranch is updated.
2. Rebasing the onboarding branch on each re-run
This one is a tricky problem to solve cause it has an edge case:
(a) When is rebasing required
3. checkoutBranch(onboardingBranchName)
4. mergeRenovateConfig()
Working:
detectConfigFile()
whicha) first uses the api calls to detect any config files in repo then if not found
b) clones the repo and tried to look for it locally
Solution:
onboardingCache
if present use the config stored in it. Else follow normal routine.Not sure if this will need invalidation or maybe the invalidation in
isOnboarded
be enough to handle it here as well.The text was updated successfully, but these errors were encountered: