Skip to content

Commit 3538972

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 1403e9b commit 3538972

File tree

83 files changed

+792
-584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+792
-584
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
VERSION merge=ours
22
Dangerfile gitlab-language=ruby
3-
*.pdf filter=lfs diff=lfs merge=lfs -text
43
*.rb diff=ruby
54
workhorse/testdata/*.pdf -filter -diff -merge

.gitlab/ci/caching.gitlab-ci.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
cache-workhorse:
2+
extends:
3+
- .default-retry
4+
- .default-before_script
5+
- .rails-cache
6+
- .setup-test-env-cache
7+
- .caching:rules:cache-workhorse
8+
stage: prepare
9+
variables:
10+
SETUP_DB: "false"
11+
script:
12+
- source scripts/gitlab_component_helpers.sh
13+
- 'gitlab_workhorse_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }'
14+
- run_timed_command "scripts/setup-test-env"
15+
- run_timed_command "select_gitlab_workhorse_essentials"
16+
- run_timed_command "create_gitlab_workhorse_package"
17+
- run_timed_command "upload_gitlab_workhorse_package"
18+
artifacts:
19+
expire_in: 7d
20+
paths:
21+
- ${TMP_TEST_GITLAB_WORKHORSE_PATH}/
22+
23+
.cache-assets-base:
24+
extends:
25+
- .compile-assets-base
26+
- .caching:rules:cache-assets
27+
stage: prepare
28+
variables:
29+
WEBPACK_REPORT: "false"
30+
script:
31+
- !reference [.yarn-install, script]
32+
- export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum | tee assets-hash.txt)
33+
- source scripts/gitlab_component_helpers.sh
34+
- 'gitlab_assets_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }'
35+
# If we still use the legacy cache, we don't want to create a package from it as we don't check the sha sum in gitlab:assets:compile_with_new_strategy.
36+
# This line can be removed once we stop downloading the legacy cache.
37+
- rm -rf public/assets
38+
- run_timed_command "bin/rake gitlab:assets:compile_with_new_strategy"
39+
- run_timed_command "scripts/clean-old-cached-assets"
40+
- run_timed_command "create_gitlab_assets_package"
41+
- run_timed_command "upload_gitlab_assets_package"
42+
43+
cache-assets:test:
44+
extends: .cache-assets-base
45+
46+
cache-assets:test as-if-foss:
47+
extends:
48+
- .cache-assets-base
49+
- .as-if-foss
50+
51+
cache-assets:production:
52+
extends: .cache-assets-base
53+
variables:
54+
NODE_ENV: "production"
55+
RAILS_ENV: "production"

.gitlab/ci/frontend.gitlab-ci.yml

+27-18
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
.yarn-install: &yarn-install
2-
- source scripts/utils.sh
3-
- run_timed_command "retry yarn install --frozen-lockfile"
1+
.yarn-install:
2+
script:
3+
- source scripts/utils.sh
4+
- run_timed_command "retry yarn install --frozen-lockfile"
45

5-
.storybook-yarn-install: &storybook-yarn-install
6-
- source scripts/utils.sh
7-
- run_timed_command "retry yarn run storybook:install --frozen-lockfile"
6+
.storybook-yarn-install:
7+
script:
8+
- source scripts/utils.sh
9+
- run_timed_command "retry yarn run storybook:install --frozen-lockfile"
810

911
.compile-assets-base:
1012
extends:
@@ -21,8 +23,17 @@
2123
WEBPACK_COMPILE_LOG_PATH: "tmp/webpack-output.log"
2224
stage: prepare
2325
script:
24-
- *yarn-install
25-
- run_timed_command "bin/rake gitlab:assets:compile"
26+
- !reference [.yarn-install, script]
27+
- |
28+
# The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable
29+
if [[ "${CACHE_ASSETS_AS_PACKAGE}" == "true" ]]; then
30+
export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum | tee assets-hash.txt)
31+
source scripts/gitlab_component_helpers.sh
32+
run_timed_command "download_and_extract_gitlab_assets" || true
33+
run_timed_command "bin/rake gitlab:assets:compile_with_new_strategy"
34+
else
35+
run_timed_command "bin/rake gitlab:assets:compile"
36+
fi
2637
- run_timed_command "scripts/clean-old-cached-assets"
2738

2839
compile-production-assets:
@@ -42,8 +53,6 @@ compile-production-assets:
4253
- public/assets/
4354
- "${WEBPACK_COMPILE_LOG_PATH}"
4455
when: always
45-
before_script:
46-
- !reference [.default-before_script, before_script]
4756
after_script:
4857
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
4958

@@ -88,7 +97,7 @@ update-yarn-cache:
8897
- .shared:rules:update-cache
8998
stage: prepare
9099
script:
91-
- *yarn-install
100+
- !reference [.yarn-install, script]
92101

93102
update-storybook-yarn-cache:
94103
extends:
@@ -97,7 +106,7 @@ update-storybook-yarn-cache:
97106
- .shared:rules:update-cache
98107
stage: prepare
99108
script:
100-
- *storybook-yarn-install
109+
- !reference [.storybook-yarn-install, script]
101110

102111
.frontend-fixtures-base:
103112
extends:
@@ -180,7 +189,7 @@ graphql-schema-dump as-if-foss:
180189
SETUP_DB: "false"
181190
before_script:
182191
- !reference [.default-before_script, before_script]
183-
- *yarn-install
192+
- !reference [.yarn-install, script]
184193
stage: test
185194

186195
.jest-base:
@@ -256,7 +265,7 @@ coverage-frontend:
256265
optional: true
257266
stage: post-test
258267
before_script:
259-
- *yarn-install
268+
- !reference [.yarn-install, script]
260269
script:
261270
- run_timed_command "yarn node scripts/frontend/merge_coverage_frontend.js"
262271
# Removing the individual coverage results, as we just merged them.
@@ -282,7 +291,7 @@ coverage-frontend:
282291
stage: test
283292
dependencies: []
284293
script:
285-
- *yarn-install
294+
- !reference [.yarn-install, script]
286295
- run_timed_command "retry yarn run webpack-prod"
287296

288297
qa-frontend-node:14:
@@ -310,7 +319,7 @@ webpack-dev-server:
310319
WEBPACK_MEMORY_TEST: "true"
311320
WEBPACK_VENDOR_DLL: "true"
312321
script:
313-
- *yarn-install
322+
- !reference [.yarn-install, script]
314323
- run_timed_command "retry yarn webpack-vendor"
315324
- run_timed_command "node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js"
316325
artifacts:
@@ -328,7 +337,7 @@ bundle-size-review:
328337
stage: test
329338
needs: []
330339
script:
331-
- *yarn-install
340+
- !reference [.yarn-install, script]
332341
- scripts/bundle_size_review
333342
artifacts:
334343
when: always
@@ -366,7 +375,7 @@ startup-css-check as-if-foss:
366375
- .frontend-test-base
367376
- .storybook-yarn-cache
368377
script:
369-
- *storybook-yarn-install
378+
- !reference [.storybook-yarn-install, script]
370379
- yarn run storybook:build
371380
needs: ["graphql-schema-dump"]
372381

.gitlab/ci/global.gitlab-ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@
7979
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
8080

8181
.assets-cache: &assets-cache
82-
key: "assets-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}-node-${NODE_ENV}-v2"
82+
key: "assets-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}-node-${NODE_ENV}-v3"
83+
# This list should match GITLAB_ASSETS_PATHS_LIST from scripts/gitlab_component_helpers.sh
8384
paths:
8485
- assets-hash.txt
85-
- public/assets/webpack/
86+
- app/assets/javascripts/locale/**/app.js
87+
- public/assets/
8688
- tmp/cache/assets/sprockets/
8789
- tmp/cache/babel-loader/
8890
- tmp/cache/vue-loader/

.gitlab/ci/rails.gitlab-ci.yml

+1-17
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ setup-test-env:
168168
SETUP_DB: "false"
169169
script:
170170
- echo $CI_MERGE_REQUEST_APPROVED
171-
- source scripts/gitlab_workhorse_component_helpers.sh
171+
- source scripts/gitlab_component_helpers.sh
172172
- run_timed_command "download_and_extract_gitlab_workhorse_package" || true
173173
- run_timed_command "scripts/setup-test-env"
174174
- run_timed_command "select_gitlab_workhorse_essentials"
@@ -197,22 +197,6 @@ setup-test-env:
197197
- ${TMP_TEST_GITLAB_WORKHORSE_PATH}/
198198
when: always
199199

200-
build-components:
201-
extends:
202-
- setup-test-env
203-
- .rails:rules:build-components
204-
script:
205-
- source scripts/gitlab_workhorse_component_helpers.sh
206-
- 'gitlab_workhorse_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }'
207-
- run_timed_command "scripts/setup-test-env"
208-
- run_timed_command "select_gitlab_workhorse_essentials"
209-
- run_timed_command "create_gitlab_workhorse_package"
210-
- run_timed_command "upload_gitlab_workhorse_package"
211-
artifacts:
212-
expire_in: 7d
213-
paths:
214-
- ${TMP_TEST_GITLAB_WORKHORSE_PATH}/
215-
216200
update-setup-test-env-cache:
217201
extends:
218202
- setup-test-env

.gitlab/ci/rules.gitlab-ci.yml

+44-10
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,21 @@
249249
- "babel.config.js"
250250
- "config/webpack.config.js"
251251
- "config/**/*.js"
252+
- "{,ee/,jh/}app/assets/**/*"
252253
- "vendor/assets/**/*"
254+
255+
# This list should match the list in Tasks::Gitlab::Assets.assets_impacting_compilation
256+
.assets-compilation-patterns: &assets-compilation-patterns
257+
- "{package.json,yarn.lock}"
258+
- ".browserslistrc"
259+
- "babel.config.js"
260+
- "config/webpack.config.js"
261+
- "*.js"
262+
- "config/**/*.js"
263+
- "locale/**/gitlab.po"
253264
- "{,ee/,jh/}app/assets/**/*"
265+
- "fixtures/emojis/**/*"
266+
- "vendor/assets/**/*"
254267

255268
.frontend-patterns-for-as-if-foss: &frontend-patterns-for-as-if-foss
256269
- "{package.json,yarn.lock}"
@@ -652,6 +665,37 @@
652665
- changes: *ci-build-images-patterns
653666
- changes: *code-qa-patterns
654667

668+
#################
669+
# Caching rules #
670+
#################
671+
.caching:rules:cache-workhorse:
672+
rules:
673+
- <<: *if-dot-com-ee-schedule
674+
- <<: *if-dot-com-gitlab-org-default-branch
675+
changes: ["workhorse/**/*"]
676+
- <<: *if-dot-com-gitlab-org-merge-request
677+
changes:
678+
- ".gitlab/ci/caching.gitlab-ci.yml"
679+
- "scripts/gitlab_component_helpers.sh"
680+
when: manual
681+
allow_failure: true
682+
683+
.caching:rules:cache-assets:
684+
rules:
685+
# The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable
686+
- if: '$CACHE_ASSETS_AS_PACKAGE != "true"'
687+
when: never
688+
- <<: *if-dot-com-ee-schedule
689+
- <<: *if-dot-com-gitlab-org-default-branch
690+
changes: *assets-compilation-patterns
691+
- <<: *if-dot-com-gitlab-org-merge-request
692+
changes:
693+
- ".gitlab/ci/caching.gitlab-ci.yml"
694+
- "scripts/gitlab_component_helpers.sh"
695+
- "lib/tasks/gitlab/assets.rake"
696+
when: manual
697+
allow_failure: true
698+
655699
######################
656700
# CI Templates Rules #
657701
######################
@@ -969,16 +1013,6 @@
9691013
###############
9701014
# Rails rules #
9711015
###############
972-
.rails:rules:build-components:
973-
rules:
974-
- <<: *if-dot-com-ee-schedule
975-
- <<: *if-dot-com-gitlab-org-default-branch
976-
changes:
977-
- "workhorse/**/*"
978-
- <<: *if-dot-com-gitlab-org-merge-request
979-
when: manual
980-
allow_failure: true
981-
9821016
.rails:rules:setup-test-env:
9831017
rules:
9841018
- changes: *setup-test-env-patterns

.rubocop_todo/rails/helper_instance_variable.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
Rails/HelperInstanceVariable:
3-
# Offense count: 671
4-
# Temporarily disabled due to too many offenses
5-
Enabled: false
3+
Details: grace period
64
Exclude:
75
- 'app/helpers/admin/user_actions_helper.rb'
86
- 'app/helpers/application_helper.rb'
@@ -29,7 +27,6 @@ Rails/HelperInstanceVariable:
2927
- 'app/helpers/icons_helper.rb'
3028
- 'app/helpers/ide_helper.rb'
3129
- 'app/helpers/import_helper.rb'
32-
- 'app/helpers/integrations_helper.rb'
3330
- 'app/helpers/issuables_description_templates_helper.rb'
3431
- 'app/helpers/issuables_helper.rb'
3532
- 'app/helpers/issues_helper.rb'
@@ -40,6 +37,7 @@ Rails/HelperInstanceVariable:
4037
- 'app/helpers/nav_helper.rb'
4138
- 'app/helpers/notes_helper.rb'
4239
- 'app/helpers/operations_helper.rb'
40+
- 'app/helpers/packages_helper.rb'
4341
- 'app/helpers/page_layout_helper.rb'
4442
- 'app/helpers/projects_helper.rb'
4543
- 'app/helpers/releases_helper.rb'
@@ -59,11 +57,13 @@ Rails/HelperInstanceVariable:
5957
- 'app/helpers/webpack_helper.rb'
6058
- 'app/helpers/wiki_helper.rb'
6159
- 'ee/app/helpers/ee/application_helper.rb'
60+
- 'ee/app/helpers/ee/application_settings_helper.rb'
6261
- 'ee/app/helpers/ee/boards_helper.rb'
6362
- 'ee/app/helpers/ee/feature_flags_helper.rb'
6463
- 'ee/app/helpers/ee/form_helper.rb'
6564
- 'ee/app/helpers/ee/graph_helper.rb'
6665
- 'ee/app/helpers/ee/groups/group_members_helper.rb'
66+
- 'ee/app/helpers/ee/groups/settings_helper.rb'
6767
- 'ee/app/helpers/ee/groups_helper.rb'
6868
- 'ee/app/helpers/ee/integrations_helper.rb'
6969
- 'ee/app/helpers/ee/kerberos_helper.rb'
@@ -77,7 +77,8 @@ Rails/HelperInstanceVariable:
7777
- 'ee/app/helpers/ee/projects_helper.rb'
7878
- 'ee/app/helpers/ee/search_helper.rb'
7979
- 'ee/app/helpers/ee/selects_helper.rb'
80+
- 'ee/app/helpers/ee/sorting_helper.rb'
8081
- 'ee/app/helpers/ee/subscribable_banner_helper.rb'
8182
- 'ee/app/helpers/ee/wiki_helper.rb'
8283
- 'ee/app/helpers/path_locks_helper.rb'
83-
- 'ee/app/helpers/projects/security/discover_helper.rb'
84+
- 'ee/app/helpers/seat_count_alert_helper.rb'

0 commit comments

Comments
 (0)