Jenkins 13493 - Automatic git cache maintenance
JENKINS-13493 - Automatic git cache maintenance
This PR adds git maintenance to the Jenkins controller to optimize the git caches on the controller.
Please refer to Project Page for reference and design: https://www.jenkins.io/projects/gsoc/2022/projects/automatic-git-cache-maintenance/
Checklist
- [x] I have read the CONTRIBUTING doc
- [x] I have referenced the Jira issue related to my changes in one or more commit messages
- [x] I have added tests that verify my changes
- [x] Unit tests pass locally with my changes
- [x] I have added documentation as necessary
- [x] No Javadoc warnings were introduced with my changes
- [x] No spotbugs warnings were introduced with my changes
- [ ] Documentation in README has been updated as necessary
- [ ] Online help has been added and reviewed for any new or modified fields
- [x] I have interactively tested my changes
- [x] Any dependent changes have been merged and published in upstream modules (like git-client-plugin)
Types of changes
- [x] New feature (non-breaking change which adds functionality)
Thank You @MarkEWaite for fixing those tests.
@Hrushi20 it appears there are testing failing in the CI job that were not failing before. I'm on vacation and won't be able to investigate for several weeks. If you have time over the next few weeks, it would be very nice if you could investigate the test failures.
Sure @MarkEWaite I'll look into it. Enjoy your vacation.
Hello @MarkEWaite, I have gone through the failed tests. I realized that the below code is not creating a cache on the Jenkins controller.
sampleRepo1.init();
sampleRepo1.git("checkout", "-b", "bug/JENKINS-42817");
sampleRepo1.write("file", "modified");
sampleRepo1.git("commit", "--all", "--message=dev");
SCMFileSystem fs = SCMFileSystem.of(j.createFreeStyleProject(), new GitSCM(GitSCM.createRepoList(sampleRepo1.toString(), null), Collections.singletonList(new BranchSpec("*/bug/JENKINS-42817")), null, null, Collections.emptyList()));
Before I could access the caches, but now I am not able to create caches. Also, Java 8 clears all the tests. Java 11 and Java 17 fails this test.
Is there a way to create a MultibranchPipeline so that it handle creating the caches.
Hello @MarkEWaite, can you help me fix these failing tests. The problem I am facing right now is that I am not able to create fake caches during tests.
Hello @MarkEWaite, can you help me fix these failing tests. The problem I am facing right now is that I am not able to create fake caches during tests.
I won't be able to help with these tests until after I've completed the release of git client plugin 4.0.0 and git plugin 5.0.0. Those releases are getting all the time that I can allocate to the git plugin and git client plugin.
Hey @MarkEWaite, incremental repack is failing. I'm getting task timeout error. Can you help me with that. I fixed all the other tests. Looking forward to getting this feature merged.
Hey @MarkEWaite, I've updated the code to use ArrayList instead of LinkedList. As we are only storing atmost 5 records per cache, I thought it's an overhead to use LinkedList.
Hey @MarkEWaite, I've fixed all the Unit test Issues. I ran a git rebase and the code is up to date with latest master. There are 2 spotbug issues, I am facing. Should I use the Spotbug flag to neglect such an issue? Looking forward to getting this merged.
Hey @MarkEWaite, I've fixed all the Unit test Issues. I ran a git rebase and the code is up to date with latest master. There are 2 spotbug issues, I am facing. Should I use the Spotbug flag to neglect such an issue? Looking forward to getting this merged.
Hey @MarkEWaite, can we get this code merged?