From b26e834eb656e1206ba01f0bbd2ad52a97ec5e2c Mon Sep 17 00:00:00 2001
From: nod_ <nod_@598310.no-reply.drupal.org>
Date: Sun, 28 Jul 2024 15:15:36 +0200
Subject: [PATCH] Issue #3428614 by catch, nod_, longwave: Resync
 .gitlab-ci.yml and .gitignore following Yarn 4 in 11.x

(cherry picked from commit 19c608d552a3bbedc554a2f975b1bd4f1a4307b0)
---
 .gitlab-ci.yml                         | 20 ++++++++++++++------
 .gitlab-ci/pipeline.yml                |  4 +++-
 core/.cspell.json                      |  2 ++
 core/misc/cspell/drupal-dictionary.txt |  1 +
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 60cea25d09a8..52694a824202 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -358,7 +358,9 @@ default:
     paths:
       - core/node_modules/
   script:
-    - yarn --cwd ./core install
+    - cd core
+    - corepack enable
+    - yarn install
 
 ################
 # Lint Jobs
@@ -425,8 +427,10 @@ default:
     - when: manual
       allow_failure: true
   script:
-    - yarn --cwd=./core run -s check:ckeditor5
-    - yarn --cwd=./core run -s lint:core-js-passing --format gitlab
+    - cd core
+    - corepack enable
+    - yarn run check:ckeditor5
+    - yarn run lint:core-js-passing --format gitlab
   artifacts:
     reports:
       codequality: eslint-quality-report.json
@@ -449,8 +453,10 @@ default:
     - when: manual
       allow_failure: true
   script:
-    - yarn run --cwd=./core build:css --check
-    - yarn run --cwd=./core lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab
+    - corepack enable
+    - cd core
+    - yarn run build:css --check
+    - yarn run lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab
   artifacts:
     reports:
       codequality: stylelint-quality-report.json
@@ -466,8 +472,10 @@ default:
       else
         echo "HEAD is $(git rev-parse HEAD). \$CI_MERGE_REQUEST_DIFF_BASE_SHA is ${CI_MERGE_REQUEST_DIFF_BASE_SHA}";
       fi;
+    - cd core
+    - corepack enable
     - git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only 2>1 > /dev/null || (echo "Warning, cannot find changed files, converting to full clone." & (git fetch --unshallow --quiet && echo "Fetch successful."))
-    - git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin
+    - git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn run -s spellcheck:core --no-must-find-files --file-list stdin
 
 '📔 Validatable config':
   <<: [ *default-job-settings-lint ]
diff --git a/.gitlab-ci/pipeline.yml b/.gitlab-ci/pipeline.yml
index ff7436723803..21b0808dca8e 100644
--- a/.gitlab-ci/pipeline.yml
+++ b/.gitlab-ci/pipeline.yml
@@ -195,7 +195,9 @@ variables:
     - echo "DRUPAL_NIGHTWATCH_OUTPUT='"../nightwatch_output"'" >> ./core/.env
     - echo "COLUMNS=1000" >> ./core/.env
     - chown -R www-data:www-data ./sites /var/www
-    - sudo -u www-data yarn run --cwd=./core test:nightwatch --workers=4
+    - cd core
+    - corepack enable
+    - sudo -u www-data yarn run test:nightwatch --workers=4
   after_script:
     - cp /builds/chromedriver.log ./
   artifacts:
diff --git a/core/.cspell.json b/core/.cspell.json
index 4253029b2873..1b137046cde1 100644
--- a/core/.cspell.json
+++ b/core/.cspell.json
@@ -38,6 +38,8 @@
       "MAINTAINERS.txt",
       "package.json",
       "yarn.lock",
+      ".yarnrc.yml",
+      ".yarn/*",
       "misc/cspell/dictionary.txt",
       "phpstan*"
     ],
diff --git a/core/misc/cspell/drupal-dictionary.txt b/core/misc/cspell/drupal-dictionary.txt
index 734ad8e1aaac..0f2405c2ea2f 100644
--- a/core/misc/cspell/drupal-dictionary.txt
+++ b/core/misc/cspell/drupal-dictionary.txt
@@ -1,4 +1,5 @@
 bartik
+corepack
 dblog
 dependee
 dependee's
-- 
GitLab