From 97a567df370b5f5670afac9e5be3fbfa379d529b Mon Sep 17 00:00:00 2001
From: Stan Hu <stanhu@gmail.com>
Date: Wed, 5 Jun 2024 09:50:29 -0700
Subject: [PATCH] Add frontend scripts to assets hash calculation

When https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154544
changed `scripts/frontend/tailwind_all_the_way.mjs`, it modified the
Tailwind CSS but `GITLAB_ASSETS_HASH` was not updated.

To avoid this issue, include all the JavaScript scripts in
`scripts/frontend`.

Relates to
https://gitlab.com/gitlab-com/gl-infra/production/-/issues/18107

Changelog: fixed
---
 lib/tasks/gitlab/assets.rake | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/tasks/gitlab/assets.rake b/lib/tasks/gitlab/assets.rake
index 9ff4f05c086d3..f6bb94fa6512c 100644
--- a/lib/tasks/gitlab/assets.rake
+++ b/lib/tasks/gitlab/assets.rake
@@ -9,12 +9,11 @@ module Tasks
       # In the new caching strategy, we check the assets hash sum *before* compiling
       # the app/assets/javascripts/locale/**/app.js files. That means the hash sum
       # must depend on locale/**/gitlab.po.
-      JS_ASSET_PATTERNS = %w[*.js config/**/*.js locale/**/gitlab.po].freeze
+      JS_ASSET_PATTERNS = %w[*.js config/**/*.js scripts/frontend/*.{mjs,js} locale/**/gitlab.po].freeze
       JS_ASSET_FILES = %w[
         package.json
         yarn.lock
         babel.config.js
-        config/webpack.config.js
         .nvmrc
       ].freeze
       # Ruby gems might emit assets which have an impact on compilation
-- 
GitLab