Page MenuHomeSoftware Heritage

sphinx: Fix the creation of the pre-commit file during the mr update
ClosedPublic

Authored by vsellier on May 4 2021, 7:00 PM.

Details

Summary

Change the default permission of the ~jenkins/.cache directory
created by the --mount option on the RUN command
It fixes all the following errors:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jenkins/.local/bin/pre-commit", line 10, in <module>
    sys.exit(main())
  File "/home/jenkins/.local/lib/python3.7/site-packages/pre_commit/main.py", line 398, in main
    f'Command {args.command} failed to exit with a returncode',
  File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/jenkins/.local/lib/python3.7/site-packages/pre_commit/error_handler.py", line 73, in error_handler
    _log_and_exit(msg, ret_code, e, traceback.format_exc())
  File "/home/jenkins/.local/lib/python3.7/site-packages/pre_commit/error_handler.py", line 24, in _log_and_exit
    storedir = Store().directory
  File "/home/jenkins/.local/lib/python3.7/site-packages/pre_commit/store.py", line 52, in __init__
    os.makedirs(self.directory, exist_ok=True)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/jenkins/.cache/pre-commit'
Test Plan
make
docker run --rm -ti --entrypoint bash swh-jenkins/sphinx
mkdir ~/workspace
cd ~/workspace
git clone https://forge.softwareheritage.org/source/swh-environment.git
mr -j 4 -t update

there is no more errors

Diff Detail

Repository
rCDFJ Dockerfiles for Jenkins
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vsellier created this revision.
ardumont added a subscriber: ardumont.

Thanks.

Less warnings to distract us when something goes wrong in the build.

This revision is now accepted and ready to land.May 5 2021, 9:10 AM