Problem/Motivation
Currently core/scripts/dev/commit-code-check.sh is broken on DrupalCI due git security improvements and our CI. Let's fix this.
It fails due to:
16:35:03 Container command.
16:35:03 core/scripts/dev/commit-code-check.sh --drupalci
16:35:03 fatal: detected dubious ownership in repository at '/var/www/html'
16:35:03 To add an exception for this directory, call:
16:35:03
16:35:03 git config --global --add safe.directory /var/www/html
16:35:03 Creating list of files to check by comparing branch to 10.1.x
16:35:03 error: Could not access 'HEAD~1'
16:35:03 fatal: detected dubious ownership in repository at '/var/www/html'
16:35:03 To add an exception for this directory, call:
16:35:03
16:35:03 git config --global --add safe.directory /var/www/html
16:35:03 There are no files to check. If you have staged a commit use the --cached option.
https://dispatcher.drupalci.org/job/drupal8_core_regression_tests/77420/...
Proposed resolution
I think using the www-data to run git commands.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3343495-2.patch | 1.98 KB | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottThe patch in #2 works nicely...
Comment #4
lauriiiFix is pretty interesting but I think I remember seeing this when working on DrupalCI so it’s a pre-existing thing. Works for me given that tests pass.
Comment #5
alexpottI've run phpstan, phpcs, cspell, prettier, stylelint, eslint and it is all passing.
Comment #9
larowlanCommitted to 10.1.x and backported all the way to 9.4.x
Comment #11
drumm(Updating to resolve Drupal.org issue indexing issue, please disregard.)
Comment #12
wim leersFor archeology sake: I discovered & reported this at #3314151-9: Fix cspell use: specify globRoot and always pass --root to cspell.
Comment #13
wim leersI can't believe @alexpott figured out the correct solution so quickly and @larowlan committed it … all after my late EOD yesterday, meaning that in my new workday, this problem is 100% gone 🤩🤯