Skip to content
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

Git cleanup for node-test-* #893

Closed
gibfahn opened this issue Sep 22, 2017 · 2 comments
Closed

Git cleanup for node-test-* #893

gibfahn opened this issue Sep 22, 2017 · 2 comments

Comments

@gibfahn
Copy link
Member

gibfahn commented Sep 22, 2017

Noticed that node-test-linter was giving this:

+ git rebase --committer-date-is-author-date 84063a73144fba50ef55373a26bcbb589b8d156c
First, rewinding head to replay your work on top of it...
Applying: test: defer abort with setTimeout
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
error: The last gc run reported the following. Please correct the root cause
and remove .git/gc.log.
Automatic cleanup will not be performed until the file is removed.

warning: There are too many unreachable loose objects; run 'git prune' to remove them.

I ran git gc && git prune, and it seems happier now. I assume this should be done on all the machines from time to time.

Thoughts on how we might automate this?

@joaocgreis
Copy link
Member

rm -rf .git or even the whole job workspace is better, there have been issues with git gc hanging in the past. Jenkins will clone again and start in a clean state in the next job run.

We could add this to the end of jobs, running only if older than some time or bigger than some space. Or perhaps better, create a job that runs on all workers once a month that scans the jenkins workspace and deletes every job workspace (or just .git folders).

There are already some steps in this direction:

  • The git-rpi-clean job runs weekly to delete the workspaces on Raspberry Pis. Since they are slow, it clones the repos again right away to save time on the next test job.
  • There used to be a post-action in node-test-binary-windows to clean the matrix (jenkins-workspace) workspace, but it was deleted by a jenkins update (same as status posting to PRs). For now this is back to manual.
  • The git-rebase job has a git remote prune origin (not git prune) line that runs every time, because the refspec it uses was causing issues with fetching from repos of different users. This is not a problem with refspecs that don't fetch all branches.

@refack
Copy link
Contributor

refack commented Nov 17, 2018

Sort of resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants