Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-12-12 18:07:13 +00:00
parent 22a3da26ad
commit ba5be4989e
115 changed files with 3990 additions and 2890 deletions

View File

@ -474,6 +474,14 @@ Naming/PredicateName:
Naming/RescuedExceptionsVariableName:
Enabled: false
RSpec/AvoidTestProf:
Include:
- 'spec/migrations/**/*.rb'
- 'ee/spec/migrations/**/*.rb'
- 'spec/lib/gitlab/background_migration/**/*.rb'
- 'ee/spec/lib/gitlab/background_migration/**/*.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/**/*.rb'
RSpec/FactoriesInMigrationSpecs:
Enabled: true
Include:

View File

@ -592,7 +592,6 @@ Gitlab/StrongMemoizeAttr:
- 'lib/gitlab/ci/build/auto_retry.rb'
- 'lib/gitlab/ci/build/cache.rb'
- 'lib/gitlab/ci/build/context/base.rb'
- 'lib/gitlab/ci/build/context/build.rb'
- 'lib/gitlab/ci/build/context/global.rb'
- 'lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb'
- 'lib/gitlab/ci/build/rules/rule/clause/changes.rb'
@ -620,10 +619,8 @@ Gitlab/StrongMemoizeAttr:
- 'lib/gitlab/ci/pipeline/logger.rb'
- 'lib/gitlab/ci/pipeline/metrics.rb'
- 'lib/gitlab/ci/pipeline/quota/deployments.rb'
- 'lib/gitlab/ci/pipeline/seed/build.rb'
- 'lib/gitlab/ci/pipeline/seed/pipeline.rb'
- 'lib/gitlab/ci/pipeline/seed/processable/resource_group.rb'
- 'lib/gitlab/ci/pipeline/seed/stage.rb'
- 'lib/gitlab/ci/project_config/auto_devops.rb'
- 'lib/gitlab/ci/project_config/external_project.rb'
- 'lib/gitlab/ci/project_config/parameter.rb'

View File

@ -522,7 +522,7 @@ gem 'grape_logging', '~> 1.8'
gem 'gitlab-net-dns', '~> 0.9.1'
# Countries list
gem 'countries', '~> 3.0'
gem 'countries', '~> 4.0.0'
gem 'retriable', '~> 3.1.2'

View File

@ -86,7 +86,7 @@
{"name":"contracts","version":"0.11.0","platform":"ruby","checksum":"df6e438efa89c31dd3095851c3f7a25dfdae36b35ff1d4547f1d92941b3c7286"},
{"name":"cork","version":"0.3.0","platform":"ruby","checksum":"a0a0ac50e262f8514d1abe0a14e95e71c98b24e3378690e5d044daf0013ad4bc"},
{"name":"cose","version":"1.0.0","platform":"ruby","checksum":"520ebaad97b56d2873de02ff4e2c973f5e77ce2f8edbda454af9ee3073643bc0"},
{"name":"countries","version":"3.0.0","platform":"ruby","checksum":"ecb4287436f83f4bb098a9462828b145bec3143fa49e7ce5b1714d0ee5454770"},
{"name":"countries","version":"4.0.1","platform":"ruby","checksum":"d32e8a3c0b22949f1a41ea6d9005f5168ffce226f8fe077d1d6be785fffa81c5"},
{"name":"crack","version":"0.4.3","platform":"ruby","checksum":"5318ba8cd9cf7e0b5feb38948048503ba4b1fdc1b6ff30a39f0a00feb6036b29"},
{"name":"crass","version":"1.0.6","platform":"ruby","checksum":"dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d"},
{"name":"creole","version":"0.5.0","platform":"ruby","checksum":"951701e2d80760f156b1cb2a93471ca97c076289becc067a33b745133ed32c03"},
@ -283,7 +283,7 @@
{"name":"httparty","version":"0.20.0","platform":"ruby","checksum":"490d2a028a5accc611f1685d479d80ef80b129140d24a93c53c119f578614867"},
{"name":"httpclient","version":"2.8.3","platform":"ruby","checksum":"2951e4991214464c3e92107e46438527d23048e634f3aee91c719e0bdfaebda6"},
{"name":"i18n","version":"1.12.0","platform":"ruby","checksum":"91e3cc1b97616d308707eedee413d82ee021d751c918661fb82152793e64aced"},
{"name":"i18n_data","version":"0.8.0","platform":"ruby","checksum":"92d942cc193dc4a54a95b68f44e52c79e024fa72e09f26a982bc61153b6f0c6c"},
{"name":"i18n_data","version":"0.13.1","platform":"ruby","checksum":"e5aa99b09a69b463bb0443fc1f9540351a49f3d1541c5e91316bafa035c63f66"},
{"name":"icalendar","version":"2.8.0","platform":"ruby","checksum":"e404f970c7572bdebf6f09f9890970b68aab400ba9e609dc7d46098f28d0ee87"},
{"name":"ice_cube","version":"0.16.4","platform":"ruby","checksum":"da117e5de24bdc33931be629f9b55048641924442c7e9b72fedc05e5592531b7"},
{"name":"imagen","version":"0.1.8","platform":"ruby","checksum":"fde7b727d4fe79c6bb5ac46c1f7184bf87a6d54df54d712ad2be039d2f93a162"},

View File

@ -290,10 +290,9 @@ GEM
cose (1.0.0)
cbor (~> 0.5.9)
openssl-signature_algorithm (~> 0.4.0)
countries (3.0.0)
i18n_data (~> 0.8.0)
countries (4.0.1)
i18n_data (~> 0.13.0)
sixarm_ruby_unaccent (~> 1.1)
unicode_utils (~> 1.4)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.6)
@ -767,7 +766,7 @@ GEM
httpclient (2.8.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
i18n_data (0.8.0)
i18n_data (0.13.1)
icalendar (2.8.0)
ice_cube (~> 0.16)
ice_cube (0.16.4)
@ -1612,7 +1611,7 @@ DEPENDENCIES
commonmarker (~> 0.23.6)
concurrent-ruby (~> 1.1)
connection_pool (~> 2.0)
countries (~> 3.0)
countries (~> 4.0.0)
creole (~> 0.5.0)
crystalball (~> 0.7.0)
cvss-suite (~> 3.0.1)

View File

@ -0,0 +1,101 @@
<svg width="280" height="140" viewBox="0 0 280 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_187_122567)">
<g clip-path="url(#clip1_187_122567)">
<circle cx="189.5" cy="-42.5" r="131.5" fill="url(#paint0_radial_187_122567)"/>
<circle cx="-41.5" cy="-97.5" r="198.5" fill="url(#paint1_radial_187_122567)"/>
<circle cx="309.5" cy="-7.5" r="121.5" fill="url(#paint2_radial_187_122567)"/>
<g filter="url(#filter0_b_187_122567)">
<path d="M0 4C0 1.79086 1.79086 0 4 0H276C278.209 0 280 1.79086 280 4V130H0V4Z" fill="white" fill-opacity="0.01"/>
</g>
</g>
<path d="M183.948 47.9647H100.897V100.482H183.948V47.9647Z" fill="white"/>
<path d="M100.64 47.9647H184.06V98.9817C184.06 104.1 179.908 108.256 174.793 108.256H100.638V47.9647H100.64Z" fill="white"/>
<path d="M184.314 34.7452H100.64V47.9676H184.314V34.7452Z" fill="#AEA5D6"/>
<path d="M109.594 43.2574C110.644 43.2574 111.495 42.4056 111.495 41.3549C111.495 40.3043 110.644 39.4525 109.594 39.4525C108.544 39.4525 107.693 40.3043 107.693 41.3549C107.693 42.4056 108.544 43.2574 109.594 43.2574Z" fill="#10B1B1"/>
<path d="M116.482 43.2574C117.532 43.2574 118.383 42.4056 118.383 41.3549C118.383 40.3043 117.532 39.4525 116.482 39.4525C115.432 39.4525 114.581 40.3043 114.581 41.3549C114.581 42.4056 115.432 43.2574 116.482 43.2574Z" fill="#A888F4"/>
<path d="M123.368 43.2574C124.418 43.2574 125.269 42.4056 125.269 41.3549C125.269 40.3043 124.418 39.4525 123.368 39.4525C122.318 39.4525 121.467 40.3043 121.467 41.3549C121.467 42.4056 122.318 43.2574 123.368 43.2574Z" fill="#FF9D73"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M100.556 34.4038H165.377V35.0858H101.238V61.7159H100.556V34.4038Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M101.238 66.3383V83.4486H100.556V66.3383H101.238Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M183.721 99.0231V89.5341H184.403V99.0231C184.403 104.311 180.118 108.599 174.834 108.599H120.244V107.917H174.834C179.741 107.917 183.721 103.935 183.721 99.0231Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M183.721 83.1296V62.2422H184.403V83.1296H183.721Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M109.596 39.7936C108.734 39.7936 108.036 40.4924 108.036 41.355C108.036 42.2176 108.734 42.9164 109.596 42.9164C110.457 42.9164 111.155 42.2176 111.155 41.355C111.155 40.4924 110.457 39.7936 109.596 39.7936ZM107.354 41.355C107.354 40.1162 108.357 39.1116 109.596 39.1116C110.834 39.1116 111.837 40.1162 111.837 41.355C111.837 42.5938 110.834 43.5985 109.596 43.5985C108.357 43.5985 107.354 42.5938 107.354 41.355Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M116.48 39.7936C115.619 39.7936 114.92 40.4924 114.92 41.355C114.92 42.2176 115.619 42.9164 116.48 42.9164C117.342 42.9164 118.04 42.2176 118.04 41.355C118.04 40.4924 117.342 39.7936 116.48 39.7936ZM114.238 41.355C114.238 40.1162 115.242 39.1116 116.48 39.1116C117.719 39.1116 118.722 40.1162 118.722 41.355C118.722 42.5938 117.719 43.5985 116.48 43.5985C115.242 43.5985 114.238 42.5938 114.238 41.355Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M123.367 39.7936C122.506 39.7936 121.808 40.4924 121.808 41.355C121.808 42.2176 122.506 42.9164 123.367 42.9164C124.229 42.9164 124.927 42.2176 124.927 41.355C124.927 40.4924 124.229 39.7936 123.367 39.7936ZM121.125 41.355C121.125 40.1162 122.129 39.1116 123.367 39.1116C124.606 39.1116 125.609 40.1162 125.609 41.355C125.609 42.5938 124.606 43.5985 123.367 43.5985C122.129 43.5985 121.125 42.5938 121.125 41.355Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M160.466 48.3058H100.897V47.6238H160.466V48.3058Z" fill="#171321"/>
<path d="M173.511 80.7124H152.485V83.4598H173.511V80.7124Z" fill="#D0C5E2"/>
<path d="M149.08 80.7009H111.703V83.4484H149.08V80.7009Z" fill="#E7E4F2"/>
<path d="M111.702 68.5293H132.728V65.7819H111.702V68.5293Z" fill="#E7E4F2"/>
<path d="M136.131 68.5336H173.508V65.7861H136.131V68.5336Z" fill="#AEA5D6"/>
<path d="M111.703 75.9889H120.838V73.2415H111.703V75.9889Z" fill="#AEA5D6"/>
<path d="M155.891 75.9978H173.512V73.2504H155.891V75.9978Z" fill="#E7E4F2"/>
<path d="M124.244 75.9978H152.485V73.2504H124.244V75.9978Z" fill="#D0C5E2"/>
<path d="M141.099 58.3217H124.332V61.0691H141.099V58.3217Z" fill="#D0C5E2"/>
<path d="M173.512 58.3217H144.31V61.0691H173.512V58.3217Z" fill="#E7E4F2"/>
<path d="M120.926 58.3198H111.703V61.0673H120.926V58.3198Z" fill="#AEA5D6"/>
<path d="M144.115 90.9242H160.882V88.1768H144.115V90.9242Z" fill="#AEA5D6"/>
<path d="M111.703 90.908H140.905V88.1605H111.703V90.908Z" fill="#D0C5E2"/>
<path d="M164.288 90.9242H173.512V88.1768H164.288V90.9242Z" fill="#D0C5E2"/>
<path d="M173.508 95.6178H158.224V98.3652H173.508V95.6178Z" fill="#D0C5E2"/>
<path d="M154.82 95.6199H111.703V98.3673H154.82V95.6199Z" fill="#E7E4F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M167.801 34.8965L168.463 35.0598L162.398 59.6461L189.091 57.5112L189.145 58.1911L161.509 60.4014L167.801 34.8965Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M134.795 81.6335L109.428 116.595L108.876 116.195L133.312 82.5167L92.5055 87.8873L92.4165 87.2111L134.795 81.6335Z" fill="#171321"/>
<path d="M187.019 57.9366C197.646 57.9366 206.262 49.3147 206.262 38.6791C206.262 28.0435 197.646 19.4216 187.019 19.4216C176.392 19.4216 167.777 28.0435 167.777 38.6791C167.777 49.3147 176.392 57.9366 187.019 57.9366Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M187.019 19.6948C176.543 19.6948 168.05 28.1943 168.05 38.6794C168.05 49.1646 176.543 57.6641 187.019 57.6641C197.495 57.6641 205.989 49.1646 205.989 38.6794C205.989 28.1943 197.495 19.6948 187.019 19.6948ZM167.504 38.6794C167.504 27.8934 176.241 19.1492 187.019 19.1492C197.797 19.1492 206.534 27.8934 206.534 38.6794C206.534 49.4655 197.797 58.2097 187.019 58.2097C176.241 58.2097 167.504 49.4655 167.504 38.6794Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M212.255 38.6791C212.255 24.7294 200.956 13.4218 187.018 13.4218V12.677C201.368 12.677 213 24.3186 213 38.6791H212.255Z" fill="#AEA5D6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M67.0944 108.321C67.0944 122.27 78.3936 133.578 92.3316 133.578V134.323C77.9817 134.323 66.3496 122.681 66.3496 108.321H67.0944Z" fill="#AEA5D6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M181.794 28.4035C183.212 28.0221 184.673 28.8643 185.054 30.2837L184.395 30.4605C184.112 29.4049 183.026 28.7787 181.971 29.0622L181.794 28.4035Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M192.066 29.0622C191.011 28.7787 189.925 29.4049 189.642 30.4605L188.983 30.2837C189.364 28.8643 190.824 28.0221 192.243 28.4035L192.066 29.0622Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M195.892 33.5398V36.1862L192.04 37.4786L191.823 36.832L195.21 35.6956V33.5398H195.892Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M195.213 44.8355L192.045 43.7774L192.262 43.1305L195.895 44.3442V46.991H195.213V44.8355Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M178.827 35.6957V33.5398H178.145V36.1861L181.995 37.4786L182.212 36.832L178.827 35.6957Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M181.776 43.1305L181.992 43.7773L178.827 44.8354V46.991H178.145V44.3443L181.776 43.1305Z" fill="#171321"/>
<path d="M182.675 34.3942L181.129 37.5941C179.03 41.9415 182.192 46.9908 187.019 46.9908C191.845 46.9908 195.008 41.9415 192.908 37.5941L191.363 34.3942" fill="#A888F4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M186.678 46.9908V34.3942H187.36V46.9908H186.678Z" fill="#171321"/>
<path d="M191.25 34.3939H182.788V33.2534C182.788 28.2918 191.25 28.2987 191.25 33.2534V34.3939Z" fill="#7759C1"/>
<path d="M92.4612 126.064C103.088 126.064 111.704 117.442 111.704 106.806C111.704 96.1706 103.088 87.5487 92.4612 87.5487C81.8339 87.5487 73.2188 96.1706 73.2188 106.806C73.2188 117.442 81.8339 126.064 92.4612 126.064Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M92.4604 87.89C82.0217 87.89 73.559 96.359 73.559 106.806C73.559 117.254 82.0217 125.723 92.4604 125.723C102.899 125.723 111.362 117.254 111.362 106.806C111.362 96.359 102.899 87.89 92.4604 87.89ZM72.877 106.806C72.877 95.9828 81.6445 87.208 92.4604 87.208C103.276 87.208 112.044 95.9828 112.044 106.806C112.044 117.63 103.276 126.405 92.4604 126.405C81.6445 126.405 72.877 117.63 72.877 106.806Z" fill="#171321"/>
<path d="M98.2885 105.28H95.9653V101.385C95.9653 99.3302 94.2951 97.6587 92.2419 97.6587C90.1887 97.6587 88.5184 99.3302 88.5184 101.385V105.28H86.1953V101.385C86.1953 98.0489 88.9083 95.3337 92.2419 95.3337C95.5754 95.3337 98.2885 98.0489 98.2885 101.385V105.28Z" fill="#7759C1"/>
<path d="M100.894 104.186H83.3677V116.836H100.894V104.186Z" fill="#A888F4"/>
<path d="M92.1343 111.015C92.8235 111.015 93.3823 110.456 93.3823 109.766C93.3823 109.076 92.8235 108.517 92.1343 108.517C91.445 108.517 90.8862 109.076 90.8862 109.766C90.8862 110.456 91.445 111.015 92.1343 111.015Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M91.792 112.209V110.722H92.474V112.209H91.792Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M87.2401 53.2567V60.9103C87.2401 61.9966 88.1212 62.878 89.2061 62.878H121.061C122.523 62.878 123.709 64.0653 123.709 65.5278V67.1601H123.027V65.5278C123.027 64.4415 122.146 63.5601 121.061 63.5601H89.2061C87.7441 63.5601 86.5581 62.3728 86.5581 60.9103V53.2567H87.2401Z" fill="#171321"/>
<path d="M123.368 67.735C123.685 67.735 123.942 67.4776 123.942 67.1601C123.942 66.8426 123.685 66.5852 123.368 66.5852C123.051 66.5852 122.793 66.8426 122.793 67.1601C122.793 67.4776 123.051 67.735 123.368 67.735Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M123.368 66.9262C123.239 66.9262 123.134 67.0306 123.134 67.16C123.134 67.2895 123.239 67.3939 123.368 67.3939C123.496 67.3939 123.601 67.2895 123.601 67.16C123.601 67.0306 123.496 66.9262 123.368 66.9262ZM122.452 67.16C122.452 66.6545 122.862 66.2441 123.368 66.2441C123.873 66.2441 124.283 66.6545 124.283 67.16C124.283 67.6656 123.873 68.0759 123.368 68.0759C122.862 68.0759 122.452 67.6656 122.452 67.16Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M167.208 82.5551V84.88C167.208 85.5854 167.778 86.1551 168.482 86.1551H193.305V86.8371H168.482C167.4 86.8371 166.526 85.9616 166.526 84.88V82.5551H167.208Z" fill="#171321"/>
<path d="M166.867 83.13C167.184 83.13 167.441 82.8726 167.441 82.5551C167.441 82.2376 167.184 81.9802 166.867 81.9802C166.55 81.9802 166.292 82.2376 166.292 82.5551C166.292 82.8726 166.55 83.13 166.867 83.13Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.866 82.3209C166.737 82.3209 166.633 82.4254 166.633 82.5548C166.633 82.6842 166.737 82.7887 166.866 82.7887C166.995 82.7887 167.1 82.6842 167.1 82.5548C167.1 82.4255 166.995 82.3209 166.866 82.3209ZM165.951 82.5548C165.951 82.0492 166.36 81.6389 166.866 81.6389C167.372 81.6389 167.782 82.0492 167.782 82.5548C167.782 83.0605 167.372 83.4707 166.866 83.4707C166.36 83.4707 165.951 83.0604 165.951 82.5548Z" fill="#171321"/>
<path d="M86.9023 37.1553C82.8536 41.5743 77.6099 40.6 77.6099 40.6V48.5768C77.6099 49.962 77.8867 51.3404 78.4796 52.5917C80.8973 57.6918 86.9023 59.5873 86.9023 59.5873C86.9023 59.5873 92.9051 57.6918 95.3251 52.5917C95.918 51.3404 96.1948 49.962 96.1948 48.5768V40.6C96.1948 40.6 90.9511 41.5743 86.9023 37.1553V37.1553Z" fill="#10B1B1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M90.6411 45.6638L85.4674 50.8415L83.1592 48.5289L83.6419 48.0471L85.4677 49.8764L90.1586 45.1818L90.6411 45.6638Z" fill="#171321"/>
<path d="M197.955 76.3168C193.902 80.7427 188.651 79.7684 188.651 79.7684V87.7567C188.651 89.1443 188.928 90.5249 189.521 91.7786C191.943 96.8856 197.955 98.7834 197.955 98.7834C197.955 98.7834 203.967 96.8856 206.39 91.7786C206.985 90.5249 207.259 89.1443 207.259 87.7567V79.7684C207.259 79.7684 202.009 80.7427 197.955 76.3168Z" fill="#FC6D26"/>
<path d="M197.19 83.1044L197.566 88.4584H198.343L198.719 83.1044H197.19Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M196.806 82.7468H199.102L198.676 88.8156H197.232L196.806 82.7468ZM197.572 83.4616L197.898 88.1009H198.009L198.335 83.4616H197.572Z" fill="#171321"/>
<path d="M198.343 90.2083H197.566V91.1248H198.343V90.2083Z" fill="#171321"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M197.208 89.851H198.7V91.4823H197.208V89.851ZM197.922 90.5657V90.7675H197.985V90.5657H197.922Z" fill="#171321"/>
</g>
<defs>
<filter id="filter0_b_187_122567" x="-50" y="-50" width="380" height="230" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feGaussianBlur in="BackgroundImageFix" stdDeviation="25"/>
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_187_122567"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_187_122567" result="shape"/>
</filter>
<radialGradient id="paint0_radial_187_122567" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(189.5 -42.5) rotate(89.5818) scale(125.986)">
<stop stop-color="#7759C2"/>
<stop offset="1" stop-color="#7759C2" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint1_radial_187_122567" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(-41.5 -97.5) rotate(89.5818) scale(190.176)">
<stop stop-color="#D64028"/>
<stop offset="1" stop-color="#D64028" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint2_radial_187_122567" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(309.5 -7.5) rotate(89.5818) scale(116.405)">
<stop stop-color="#EF76F1"/>
<stop offset="1" stop-color="#EF76F1" stop-opacity="0"/>
</radialGradient>
<clipPath id="clip0_187_122567">
<rect width="280" height="140" fill="white"/>
</clipPath>
<clipPath id="clip1_187_122567">
<path d="M0 4C0 1.79086 1.79086 0 4 0H276C278.209 0 280 1.79086 280 4V140H0V4Z" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -118,3 +118,5 @@ export const DEFAULT_BRANCH = 'main';
// Ping Usage Metrics Keys
export const PING_USAGE_PREVIEW_KEY = 'web_ide_clientside_preview';
export const PING_USAGE_PREVIEW_SUCCESS_KEY = 'web_ide_clientside_preview_success';
export const GITLAB_WEB_IDE_FEEDBACK_ISSUE = 'https://gitlab.com/gitlab-org/gitlab/-/issues/377367';

View File

@ -5,6 +5,7 @@ import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_action';
import { createAndSubmitForm } from '~/lib/utils/create_and_submit_form';
import { getBaseConfig } from './lib/gitlab_web_ide/get_base_config';
import { setupRootElement } from './lib/gitlab_web_ide/setup_root_element';
import { GITLAB_WEB_IDE_FEEDBACK_ISSUE } from './constants';
const buildRemoteIdeURL = (ideRemotePath, remoteHost, remotePathArg) => {
const remotePath = cleanLeadingSeparator(remotePathArg);
@ -31,6 +32,10 @@ export const initGitlabWebIDE = async (el) => {
nonce,
projectPath,
ref,
links: {
feedbackIssue: GITLAB_WEB_IDE_FEEDBACK_ISSUE,
userPreferences: el.dataset.userPreferencesPath,
},
async handleStartRemote({ remoteHost, remotePath, connectionToken }) {
const confirmed = await confirmAction(
__('Are you sure you want to leave the Web IDE? All unsaved changes will be lost.'),

View File

@ -22,8 +22,6 @@ import {
OPERATORS_IS,
OPERATORS_IS_NOT,
OPERATORS_IS_NOT_OR,
OPTIONS_NONE_ANY,
TOKEN_TITLE_SEARCH_WITHIN,
TOKEN_TITLE_ASSIGNEE,
TOKEN_TITLE_AUTHOR,
TOKEN_TITLE_CONFIDENTIAL,
@ -33,6 +31,7 @@ import {
TOKEN_TITLE_MY_REACTION,
TOKEN_TITLE_ORGANIZATION,
TOKEN_TITLE_RELEASE,
TOKEN_TITLE_SEARCH_WITHIN,
TOKEN_TITLE_TYPE,
TOKEN_TYPE_ASSIGNEE,
TOKEN_TYPE_AUTHOR,
@ -43,8 +42,8 @@ import {
TOKEN_TYPE_MY_REACTION,
TOKEN_TYPE_ORGANIZATION,
TOKEN_TYPE_RELEASE,
TOKEN_TYPE_TYPE,
TOKEN_TYPE_SEARCH_WITHIN,
TOKEN_TYPE_TYPE,
} from '~/vue_shared/components/filtered_search_bar/constants';
import IssuableList from '~/vue_shared/issuable/list/components/issuable_list_root.vue';
import { IssuableListTabs, IssuableStates } from '~/vue_shared/issuable/list/constants';
@ -165,7 +164,7 @@ export default {
eeIsOkrsEnabled: {
type: Boolean,
required: false,
default: () => false,
default: false,
},
},
data() {
@ -193,10 +192,7 @@ export default {
return data[this.namespace]?.issues.nodes ?? [];
},
result({ data }) {
if (!data) {
return;
}
this.pageInfo = data[this.namespace]?.issues.pageInfo ?? {};
this.pageInfo = data?.[this.namespace]?.issues.pageInfo ?? {};
this.exportCsvPathWithQuery = this.getExportCsvPathWithQuery();
},
error(error) {
@ -327,7 +323,6 @@ export default {
title: TOKEN_TITLE_AUTHOR,
icon: 'pencil',
token: AuthorToken,
dataType: 'user',
defaultAuthors: [],
operators: this.hasOrFeature ? OPERATORS_IS_NOT_OR : OPERATORS_IS_NOT,
fetchAuthors: this.fetchUsers,
@ -339,8 +334,6 @@ export default {
title: TOKEN_TITLE_ASSIGNEE,
icon: 'user',
token: AuthorToken,
dataType: 'user',
defaultAuthors: OPTIONS_NONE_ANY,
operators: this.hasOrFeature ? OPERATORS_IS_NOT_OR : OPERATORS_IS_NOT,
fetchAuthors: this.fetchUsers,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-assignee`,
@ -360,7 +353,6 @@ export default {
title: TOKEN_TITLE_LABEL,
icon: 'labels',
token: LabelToken,
defaultLabels: OPTIONS_NONE_ANY,
fetchLabels: this.fetchLabels,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-label`,
},
@ -417,7 +409,6 @@ export default {
token: CrmContactToken,
fullPath: this.fullPath,
isProject: this.isProject,
defaultContacts: OPTIONS_NONE_ANY,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-crm-contacts`,
operators: OPERATORS_IS,
unique: true,
@ -432,7 +423,6 @@ export default {
token: CrmOrganizationToken,
fullPath: this.fullPath,
isProject: this.isProject,
defaultOrganizations: OPTIONS_NONE_ANY,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-crm-organizations`,
operators: OPERATORS_IS,
unique: true,
@ -505,18 +495,17 @@ export default {
eventHub.$off('issuables:toggleBulkEdit', this.toggleBulkEditSidebar);
},
methods: {
fetchWithCache(path, cacheName, searchKey, search, wrapData = false) {
fetchWithCache(path, cacheName, searchKey, search) {
if (this.cache[cacheName]) {
const data = search
? fuzzaldrinPlus.filter(this.cache[cacheName], search, { key: searchKey })
: this.cache[cacheName].slice(0, MAX_LIST_SIZE);
return wrapData ? Promise.resolve({ data }) : Promise.resolve(data);
return Promise.resolve(data);
}
return axios.get(path).then(({ data }) => {
this.cache[cacheName] = data;
const result = data.slice(0, MAX_LIST_SIZE);
return wrapData ? { data: result } : result;
return data.slice(0, MAX_LIST_SIZE);
});
},
fetchEmojis(search) {
@ -580,8 +569,7 @@ export default {
const bulkUpdateSidebar = await import('~/issuable');
bulkUpdateSidebar.initBulkUpdateSidebar('issuable_');
const usersSelect = await import('~/users_select');
const UsersSelect = usersSelect.default;
const UsersSelect = (await import('~/users_select')).default;
new UsersSelect(); // eslint-disable-line no-new
this.hasInitBulkEdit = true;
@ -594,8 +582,8 @@ export default {
return;
}
this.pageParams = getInitialPageParams(this.pageSize);
this.state = state;
this.pageParams = getInitialPageParams(this.pageSize);
this.$router.push({ query: this.urlParams });
},
@ -604,7 +592,6 @@ export default {
},
handleFilter(tokens) {
this.setFilterTokens(tokens);
this.pageParams = getInitialPageParams(this.pageSize);
this.$router.push({ query: this.urlParams });
@ -673,8 +660,8 @@ export default {
return;
}
this.pageParams = getInitialPageParams(this.pageSize);
this.sortKey = sortKey;
this.pageParams = getInitialPageParams(this.pageSize);
if (this.isSignedIn) {
this.saveSortPreference(sortKey);

View File

@ -200,9 +200,6 @@ export const filters = {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'in',
},
[OPERATOR_NOT]: {
[NORMAL_FILTER]: 'not[in]',
},
},
},
[TOKEN_TYPE_ASSIGNEE]: {

View File

@ -38,7 +38,7 @@ export const INTEGRATIONS_DOC_LINK = helpPagePath('integration/jira/development_
anchor: 'use-the-integration',
});
export const OAUTH_SELF_MANAGED_DOC_LINK = helpPagePath('integration/jira/connect-app', {
anchor: 'install-the-gitlabcom-for-jira-cloud-app-for-self-managed-instances',
anchor: 'connect-the-gitlabcom-for-jira-cloud-app-for-self-managed-instances',
});
export const GITLAB_COM_BASE_PATH = 'https://gitlab.com';

View File

@ -5,10 +5,14 @@ import { s__ } from '~/locale';
import { reloadPage, persistBaseUrl, retrieveBaseUrl } from '~/jira_connect/subscriptions/utils';
import { updateInstallation, setApiBaseURL } from '~/jira_connect/subscriptions/api';
import { I18N_UPDATE_INSTALLATION_ERROR_MESSAGE } from '~/jira_connect/subscriptions/constants';
import {
GITLAB_COM_BASE_PATH,
I18N_UPDATE_INSTALLATION_ERROR_MESSAGE,
} from '~/jira_connect/subscriptions/constants';
import { SET_ALERT } from '~/jira_connect/subscriptions/store/mutation_types';
import SignInOauthButton from '../../../components/sign_in_oauth_button.vue';
import SetupInstructions from './setup_instructions.vue';
import VersionSelectForm from './version_select_form.vue';
export default {
@ -16,12 +20,14 @@ export default {
components: {
GlButton,
SignInOauthButton,
SetupInstructions,
VersionSelectForm,
},
data() {
return {
gitlabBasePath: null,
loadingVersionSelect: false,
showSetupInstructions: false,
};
},
computed: {
@ -37,6 +43,9 @@ export default {
mounted() {
this.gitlabBasePath = retrieveBaseUrl();
setApiBaseURL(this.gitlabBasePath);
if (this.gitlabBasePath !== GITLAB_COM_BASE_PATH) {
this.showSetupInstructions = true;
}
},
methods: {
...mapMutations({
@ -61,6 +70,9 @@ export default {
this.loadingVersionSelect = false;
});
},
onSetupNext() {
this.showSetupInstructions = false;
},
onSignInError() {
this.$emit('error');
},
@ -88,19 +100,23 @@ export default {
@submit="onVersionSelect"
/>
<div v-else class="gl-text-center">
<sign-in-oauth-button
class="gl-mb-5"
:gitlab-base-path="gitlabBasePath"
@sign-in="$emit('sign-in-oauth', $event)"
@error="onSignInError"
/>
<template v-else>
<setup-instructions v-if="showSetupInstructions" @next="onSetupNext" />
<div>
<gl-button category="tertiary" variant="confirm" @click="resetGitlabBasePath">
{{ $options.i18n.changeVersionButtonText }}
</gl-button>
<div v-else class="gl-text-center">
<sign-in-oauth-button
class="gl-mb-5"
:gitlab-base-path="gitlabBasePath"
@sign-in="$emit('sign-in-oauth', $event)"
@error="onSignInError"
/>
<div>
<gl-button category="tertiary" variant="confirm" @click="resetGitlabBasePath">
{{ $options.i18n.changeVersionButtonText }}
</gl-button>
</div>
</div>
</div>
</template>
</div>
</template>

View File

@ -0,0 +1,35 @@
<script>
import { GlButton, GlLink } from '@gitlab/ui';
import { OAUTH_SELF_MANAGED_DOC_LINK } from '~/jira_connect/subscriptions/constants';
export default {
components: {
GlButton,
GlLink,
},
OAUTH_SELF_MANAGED_DOC_LINK,
};
</script>
<template>
<div class="gl-max-w-62 gl-mx-auto gl-mt-7">
<h3>{{ s__('JiraService|Continue setup in GitLab') }}</h3>
<p>
{{
s__(
'JiraService|In order to complete the set up, youll need to complete a few steps in GitLab.',
)
}}
<gl-link
class="gl-reset-font-size!"
:href="$options.OAUTH_SELF_MANAGED_DOC_LINK"
target="_blank"
>{{ __('Learn more') }}</gl-link
>
</p>
<gl-button variant="confirm" @click="$emit('next')">
{{ __('Next') }}
</gl-button>
</div>
</template>

View File

@ -55,7 +55,6 @@ export default {
},
radioOptions: RADIO_OPTIONS,
i18n: {
title: s__('JiraService|Welcome to GitLab for Jira'),
saasRadioLabel: __('GitLab.com (SaaS)'),
saasRadioHelp: __('Most common'),
selfManagedRadioLabel: __('GitLab (self-managed)'),

View File

@ -1,9 +1,10 @@
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import CommitsList from '~/commits';
import GpgBadges from '~/gpg_badges';
import mountCommits from '~/projects/commits';
import { mountCommits, initCommitsRefSwitcher } from '~/projects/commits';
new CommitsList(document.querySelector('.js-project-commits-show').dataset.commitsLimit); // eslint-disable-line no-new
new ShortcutsNavigation(); // eslint-disable-line no-new
GpgBadges.fetch();
mountCommits(document.getElementById('js-author-dropdown'));
initCommitsRefSwitcher();

View File

@ -17,6 +17,7 @@ export default ({ el, router }) => {
const { projectPath, ref, isBlob, webIdeUrl, ...options } = convertObjectPropsToCamelCase(
JSON.parse(el.dataset.options),
);
const { webIdePromoPopoverImg } = el.dataset;
// eslint-disable-next-line no-new
new Vue({
@ -27,6 +28,7 @@ export default ({ el, router }) => {
return h(WebIdeButton, {
props: {
isBlob,
webIdePromoPopoverImg,
webIdeUrl: isBlob
? webIdeUrl
: webIDEUrl(

View File

@ -1,5 +1,5 @@
<script>
import { GlButton, GlDropdown, GlDropdownItem, GlModal, GlModalDirective } from '@gitlab/ui';
import { GlButton, GlModal, GlModalDirective, GlCollapsibleListbox } from '@gitlab/ui';
import { __, s__ } from '~/locale';
import { sortOrders, sortOrderOptions } from '../constants';
@ -9,9 +9,8 @@ export default {
components: {
RequestWarning,
GlButton,
GlDropdown,
GlDropdownItem,
GlModal,
GlCollapsibleListbox,
},
directives: {
'gl-modal': GlModalDirective,
@ -119,9 +118,6 @@ export default {
itemHasOpenedBacktrace(toggledIndex) {
return this.openedBacktraces.find((openedIndex) => openedIndex === toggledIndex) >= 0;
},
changeSortOrder(order) {
this.sortOrder = order;
},
sortDetailByDuration(a, b) {
return a.duration < b.duration ? 1 : -1;
},
@ -157,19 +153,14 @@ export default {
</div>
</div>
</div>
<gl-dropdown
<gl-collapsible-listbox
v-if="displaySortOrder"
:text="$options.sortOrderOptions[sortOrder]"
v-model="sortOrder"
:toggle-text="$options.sortOrderOptions[sortOrder].text"
:items="Object.values($options.sortOrderOptions)"
right
data-testid="performance-bar-sort-order"
>
<gl-dropdown-item
v-for="option in Object.keys($options.sortOrderOptions)"
:key="option"
@click="changeSortOrder(option)"
>{{ $options.sortOrderOptions[option] }}</gl-dropdown-item
>
</gl-dropdown>
/>
</div>
<hr />
<table class="table gl-table">

View File

@ -6,6 +6,12 @@ export const sortOrders = {
};
export const sortOrderOptions = {
[sortOrders.DURATION]: s__('PerformanceBar|Sort by duration'),
[sortOrders.CHRONOLOGICAL]: s__('PerformanceBar|Sort chronologically'),
[sortOrders.DURATION]: {
value: sortOrders.DURATION,
text: s__('PerformanceBar|Sort by duration'),
},
[sortOrders.CHRONOLOGICAL]: {
value: sortOrders.CHRONOLOGICAL,
text: s__('PerformanceBar|Sort chronologically'),
},
};

View File

@ -1,11 +1,13 @@
import Vue from 'vue';
import Vuex from 'vuex';
import { visitUrl } from '~/lib/utils/url_utility';
import RefSelector from '~/ref/components/ref_selector.vue';
import AuthorSelectApp from './components/author_select.vue';
import store from './store';
Vue.use(Vuex);
export default (el) => {
export const mountCommits = (el) => {
if (!el) {
return null;
}
@ -24,3 +26,30 @@ export default (el) => {
},
});
};
export const initCommitsRefSwitcher = () => {
const el = document.getElementById('js-project-commits-ref-switcher');
const COMMITS_PATH_REGEX = /^(.*?)\/-\/commits/g;
if (!el) return false;
const { projectId, ref, commitsPath } = el.dataset;
const commitsPathPrefix = commitsPath.match(COMMITS_PATH_REGEX)?.[0];
return new Vue({
el,
render(createElement) {
return createElement(RefSelector, {
props: {
projectId,
value: ref,
},
on: {
input(selected) {
visitUrl(`${commitsPathPrefix}/${selected}`);
},
},
});
},
});
};

View File

@ -139,6 +139,11 @@ export default {
required: false,
default: '',
},
webIdePromoPopoverImg: {
type: String,
required: false,
default: '',
},
},
data() {
return {
@ -379,19 +384,37 @@ export default {
v-if="displayVscodeWebIdeCallout"
:target="$options.webIdeButtonId"
:show="shouldShowCallout"
:css-classes="['web-ide-promo-popover']"
show-close-button
triggers="manual"
@close-button-clicked="dismiss"
>
<template #title>
{{ __('Try out the new Web IDE') }}
</template>
{{
__(
'VS Code in your browser. View code and make changes from the same UI as in your local IDE 🎉',
)
}}
<img
:src="webIdePromoPopoverImg"
class="web-ide-promo-popover-illustration"
width="280"
height="140"
/>
<div class="gl-mx-2">
<h5 class="gl-mt-3 gl-mb-3">{{ __('The new Web IDE') }}</h5>
<p>
{{
__(
'VS Code in your browser. View code and make changes from the same UI as in your local IDE.',
)
}}
</p>
<gl-link
class="gl-button btn btn-confirm block gl-mb-4 gl-mt-5"
variant="confirm"
category="primary"
target="_blank"
:href="webIdeUrl"
block
>
{{ __('Try it out now') }}
</gl-link>
</div>
</gl-popover>
</div>
</template>

View File

@ -205,3 +205,18 @@
.blob-content-holder {
margin-top: $gl-padding;
}
.web-ide-promo-popover {
box-shadow: 0 0 18px -1.9px rgba(119, 89, 194, 0.16),
0 0 12.9px -1.7px rgba(119, 89, 194, 0.16), 0 0 9.2px -1.4px rgba(119, 89, 194, 0.16),
0 0 6.4px -1.1px rgba(119, 89, 194, 0.16), 0 0 4.5px -0.8px rgba(119, 89, 194, 0.16),
0 0 3px -0.6px rgba(119, 89, 194, 0.16), 0 0 1.8px -0.3px rgba(119, 89, 194, 0.16),
0 0 0.6px rgba(119, 89, 194, 0.16);
z-index: 999;
}
.web-ide-promo-popover-illustration {
width: calc(100% + 24px);
margin: -28px -12px 0;
}

View File

@ -0,0 +1,17 @@
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module VSCodeCDNCSP
extend ActiveSupport::Concern
included do
content_security_policy do |policy|
next if !Feature.enabled?(:vscode_web_ide) || policy.directives.blank?
default_src = Array(policy.directives['default-src'] || [])
policy.directives['frame-src'] ||= default_src
policy.directives['frame-src'].concat(['https://*.vscode-cdn.net/'])
end
end
end
# rubocop:enable Naming/FileName

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true
class IdeController < ApplicationController
include VSCodeCDNCSP
include ClientsidePreviewCSP
include StaticObjectExternalStorageCSP
include Gitlab::Utils::StrongMemoize

View File

@ -4,6 +4,8 @@ require 'uri'
module WebIde
class RemoteIdeController < ApplicationController
include VSCodeCDNCSP
rescue_from URI::InvalidComponentError, with: :render_404
before_action :allow_remote_ide_content_security_policy

View File

@ -40,6 +40,7 @@ module Resolvers
params: project_finder_params(args),
project_ids_relation: project_ids)
.execute
projects = apply_lookahead(projects)
Preloaders::ProjectPolicyPreloader.new(projects, current_user).execute
projects_by_id = projects.index_by(&:id)
@ -58,6 +59,19 @@ module Resolvers
end
# rubocop:enable CodeReuse/ActiveRecord
end
private
def unconditional_includes
[:project_feature]
end
def preloads
super.merge({
full_path: [:route, { namespace: [:route] }],
web_url: [:route, { namespace: [:route] }]
})
end
end
end
end

View File

@ -61,7 +61,7 @@
%h4
= s_('AdminSettings|CI/CD limits')
%p
= s_('AdminSettings|Set limit to 0 to disable it.')
= s_('AdminSettings|By default, set a limit to 0 to have no limit.')
.scrolling-tabs-container.inner-page-scroll-tabs
- if @plans.size > 1
%ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs.gl-mb-5
@ -94,6 +94,7 @@
.form-group
= f.label :ci_needs_size_limit, s_('AdminSettings|Maximum number of DAG dependencies that a job can have')
= f.number_field :ci_needs_size_limit, class: 'form-control gl-form-input'
.form-text.text-muted= s_('AdminSettings|This limit cannot be disabled. Set to 0 to block all DAG dependencies.')
.form-group
= f.label :ci_registered_group_runners, s_('AdminSettings|Maximum number of runners registered per group')
= f.number_field :ci_registered_group_runners, class: 'form-control gl-form-input'

View File

@ -17,8 +17,7 @@
= clipboard_button(target: '#registration_token', title: _("Copy token"))
.gl-mt-3.gl-mb-3
= button_to _("Reset registration token"), reset_token_url,
method: :put, class: 'gl-button btn btn-default',
data: { confirm: _("Are you sure you want to reset the registration token?") }
= render Pajamas::ButtonComponent.new(variant: :default, method: :put, href: reset_token_url, button_options: { id: 'Reset registration token', data: { confirm: _("Are you sure you want to reset the registration token?") } }) do
= _('Reset registration token')
#js-install-runner

View File

@ -10,7 +10,7 @@
.nav-block
.tree-ref-container
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'commits'
#js-project-commits-ref-switcher{ data: { "project-id" => @project.id, "ref" => @ref, "commits_path": project_commits_path(@project) } }
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs

View File

@ -2,4 +2,4 @@
- button_data = web_ide_button_data({ blob: blob })
- fork_options = fork_modal_options(@project, @ref, @path, blob)
.gl-display-inline-block{ data: { options: button_data.merge(fork_options).to_json }, id: "js-#{type}-web-ide-link" }
.gl-display-inline-block{ data: { options: button_data.merge(fork_options).to_json, web_ide_promo_popover_img: image_path('web-ide-promo-popover.svg') }, id: "js-#{type}-web-ide-link" }

View File

@ -245,7 +245,7 @@
- unicode_utils
- MIT
- :who: Aishwarya Subramanain
:why: https://github.com/hexorx/countries/blob/master/LICENSE
:why: https://github.com/countries/countries/blob/master/LICENSE
:versions: []
:when: 2019-09-11 13:08:28.431132000 Z
- - :permit

View File

@ -0,0 +1,8 @@
---
name: ci_enforce_rate_limits_jobs_api
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104912
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/384186
milestone: '15.7'
type: development
group: group::pipeline execution
default_enabled: false

View File

@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55202
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323180
milestone: '13.10'
type: development
group: group::memory
group: group::pipeline excution
default_enabled: false

View File

@ -0,0 +1,8 @@
---
name: ci_reuse_build_in_seed_context
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105492
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/384577
milestone: '15.7'
type: development
group: group::pipeline execution
default_enabled: false

View File

@ -1,7 +0,0 @@
name: usage_data_diff_searches
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86603
rollout_issue_url:
milestone: '15.0'
type: development
group: group::code review
default_enabled: true

View File

@ -8,7 +8,7 @@ end
# This overrides the display name for Ukraine to 'Ukraine (except the Crimea, Donetsk, and Luhansk regions)'
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/374946
# To be removed after https://gitlab.com/gitlab-org/gitlab/issues/14784 is implemented
# Data fetched is based on https://github.com/hexorx/countries/blob/master/lib/countries/data/countries/UA.yaml
# Data fetched is based on https://github.com/countries/countries/blob/master/lib/countries/data/countries/UA.yaml
ISO3166::Data.register(
continent: "Europe",
address_format: "|-

View File

@ -131,6 +131,10 @@
- 1
- - delete_user
- 1
- - dependencies_destroy_export
- 1
- - dependencies_export
- 1
- - dependency_proxy
- 1
- - dependency_proxy_blob

View File

@ -10,7 +10,7 @@ GitLab has several features based on receiving incoming email messages:
- [Reply by Email](reply_by_email.md): allow GitLab users to comment on issues
and merge requests by replying to notification email.
- [New issue by email](../user/project/issues/managing_issues.md#by-sending-an-email):
- [New issue by email](../user/project/issues/create_issues.md#by-sending-an-email):
allow GitLab users to create a new issue by sending an email to a
user-specific email address.
- [New merge request by email](../user/project/merge_requests/creating_merge_requests.md#by-sending-an-email):

View File

@ -134,7 +134,7 @@ Learn how to install, configure, update, and maintain your GitLab instance.
- Instances.
- [Auditor users](auditor_users.md): Users with read-only access to all projects, groups, and other resources on the GitLab instance.
- [Incoming email](incoming_email.md): Configure incoming emails to allow
users to [reply by email](reply_by_email.md), create [issues by email](../user/project/issues/managing_issues.md#by-sending-an-email) and
users to [reply by email](reply_by_email.md), create [issues by email](../user/project/issues/create_issues.md#by-sending-an-email) and
[merge requests by email](../user/project/merge_requests/creating_merge_requests.md#by-sending-an-email), and to enable [Service Desk](../user/project/service_desk.md).
- [Postfix for incoming email](reply_by_email_postfix_setup.md): Set up a
basic Postfix mail server with IMAP authentication on Ubuntu for incoming

View File

@ -581,7 +581,8 @@ limit value. For example, for a maximum frequency of:
- Once per 10 minutes, the limit must be `144`.
- Once per 60 minutes, the limit must be `24`
There is no limit for self-managed instances by default.
The minimum value is `24`, or one pipeline per 60 minutes.
There is no maximum value.
To set this limit to `1440` on a self-managed installation, run the following in the
[GitLab Rails console](operations/rails_console.md#starting-a-rails-console-session):

View File

@ -301,7 +301,7 @@ sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:4]
## Display status of database migrations
See the [upgrade documentation](../../update/index.md#checking-for-background-migrations-before-upgrading)
See the [background migrations documentation](../../update/background_migrations.md)
for how to check that migrations are complete when upgrading GitLab.
To check the status of specific migrations, you can use the following Rake task:

View File

@ -132,13 +132,13 @@ they have the following privileges:
Users granted access to a protected environment, but not push or merge access
to the branch deployed to it, are only granted access to deploy the environment.
[Invited groups](../../user/project/members/share_project_with_groups.md#share-a-project-with-a-group-of-users) added
[Invited groups](../../user/project/members/share_project_with_groups.md#share-a-project-with-a-group) added
to the project with [Reporter role](../../user/permissions.md#project-members-permissions), appear in the dropdown list for deployment-only access.
To add deployment-only access:
1. Create a group with members who are granted to access to the protected environment, if it doesn't exist yet.
1. [Invite the group](../../user/project/members/share_project_with_groups.md#share-a-project-with-a-group-of-users) to the project with the Reporter role.
1. [Invite the group](../../user/project/members/share_project_with_groups.md#share-a-project-with-a-group) to the project with the Reporter role.
1. Follow the steps in [Protecting Environments](#protecting-environments).
## Modifying and unprotecting environments

View File

@ -423,7 +423,7 @@ Check how the migration is performing while it's running. Multiple ways to do th
#### High-level status of batched background migrations
See how to [check the status of batched background migrations](../../update/index.md#checking-for-background-migrations-before-upgrading).
See how to [check the status of batched background migrations](../../update/background_migrations.md).
#### Query the database

View File

@ -924,6 +924,21 @@ sequence-generated column. To avoid accidental conflicts, specs should also
avoid manually specifying any values in these kinds of columns. Instead, leave
them unspecified, and look up the value after the row is created.
##### TestProf in migration specs
Because of what is described above, migration specs can't be run inside
a database transaction. Our test suite uses
[TestProf](https://github.com/test-prof/test-prof) to improve the runtime of the
test suite, but `TestProf` uses database transactions to perform these optimizations.
For this reason, we can't use `TestProf` methods in our migration specs.
These are the methods that should not be used and should be replaced with
default RSpec methods instead:
- `let_it_be`: use `let` or `let!` instead.
- `let_it_be_with_reload`: use `let` or `let!` instead.
- `let_it_be_with_refind`: use `let` or `let!` instead.
- `before_all`: use `before` or `before(:all)` instead.
#### Redis
GitLab stores two main categories of data in Redis: cached items, and Sidekiq

View File

@ -150,23 +150,23 @@ For more information on:
### Register GitLab in your SAML IdP
1. Register the GitLab SP in your SAML 2.0 IdP, using the application name specified
in `issuer`.
1. Register the GitLab SP in your SAML IdP, using the application name specified in `issuer`.
To ease configuration, most IdP accept a metadata URL for the application to provide
configuration information to the IdP. To build the metadata URL for GitLab, append
`users/auth/saml/metadata` to the HTTPS URL of your GitLab installation, for instance:
1. To provide configuration information to the IdP, build a metadata URL for the
application. To build the metadata URL for GitLab, append `users/auth/saml/metadata`
to the HTTPS URL of your GitLab installation. For example:
```plaintext
https://gitlab.example.com/users/auth/saml/metadata
```
```plaintext
https://gitlab.example.com/users/auth/saml/metadata
```
At a minimum the IdP *must* provide a claim containing the user's email address using `email` or `mail`.
See [configuring assertions](#configure-assertions) for other available claims.
At a minimum the IdP **must** provide a claim containing the user's email address
using `email` or `mail`. For more information on other available claims, see
[configuring assertions](#configure-assertions).
On the sign in page there should now be a SAML button below the regular sign in form.
Select the icon to begin the authentication process. If everything goes well the user
is returned to GitLab and signed in.
1. On the sign in page there should now be a SAML icon below the regular sign in form.
Select the icon to begin the authentication process. If authentication is successful,
you are returned to GitLab and signed in.
### Configure SAML on your IdP

View File

@ -141,6 +141,19 @@ This is to mitigate the risk of misuses, such as mass discovery of usernames in
The **rate limit** is 20 calls per minute per IP address.
### Project Jobs API endpoint
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104912) in GitLab 15.7 [with a flag](../administration/feature_flags.md) named `ci_enforce_rate_limits_jobs_api`. Disabled by default.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available,
ask an administrator to [enable the feature flag](../administration/feature_flags.md) named `ci_enforce_rate_limits_jobs_api`.
The feature is not ready for production use.
There is a rate limit for the endpoint `project/:id/jobs`, which is enforced to reduce timeouts when retrieving jobs.
The **rate limit** is 600 calls per minute per signed-in user.
## Troubleshooting
### Rack Attack is denylisting the load balancer

View File

@ -0,0 +1,461 @@
---
stage: Data Stores
group: Database
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Check for background migrations before upgrading
Certain releases may require different migrations to be
finished before you update to the newer version.
There are two kinds of migrations:
- [Background migrations](#background-migrations)
- [Batched background migrations](#batched-background-migrations) (available in GitLab 14.0 and later)
Background migrations and batched migrations are not the same, so you should check that both are
complete before updating.
Decrease the time required to complete these migrations by increasing the number of
[Sidekiq workers](../administration/sidekiq/extra_sidekiq_processes.md)
that can process jobs in the `background_migration` queue.
## Background migrations
### Pending migrations
**For Omnibus installations:**
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'
```
**For installations from source:**
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'
```
### Failed migrations
**For Omnibus installations:**
For GitLab 14.0-14.9:
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.failed.count'
```
For GitLab 14.10 and later:
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.with_status(:failed).count'
```
**For installations from source:**
For GitLab 14.0-14.9:
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.failed.count'
```
For GitLab 14.10 and later:
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.with_status(:failed).count'
```
## Batched background migrations **(FREE SELF)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51332) in GitLab 13.11, [behind a feature flag](../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/329511) in GitLab 13.12.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-batched-background-migrations).
There can be [risks when disabling released features](../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To update database tables in batches, GitLab can use batched background migrations. These migrations
are created by GitLab developers and run automatically on upgrade. However, such migrations are
limited in scope to help with migrating some `integer` database columns to `bigint`. This is needed to
prevent integer overflow for some tables.
Some installations [may need to run GitLab 14.0 for at least a day](index.md#1400) to complete the database changes introduced by that upgrade.
Batched background migrations are handled by Sidekiq and [run in isolation](../development/database/batched_background_migrations.md#isolation), so an instance can remain operational while the migrations are processed. However, there may be performance degradation on larger instances that are heavily used while batched background migrations are run, so it's a good idea to [actively monitor the Sidekiq status](../user/admin_area/index.md#background-jobs) until all migrations are completed.
### Check the status of batched background migrations
To check the status of batched background migrations:
1. On the top bar, select **Main menu > Admin**.
1. On the left sidebar, select **Monitoring > Background Migrations**.
![queued batched background migrations table](img/batched_background_migrations_queued_v14_0.png)
All migrations must have a `Finished` status before you upgrade GitLab.
The status of batched background migrations can also be queried directly in the database.
1. Log into a `psql` prompt according to the directions for your instance's installation method
(for example, `sudo gitlab-psql` for Omnibus installations).
1. Run the following query in the `psql` session to see details on incomplete batched background migrations:
```sql
select job_class_name, table_name, column_name, job_arguments from batched_background_migrations where status <> 3;
```
If the migrations are not finished and you try to update to a later version,
GitLab prompts you with an error:
```plaintext
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
```
If you get this error, [check the batched background migration options](#database-migrations-failing-because-of-batched-background-migration-not-finished) to complete the upgrade.
### Enable or disable batched background migrations
WARNING:
If you disable this feature flag, GitLab upgrades may fail.
Batched background migrations are under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:execute_batched_migrations_on_schedule)
```
To disable it:
```ruby
Feature.disable(:execute_batched_migrations_on_schedule)
```
### Pause batched background migrations in GitLab 14.x
To pause an ongoing batched background migration, use the `disable` command above.
This command causes the migration to complete the current batch, and then wait to start the next batch.
Use the following database queries to see the state of the current batched background migration:
1. Obtain the ID of the running migration:
```sql
SELECT
id,
job_class_name,
table_name,
column_name,
job_arguments
FROM batched_background_migrations
WHERE status <> 3;
```
1. Run this query, replacing `XX` with the ID you obtained in the previous step,
to see the status of the migration:
```sql
SELECT
started_at,
finished_at,
finished_at - started_at AS duration,
min_value,
max_value,
batch_size,
sub_batch_size
FROM batched_background_migration_jobs
WHERE batched_background_migration_id = XX
ORDER BY id DESC
limit 10;
```
1. Run the query multiple times within a few minutes to ensure no new row has been added.
If no new row has been added, the migration has been paused.
1. After confirming the migration has paused, restart the migration (using the `enable`
command above) to proceed with the batch when ready. On larger instances,
background migrations can take as long as 48 hours to complete each batch.
### Automatic batch size optimization
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60133)
> in GitLab 13.12, [behind a feature flag](../user/feature_flags.md),
> [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/329511).
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to
> [disable it](#enable-or-disable-automatic-batch-size-optimization).
There can be [risks when disabling released features](../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To maximize throughput of batched background migrations (in terms of the number of tuples updated per time unit), batch sizes are automatically adjusted based on how long the previous batches took to complete.
### Enable or disable automatic batch size optimization
Automatic batch size optimization for batched background migrations is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:optimize_batched_migrations)
```
To disable it:
```ruby
Feature.disable(:optimize_batched_migrations)
```
## Troubleshooting
### Database migrations failing because of batched background migration not finished
When updating to GitLab 14.2 or later there might be a database migration failing with a message like:
```plaintext
StandardError: An error has occurred, all later migrations canceled:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
{:job_class_name=>"CopyColumnUsingBackgroundMigrationJob", :table_name=>"push_event_payloads", :column_name=>"event_id", :job_arguments=>[["event_id"], ["event_id_convert_to_bigint"]]}
```
First, check if you have followed the [version-specific upgrade instructions for 14.2](../update/index.md#1420).
If you have, you can [manually finish the batched background migration](#manually-finishing-a-batched-background-migration).
If you haven't, choose one of the following methods:
1. [Rollback and upgrade](#roll-back-and-follow-the-required-upgrade-path) through one of the required
versions before updating to 14.2+.
1. [Roll forward](#roll-forward-and-finish-the-migrations-on-the-upgraded-version), staying on the current
version and manually ensuring that the batched migrations complete successfully.
#### Roll back and follow the required upgrade path
1. [Rollback and restore the previously installed version](../raketasks/backup_restore.md)
1. Update to either 14.0.5 or 14.1 **before** updating to 14.2+
1. [Check the status](#check-the-status-of-batched-background-migrations) of the batched background migrations and
make sure they are all marked as finished before attempting to upgrade again. If any remain marked as active,
you can [manually finish them](#manually-finishing-a-batched-background-migration).
#### Roll forward and finish the migrations on the upgraded version
##### For a deployment with downtime
To run all the batched background migrations, it can take a significant amount of time
depending on the size of your GitLab installation.
1. [Check the status](#check-the-status-of-batched-background-migrations) of the batched background migrations in the
database, and [manually run them](#manually-finishing-a-batched-background-migration) with the appropriate
arguments until the status query returns no rows.
1. When the status of all of all them is marked as complete, re-run migrations for your installation.
1. [Complete the database migrations](../administration/raketasks/maintenance.md#run-incomplete-database-migrations) from your GitLab upgrade:
```plaintext
sudo gitlab-rake db:migrate
```
1. Run a reconfigure:
```plaintext
sudo gitlab-ctl reconfigure
```
1. Finish the upgrade for your installation.
##### For a no-downtime deployment
As the failing migrations are post-deployment migrations, you can remain on a running instance of the upgraded
version and wait for the batched background migrations to finish normally.
1. [Check the status](#check-the-status-of-batched-background-migrations) of the batched background migration from
the error message, and make sure it is listed as finished. If it is still active, either wait until it is done,
or [manually finish it](#manually-finishing-a-batched-background-migration).
1. Re-run migrations for your installation, so the remaining post-deployment migrations finish.
### Manually finishing a batched background migration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62634) in GitLab 14.1
If you need to manually finish a batched background migration due to an
error, you can run:
```shell
sudo gitlab-rake gitlab:background_migrations:finalize[<job_class_name>,<table_name>,<column_name>,'<job_arguments>']
```
Replace the values in angle brackets with the correct
arguments. For example, if you receive an error similar to this:
```plaintext
StandardError: An error has occurred, all later migrations canceled:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
{:job_class_name=>"CopyColumnUsingBackgroundMigrationJob", :table_name=>"push_event_payloads", :column_name=>"event_id", :job_arguments=>[["event_id"], ["event_id_convert_to_bigint"]]}
```
Plug the arguments from the error message into the command:
```shell
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,push_event_payloads,event_id,'[["event_id"]\, ["event_id_convert_to_bigint"]]']
```
If you need to manually run a batched background migration to continue an upgrade, you can
[check the status](#check-the-status-of-batched-background-migrations) in the database and get the
arguments from the query results. For example, if the query returns this:
```plaintext
job_class_name | table_name | column_name | job_arguments
---------------------------------------+------------+-------------+------------------------------------
CopyColumnUsingBackgroundMigrationJob | events | id | [["id"], ["id_convert_to_bigint"]]
```
The results from the query can be plugged into the command:
```shell
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
```
### The `BackfillNamespaceIdForNamespaceRoute` batched migration job fails
In GitLab 14.8, the `BackfillNamespaceIdForNamespaceRoute` batched background migration job
may fail to complete. When retried, a `500 Server Error` is returned. This issue was
[resolved](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82387) in GitLab 14.9.
To resolve this issue, [upgrade GitLab](../update/index.md) from 14.8 to 14.9.
You can ignore the failed batch migration until after you update to GitLab 14.9.
### Background migrations remain in the Sidekiq queue
WARNING:
The following operations can disrupt your GitLab performance. They run a number of Sidekiq jobs that perform various database or file updates.
Run the following check. If it returns non-zero and the count does not decrease over time, follow the rest of the steps in this section.
```shell
# For Omnibus installations:
sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
# For installations from source:
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
```
It is safe to re-execute the following commands, especially if you have 1000+ pending jobs which would likely overflow your runtime memory.
**For Omnibus installations**
```shell
# Start the rails console
sudo gitlab-rails c
# Execute the following in the rails console
scheduled_queue = Sidekiq::ScheduledSet.new
pending_job_classes = scheduled_queue.select { |job| job["class"] == "BackgroundMigrationWorker" }.map { |job| job["args"].first }.uniq
pending_job_classes.each { |job_class| Gitlab::BackgroundMigration.steal(job_class) }
```
**For installations from source**
```shell
# Start the rails console
sudo -u git -H bundle exec rails RAILS_ENV=production
# Execute the following in the rails console
scheduled_queue = Sidekiq::ScheduledSet.new
pending_job_classes = scheduled_queue.select { |job| job["class"] == "BackgroundMigrationWorker" }.map { |job| job["args"].first }.uniq
pending_job_classes.each { |job_class| Gitlab::BackgroundMigration.steal(job_class) }
```
### Background migrations stuck in 'pending' state
WARNING:
The following operations can disrupt your GitLab performance. They run a number
of Sidekiq jobs that perform various database or file updates.
- GitLab 13.6 introduced an issue where a background migration named
`BackfillJiraTrackerDeploymentType2` can be permanently stuck in a
**pending** state across upgrades. To clean up this stuck migration, see the
[13.6.0 version-specific instructions](index.md#1360).
- GitLab 14.2 introduced an issue where a background migration named
`BackfillDraftStatusOnMergeRequests` can be permanently stuck in a
**pending** state across upgrades when the instance lacks records that match
the migration's target. To clean up this stuck migration, see the
[14.2.0 version-specific instructions](index.md#1420).
- GitLab 14.4 introduced an issue where a background migration named
`PopulateTopicsTotalProjectsCountCache` can be permanently stuck in a
**pending** state across upgrades when the instance lacks records that match
the migration's target. To clean up this stuck migration, see the
[14.4.0 version-specific instructions](index.md#1440).
- GitLab 14.5 introduced an issue where a background migration named
`UpdateVulnerabilityOccurrencesLocation` can be permanently stuck in a
**pending** state across upgrades when the instance lacks records that match
the migration's target. To clean up this stuck migration, see the
[14.5.0 version-specific instructions](index.md#1450).
- GitLab 14.8 introduced an issue where a background migration named
`PopulateTopicsNonPrivateProjectsCount` can be permanently stuck in a
**pending** state across upgrades. To clean up this stuck migration, see the
[14.8.0 version-specific instructions](index.md#1480).
- GitLab 14.9 introduced an issue where a background migration named
`ResetDuplicateCiRunnersTokenValuesOnProjects` can be permanently stuck in a
**pending** state across upgrades when the instance lacks records that match
the migration's target. To clean up this stuck migration, see the
[14.9.0 version-specific instructions](index.md#1490).
For other background migrations stuck in pending, run the following check. If
it returns non-zero and the count does not decrease over time, follow the rest
of the steps in this section.
```shell
# For Omnibus installations:
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending.count'
# For installations from source:
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending.count'
```
It is safe to re-attempt these migrations to clear them out from a pending status:
**For Omnibus installations**
```shell
# Start the rails console
sudo gitlab-rails c
# Execute the following in the rails console
Gitlab::Database::BackgroundMigrationJob.pending.find_each do |job|
puts "Running pending job '#{job.class_name}' with arguments #{job.arguments}"
result = Gitlab::BackgroundMigration.perform(job.class_name, job.arguments)
puts "Result: #{result}"
end
```
**For installations from source**
```shell
# Start the rails console
sudo -u git -H bundle exec rails RAILS_ENV=production
# Execute the following in the rails console
Gitlab::Database::BackgroundMigrationJob.pending.find_each do |job|
puts "Running pending job '#{job.class_name}' with arguments #{job.arguments}"
result = Gitlab::BackgroundMigration.perform(job.class_name, job.arguments)
puts "Result: #{result}"
end
```

View File

@ -73,210 +73,12 @@ from the chart version to GitLab version to determine the [upgrade path](#upgrad
See the guide to [plan your GitLab upgrade](plan_your_upgrade.md).
## Checking for background migrations before upgrading
## Check for background migrations before upgrading
Certain releases may require different migrations to be
finished before you update to the newer version.
[Batched migrations](#batched-background-migrations) are a migration type available in GitLab 14.0 and later.
Background migrations and batched migrations are not the same, so you should check that both are
complete before updating.
Decrease the time required to complete these migrations by increasing the number of
[Sidekiq workers](../administration/sidekiq/extra_sidekiq_processes.md)
that can process jobs in the `background_migration` queue.
### Background migrations
#### Pending migrations
**For Omnibus installations:**
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'
```
**For installations from source:**
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'
```
#### Failed migrations
**For Omnibus installations:**
For GitLab 14.0-14.9:
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.failed.count'
```
For GitLab 14.10 and later:
```shell
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.with_status(:failed).count'
```
**For installations from source:**
For GitLab 14.0-14.9:
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.failed.count'
```
For GitLab 14.10 and later:
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.with_status(:failed).count'
```
### Batched background migrations
GitLab 14.0 introduced [batched background migrations](../user/admin_area/monitoring/background_migrations.md).
Some installations [may need to run GitLab 14.0 for at least a day](#1400) to complete the database changes introduced by that upgrade.
Batched background migrations are handled by Sidekiq and [run in isolation](../development/database/batched_background_migrations.md#isolation), so an instance can remain operational while the migrations are processed. However, there may be performance degradation on larger instances that are heavily used while batched background migrations are run, so it's a good idea to [actively monitor the Sidekiq status](../user/admin_area/index.md#background-jobs) until all migrations are completed.
#### Check the status of batched background migrations
To check the status of batched background migrations:
1. On the top bar, select **Main menu > Admin**.
1. On the left sidebar, select **Monitoring > Background Migrations**.
![queued batched background migrations table](img/batched_background_migrations_queued_v14_0.png)
All migrations must have a `Finished` status before you upgrade GitLab.
The status of batched background migrations can also be queried directly in the database.
1. Log into a `psql` prompt according to the directions for your instance's installation method
(for example, `sudo gitlab-psql` for Omnibus installations).
1. Run the following query in the `psql` session to see details on incomplete batched background migrations:
```sql
select job_class_name, table_name, column_name, job_arguments from batched_background_migrations where status <> 3;
```
If the migrations are not finished and you try to update to a later version,
GitLab prompts you with an error:
```plaintext
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
```
If you get this error, [check the batched background migration options](../user/admin_area/monitoring/background_migrations.md#database-migrations-failing-because-of-batched-background-migration-not-finished) to complete the upgrade.
### What do you do if your background migrations are stuck?
WARNING:
The following operations can disrupt your GitLab performance. They run a number of Sidekiq jobs that perform various database or file updates.
#### Background migrations remain in the Sidekiq queue
Run the following check. If it returns non-zero and the count does not decrease over time, follow the rest of the steps in this section.
```shell
# For Omnibus installations:
sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
# For installations from source:
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
```
It is safe to re-execute the following commands, especially if you have 1000+ pending jobs which would likely overflow your runtime memory.
**For Omnibus installations**
```shell
# Start the rails console
sudo gitlab-rails c
# Execute the following in the rails console
scheduled_queue = Sidekiq::ScheduledSet.new
pending_job_classes = scheduled_queue.select { |job| job["class"] == "BackgroundMigrationWorker" }.map { |job| job["args"].first }.uniq
pending_job_classes.each { |job_class| Gitlab::BackgroundMigration.steal(job_class) }
```
**For installations from source**
```shell
# Start the rails console
sudo -u git -H bundle exec rails RAILS_ENV=production
# Execute the following in the rails console
scheduled_queue = Sidekiq::ScheduledSet.new
pending_job_classes = scheduled_queue.select { |job| job["class"] == "BackgroundMigrationWorker" }.map { |job| job["args"].first }.uniq
pending_job_classes.each { |job_class| Gitlab::BackgroundMigration.steal(job_class) }
```
#### Background migrations stuck in 'pending' state
GitLab 13.6 introduced an issue where a background migration named `BackfillJiraTrackerDeploymentType2` can be permanently stuck in a **pending** state across upgrades. To clean up this stuck migration, see the [13.6.0 version-specific instructions](#1360).
GitLab 14.2 introduced an issue where a background migration named `BackfillDraftStatusOnMergeRequests` can be permanently stuck in a **pending** state across upgrades when the instance lacks records that match the migration's target. To clean up this stuck migration, see the [14.2.0 version-specific instructions](#1420).
GitLab 14.4 introduced an issue where a background migration named `PopulateTopicsTotalProjectsCountCache` can be permanently stuck in a **pending** state across upgrades when the instance lacks records that match the migration's target. To clean up this stuck migration, see the [14.4.0 version-specific instructions](#1440).
GitLab 14.5 introduced an issue where a background migration named `UpdateVulnerabilityOccurrencesLocation` can be permanently stuck in a **pending** state across upgrades when the instance lacks records that match the migration's target. To clean up this stuck migration, see the [14.5.0 version-specific instructions](#1450).
GitLab 14.8 introduced an issue where a background migration named `PopulateTopicsNonPrivateProjectsCount` can be permanently stuck in a **pending** state across upgrades. To clean up this stuck migration, see the [14.8.0 version-specific instructions](#1480).
GitLab 14.9 introduced an issue where a background migration named `ResetDuplicateCiRunnersTokenValuesOnProjects` can be permanently stuck in a **pending** state across upgrades when the instance lacks records that match the migration's target. To clean up this stuck migration, see the [14.9.0 version-specific instructions](#1490).
For other background migrations stuck in pending, run the following check. If it returns non-zero and the count does not decrease over time, follow the rest of the steps in this section.
```shell
# For Omnibus installations:
sudo gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending.count'
# For installations from source:
cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending.count'
```
It is safe to re-attempt these migrations to clear them out from a pending status:
**For Omnibus installations**
```shell
# Start the rails console
sudo gitlab-rails c
# Execute the following in the rails console
Gitlab::Database::BackgroundMigrationJob.pending.find_each do |job|
puts "Running pending job '#{job.class_name}' with arguments #{job.arguments}"
result = Gitlab::BackgroundMigration.perform(job.class_name, job.arguments)
puts "Result: #{result}"
end
```
**For installations from source**
```shell
# Start the rails console
sudo -u git -H bundle exec rails RAILS_ENV=production
# Execute the following in the rails console
Gitlab::Database::BackgroundMigrationJob.pending.find_each do |job|
puts "Running pending job '#{job.class_name}' with arguments #{job.arguments}"
result = Gitlab::BackgroundMigration.perform(job.class_name, job.arguments)
puts "Result: #{result}"
end
```
#### Batched migrations (GitLab 14.0 and later)
See [troubleshooting batched background migrations](../user/admin_area/monitoring/background_migrations.md#troubleshooting).
For more information, see [background migrations](background_migrations.md).
## Dealing with running CI/CD pipelines and jobs
@ -360,7 +162,7 @@ A *major* upgrade requires the following steps:
1. Upgrade to the "dot zero" release of the next major version (`X.0.Z`).
1. Optional. Follow the [upgrade path](#upgrade-paths), and proceed with upgrading to newer releases of that major version.
It's also important to ensure that any [background migrations have been fully completed](#checking-for-background-migrations-before-upgrading)
It's also important to ensure that any [background migrations have been fully completed](background_migrations.md)
before upgrading to a new major version.
If you have enabled the [Elasticsearch integration](../integration/advanced_search/elasticsearch.md) **(PREMIUM SELF)**, then
@ -477,7 +279,7 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap
To upgrade to this version, no records with a `NULL` `work_item_type_id` should exist on the `issues` table.
There are multiple `BackfillWorkItemTypeIdForIssues` background migrations that will be finalized with
the `EnsureWorkItemTypeBackfillMigrationFinished` post-deploy migration.
- GitLab 15.4.0 introduced a [batched background migration](#batched-background-migrations) to
- GitLab 15.4.0 introduced a [batched background migration](background_migrations.md#batched-background-migrations) to
[backfill `namespace_id` values on issues table](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91921). This
migration might take multiple hours or days to complete on larger GitLab instances. Please make sure the migration
has completed successfully before upgrading to 15.7.0.
@ -515,6 +317,20 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap
- You should use one of the [officially supported PostgreSQL versions](../administration/package_information/postgresql_versions.md). Some database migrations can cause stability and performance issues with older PostgreSQL versions.
- Git 2.37.0 and later is required by Gitaly. For installations from source, we recommend you use the [Git version provided by Gitaly](../install/installation.md#git).
- A database change to modify the behavior of four indexes fails on instances
where these indexes do not exist:
```plaintext
Caused by:
PG::UndefinedTable: ERROR: relation "index_issues_on_title_trigram" does not exist
```
The other three indexes are: `index_merge_requests_on_title_trigram`, `index_merge_requests_on_description_trigram`,
and `index_issues_on_description_trigram`.
This issue was [fixed in GitLab 15.7](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105375) and backported
to GitLab 15.6.2. The issue can also be worked around:
[read about how to create these indexes](https://gitlab.com/gitlab-org/gitlab/-/issues/378343#note_1199863087).
### 15.5.0
@ -538,7 +354,7 @@ A [license caching issue](https://gitlab.com/gitlab-org/gitlab/-/issues/376706)
### 15.4.0
- GitLab 15.4.0 includes a [batched background migration](#batched-background-migrations) to [remove incorrect values from `expire_at` in `ci_job_artifacts` table](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89318).
- GitLab 15.4.0 includes a [batched background migration](background_migrations.md#batched-background-migrations) to [remove incorrect values from `expire_at` in `ci_job_artifacts` table](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89318).
This migration might take hours or days to complete on larger GitLab instances.
- By default, Gitaly and Praefect nodes use the time server at `pool.ntp.org`. If your instance can not connect to `pool.ntp.org`, [configure the `NTP_HOST` variable](../administration/gitaly/praefect.md#customize-time-server-setting).
- GitLab 15.4.0 introduced a default [Sidekiq routing rule](../administration/sidekiq/extra_sidekiq_routing.md) that routes all jobs to the `default` queue. For instances using [queue selectors](../administration/sidekiq/processing_specific_job_classes.md#queue-selectors), this will cause [performance problems](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/1991) as some Sidekiq processes will be idle.
@ -556,7 +372,7 @@ A [license caching issue](https://gitlab.com/gitlab-org/gitlab/-/issues/376706)
In a highly available or GitLab Geo environment, secrets need to be the same on all nodes.
If you're manually syncing the secrets file across nodes, or manually specifying secrets in
`/etc/gitlab/gitlab.rb`, make sure `/etc/gitlab/gitlab-secrets.json` is the same on all nodes.
- GitLab 15.4.0 introduced a [batched background migration](#batched-background-migrations) to
- GitLab 15.4.0 introduced a [batched background migration](background_migrations.md#batched-background-migrations) to
[backfill `namespace_id` values on issues table](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91921). This
migration might take multiple hours or days to complete on larger GitLab instances. Please make sure the migration
has completed successfully before upgrading to 15.7.0 or later.
@ -712,11 +528,11 @@ A [license caching issue](https://gitlab.com/gitlab-org/gitlab/-/issues/376706)
### 14.9.0
- Database changes made by the upgrade to GitLab 14.9 can take hours or days to complete on larger GitLab instances.
These [batched background migrations](#batched-background-migrations) update whole database tables to ensure corresponding
These [batched background migrations](background_migrations.md#batched-background-migrations) update whole database tables to ensure corresponding
records in `namespaces` table for each record in `projects` table.
After you update to 14.9.0 or a later 14.9 patch version,
[batched background migrations must finish](#batched-background-migrations)
[batched background migrations must finish](background_migrations.md#batched-background-migrations)
before you update to a later version.
If the migrations are not finished and you try to update to a later version,
@ -792,7 +608,7 @@ that may remain stuck permanently in a **pending** state.
[an issue with job retries](https://gitlab.com/gitlab-org/gitlab/-/issues/357822), first upgrade
to GitLab 14.7.x and make sure all batched migrations have finished.
- If upgrading from version 14.3.0 or later, you might notice a failed
[batched migration](../user/admin_area/monitoring/background_migrations.md) named
[batched migration](background_migrations.md#batched-background-migrations) named
`BackfillNamespaceIdForNamespaceRoute`. You can [ignore](https://gitlab.com/gitlab-org/gitlab/-/issues/357822)
this. Retry it after you upgrade to version 14.9.x.
- If you run external PostgreSQL, particularly AWS RDS,
@ -915,7 +731,7 @@ that may remain stuck permanently in a **pending** state when the instance lacks
### 14.3.0
- [Instances running 14.0.0 - 14.0.4 should not upgrade directly to GitLab 14.2 or later](#upgrading-to-later-14y-releases).
- Ensure [batched background migrations finish](#batched-background-migrations) before upgrading
- Ensure [batched background migrations finish](background_migrations.md#batched-background-migrations) before upgrading
to 14.3.Z from earlier GitLab 14 releases.
- Ruby 2.7.4 is required. Refer to [the Ruby installation instructions](../install/installation.md#2-ruby)
for how to proceed.
@ -977,7 +793,7 @@ for how to proceed.
### 14.2.0
- [Instances running 14.0.0 - 14.0.4 should not upgrade directly to GitLab 14.2 or later](#upgrading-to-later-14y-releases).
- Ensure [batched background migrations finish](#batched-background-migrations) before upgrading
- Ensure [batched background migrations finish](background_migrations.md#batched-background-migrations) before upgrading
to 14.2.Z from earlier GitLab 14 releases.
- GitLab 14.2.0 contains background migrations to [address Primary Key overflow risk for tables with an integer PK](https://gitlab.com/groups/gitlab-org/-/epics/4785) for the tables listed below:
- [`ci_build_needs`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65216)
@ -1021,7 +837,7 @@ for how to proceed.
It is not required for instances already running 14.0.5 (or later) to stop at 14.1.Z.
14.1 is included on the upgrade path for the broadest compatibility
with self-managed installations, and ensure 14.0.0-14.0.4 installations do not
encounter issues with [batched background migrations](#batched-background-migrations).
encounter issues with [batched background migrations](background_migrations.md#batched-background-migrations).
- Upgrading to GitLab [14.5](#1450) (or later) may take a lot longer if you do not upgrade to at least 14.1
first. The 14.1 merge request diff commits database migration can take hours to run, but runs in the
@ -1043,14 +859,14 @@ Prerequisites:
Long running batched background database migrations:
- Database changes made by the upgrade to GitLab 14.0 can take hours or days to complete on larger GitLab instances.
These [batched background migrations](#batched-background-migrations) update whole database tables to mitigate primary key overflow and must be finished before upgrading to GitLab 14.2 or later.
These [batched background migrations](background_migrations.md#batched-background-migrations) update whole database tables to mitigate primary key overflow and must be finished before upgrading to GitLab 14.2 or later.
- Due to an issue where `BatchedBackgroundMigrationWorkers` were
[not working](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/2785#note_614738345)
for self-managed instances, a [fix was created](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65106)
that requires an update to at least 14.0.5. The fix was also released in [14.1.0](#1410).
After you update to 14.0.5 or a later 14.0 patch version,
[batched background migrations must finish](#batched-background-migrations)
[batched background migrations must finish](background_migrations.md#batched-background-migrations)
before you update to a later version.
If the migrations are not finished and you try to update to a later version,
@ -1060,7 +876,7 @@ Long running batched background database migrations:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
```
See how to [resolve this error](../user/admin_area/monitoring/background_migrations.md#database-migrations-failing-because-of-batched-background-migration-not-finished).
See how to [resolve this error](background_migrations.md#database-migrations-failing-because-of-batched-background-migration-not-finished).
Other issues:
@ -1075,11 +891,11 @@ Other issues:
#### Upgrading to later 14.Y releases
- Instances running 14.0.0 - 14.0.4 should not upgrade directly to GitLab 14.2 or later,
because of [batched background migrations](#batched-background-migrations).
because of [batched background migrations](background_migrations.md#batched-background-migrations).
1. Upgrade first to either:
- 14.0.5 or a later 14.0.Z patch release.
- 14.1.0 or a later 14.1.Z patch release.
1. [Batched background migrations must finish](#batched-background-migrations)
1. [Batched background migrations must finish](background_migrations.md#batched-background-migrations)
before you update to a later version [and may take longer than usual](#1400).
### 13.12.0
@ -1182,7 +998,7 @@ See [Maintenance mode issue in GitLab 13.9 to 14.4](#maintenance-mode-issue-in-g
### 13.8.8
GitLab 13.8 includes a background migration to address [an issue with duplicate service records](https://gitlab.com/gitlab-org/gitlab/-/issues/290008). If duplicate services are present, this background migration must complete before a unique index is applied to the services table, which was [introduced in GitLab 13.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52563). Upgrades from GitLab 13.8 and earlier to later versions must include an intermediate upgrade to GitLab 13.8.8 and [must wait until the background migrations complete](#checking-for-background-migrations-before-upgrading) before proceeding.
GitLab 13.8 includes a background migration to address [an issue with duplicate service records](https://gitlab.com/gitlab-org/gitlab/-/issues/290008). If duplicate services are present, this background migration must complete before a unique index is applied to the services table, which was [introduced in GitLab 13.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52563). Upgrades from GitLab 13.8 and earlier to later versions must include an intermediate upgrade to GitLab 13.8.8 and [must wait until the background migrations complete](background_migrations.md) before proceeding.
If duplicate services are still present, an upgrade to 13.9.x or later results in a failed upgrade with the following error:

View File

@ -16,7 +16,7 @@ GitLab package.
- If you are upgrading from a non-package installation to a GitLab package installation, see
[Upgrading from a non-package installation to a GitLab package installation](https://docs.gitlab.com/omnibus/update/convert_to_omnibus.html).
- Ensure that any
[background migrations](../index.md#checking-for-background-migrations-before-upgrading)
[background migrations](../background_migrations.md)
are fully completed. Upgrading
before background migrations have finished can lead to data corruption.
We recommend performing upgrades between major and minor releases no more than once per

View File

@ -136,5 +136,5 @@ If all items are green, then congratulations upgrade complete!
### 11. Make sure background migrations are finished
[Check the status of background migrations](../user/admin_area/monitoring/background_migrations.md#check-the-status-of-background-migrations)
[Check the status of background migrations](../update/background_migrations.md)
and make sure they are finished.

View File

@ -126,7 +126,7 @@ to your instance and then upgrade it for any relevant features you're using.
- Account for any [version-specific changes](package/index.md#version-specific-changes).
- Check the [OS compatibility with the target GitLab version](../administration/package_information/supported_os.md).
- Due to background migrations, plan to pause before any further upgrades.
[All migrations must finish running](index.md#checking-for-background-migrations-before-upgrading)
[All migrations must finish running](background_migrations.md)
before the next upgrade.
- If available in your starting version, consider
[turning on maintenance mode](../administration/maintenance_mode/index.md) during the
@ -173,7 +173,7 @@ If you have Kubernetes clusters connected with GitLab, [upgrade your GitLab agen
#### Elasticsearch
Before updating GitLab, confirm Advanced Search migrations are complete by
[checking for pending advanced search migrations](index.md#checking-for-pending-advanced-search-migrations).
[checking for pending advanced search migrations](background_migrations.md).
After updating GitLab, you may have to upgrade
[Elasticsearch if the new version breaks compatibility](../integration/advanced_search/elasticsearch.md#version-requirements).

View File

@ -29,7 +29,7 @@ to identify the ideal upgrade path.
Before upgrading to a new major version, you should ensure that any background
migration jobs from previous releases have been completed. To see the current size of the `background_migration` queue,
[Check for background migrations before upgrading](index.md#checking-for-background-migrations-before-upgrading).
[Check for background migrations before upgrading](background_migrations.md).
## Guidelines for all versions

View File

@ -54,12 +54,12 @@ Certain major/minor releases may require a set of background migrations to be
finished. To guarantee this, such a release processes any remaining jobs
before continuing the upgrading procedure. While this doesn't require downtime
(if the above conditions are met) we require that you
[wait for background migrations to complete](index.md#checking-for-background-migrations-before-upgrading)
[wait for background migrations to complete](background_migrations.md)
between each major/minor release upgrade.
The time necessary to complete these migrations can be reduced by
increasing the number of Sidekiq workers that can process jobs in the
`background_migration` queue. To see the size of this queue,
[Check for background migrations before upgrading](index.md#checking-for-background-migrations-before-upgrading).
[Check for background migrations before upgrading](background_migrations.md).
As a guideline, any database smaller than 10 GB doesn't take too much time to
upgrade; perhaps an hour at most per minor release. Larger databases however may

View File

@ -1,244 +1,11 @@
---
stage: Data Stores
group: Database
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
redirect_to: '../../../update/background_migrations.md'
remove_date: '2023-03-11'
---
# Batched background migrations **(FREE SELF)**
This document was moved to [another location](../../../update/background_migrations.md).
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51332) in GitLab 13.11.
> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/329511) in GitLab 13.12.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-batched-background-migrations).
There can be [risks when disabling released features](../../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To update database tables in batches, GitLab can use batched background migrations. These migrations
are created by GitLab developers and run automatically on upgrade. However, such migrations are
limited in scope to help with migrating some `integer` database columns to `bigint`. This is needed to
prevent integer overflow for some tables.
## Check the status of background migrations
All migrations must have a `Finished` status before you [upgrade GitLab](../../../update/index.md).
You can [check the status of existing migrations](../../../update/index.md#batched-background-migrations).
## Enable or disable batched background migrations
WARNING:
If you disable this feature flag, GitLab upgrades may fail.
Batched background migrations are under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:execute_batched_migrations_on_schedule)
```
To disable it:
```ruby
Feature.disable(:execute_batched_migrations_on_schedule)
```
### Pause batched background migrations in GitLab 14.x
To pause an ongoing batched background migration, use the `disable` command above.
This command causes the migration to complete the current batch, and then wait to start the next batch.
Use the following database queries to see the state of the current batched background migration:
1. Obtain the ID of the running migration:
```sql
SELECT
id,
job_class_name,
table_name,
column_name,
job_arguments
FROM batched_background_migrations
WHERE status <> 3;
```
1. Run this query, replacing `XX` with the ID you obtained in the previous step,
to see the status of the migration:
```sql
SELECT
started_at,
finished_at,
finished_at - started_at AS duration,
min_value,
max_value,
batch_size,
sub_batch_size
FROM batched_background_migration_jobs
WHERE batched_background_migration_id = XX
ORDER BY id DESC
limit 10;
```
1. Run the query multiple times within a few minutes to ensure no new row has been added.
If no new row has been added, the migration has been paused.
1. After confirming the migration has paused, restart the migration (using the `enable`
command above) to proceed with the batch when ready. On larger instances,
background migrations can take as long as 48 hours to complete each batch.
## Automatic batch size optimization
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60133) in GitLab 13.12.
> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/329511) in GitLab 13.12.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-automatic-batch-size-optimization).
There can be [risks when disabling released features](../../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To maximize throughput of batched background migrations (in terms of the number of tuples updated per time unit), batch sizes are automatically adjusted based on how long the previous batches took to complete.
## Enable or disable automatic batch size optimization
Automatic batch size optimization for batched background migrations is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:optimize_batched_migrations)
```
To disable it:
```ruby
Feature.disable(:optimize_batched_migrations)
```
## Troubleshooting
### Database migrations failing because of batched background migration not finished
When updating to GitLab 14.2 or later there might be a database migration failing with a message like:
```plaintext
StandardError: An error has occurred, all later migrations canceled:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
{:job_class_name=>"CopyColumnUsingBackgroundMigrationJob", :table_name=>"push_event_payloads", :column_name=>"event_id", :job_arguments=>[["event_id"], ["event_id_convert_to_bigint"]]}
```
First, check if you have followed the [version-specific upgrade instructions for 14.2](../../../update/index.md#1420).
If you have, you can [manually finish the batched background migration](#manually-finishing-a-batched-background-migration).
If you haven't, choose one of the following methods:
1. [Rollback and upgrade](#roll-back-and-follow-the-required-upgrade-path) through one of the required
versions before updating to 14.2+.
1. [Roll forward](#roll-forward-and-finish-the-migrations-on-the-upgraded-version), staying on the current
version and manually ensuring that the batched migrations complete successfully.
#### Roll back and follow the required upgrade path
1. [Rollback and restore the previously installed version](../../../raketasks/backup_restore.md)
1. Update to either 14.0.5 or 14.1 **before** updating to 14.2+
1. [Check the status](#check-the-status-of-background-migrations) of the batched background migrations and
make sure they are all marked as finished before attempting to upgrade again. If any remain marked as active,
you can [manually finish them](#manually-finishing-a-batched-background-migration).
#### Roll forward and finish the migrations on the upgraded version
##### For a deployment with downtime
To run all the batched background migrations, it can take a significant amount of time
depending on the size of your GitLab installation.
1. [Check the status](#check-the-status-of-background-migrations) of the batched background migrations in the
database, and [manually run them](#manually-finishing-a-batched-background-migration) with the appropriate
arguments until the status query returns no rows.
1. When the status of all of all them is marked as complete, re-run migrations for your installation.
1. [Complete the database migrations](../../../administration/raketasks/maintenance.md#run-incomplete-database-migrations) from your GitLab upgrade:
```plaintext
sudo gitlab-rake db:migrate
```
1. Run a reconfigure:
```plaintext
sudo gitlab-ctl reconfigure
```
1. Finish the upgrade for your installation.
##### For a no-downtime deployment
As the failing migrations are post-deployment migrations, you can remain on a running instance of the upgraded
version and wait for the batched background migrations to finish normally.
1. [Check the status](#check-the-status-of-background-migrations) of the batched background migration from
the error message, and make sure it is listed as finished. If it is still active, either wait until it is done,
or [manually finish it](#manually-finishing-a-batched-background-migration).
1. Re-run migrations for your installation, so the remaining post-deployment migrations finish.
### Manually finishing a batched background migration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62634) in GitLab 14.1
If you need to manually finish a batched background migration due to an
error, you can run:
```shell
sudo gitlab-rake gitlab:background_migrations:finalize[<job_class_name>,<table_name>,<column_name>,'<job_arguments>']
```
Replace the values in angle brackets with the correct
arguments. For example, if you receive an error similar to this:
```plaintext
StandardError: An error has occurred, all later migrations canceled:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
{:job_class_name=>"CopyColumnUsingBackgroundMigrationJob", :table_name=>"push_event_payloads", :column_name=>"event_id", :job_arguments=>[["event_id"], ["event_id_convert_to_bigint"]]}
```
Plug the arguments from the error message into the command:
```shell
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,push_event_payloads,event_id,'[["event_id"]\, ["event_id_convert_to_bigint"]]']
```
If you need to manually run a batched background migration to continue an upgrade, you can
[check the status](#check-the-status-of-background-migrations) in the database and get the
arguments from the query results. For example, if the query returns this:
```plaintext
job_class_name | table_name | column_name | job_arguments
---------------------------------------+------------+-------------+------------------------------------
CopyColumnUsingBackgroundMigrationJob | events | id | [["id"], ["id_convert_to_bigint"]]
```
The results from the query can be plugged into the command:
```shell
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
```
### The `BackfillNamespaceIdForNamespaceRoute` batched migration job fails
In GitLab 14.8, the `BackfillNamespaceIdForNamespaceRoute` batched background migration job
may fail to complete. When retried, a `500 Server Error` is returned. This issue was
[resolved](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82387) in GitLab 14.9.
To resolve this issue, [upgrade GitLab](../../../update/index.md) from 14.8 to 14.9.
You can ignore the failed batch migration until after you update to GitLab 14.9.
<!-- This redirect file can be deleted after <2023-03-11>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->

View File

@ -58,3 +58,126 @@ state-list:
resource_group: ${TF_STATE_NAME}
script: gitlab-terraform state list
```
## Add custom debug tools to jobs
The default image used by Terraform template jobs contains only minimal tooling.
However, you might want to add additional tools for debugging.
To add an additional tool:
1. Install the tool in the `before_script` of a job or pipeline.
1. Use the tool in the `script` or `after_script` block.
- If you use the `script` block, be sure to re-add the template job commands.
For example, the following snippet installs `bash` and `jq` in the `before_script` for all
jobs in the pipeline:
```yaml
include:
- template: Terraform.latest.gitlab-ci.yml
default:
before_script: apk add --update bash jq
```
To add it to only the `build` and `deploy` jobs, add it to those jobs directly:
```yaml
include:
- template: Terraform.latest.gitlab-ci.yml
build:
before_script: apk add --update bash jq
deploy:
before_script: apk add --update bash jq
```
## Add custom container images
For debug tools and simple installations, you should
[add a custom debug tool to your job](#add-custom-debug-tools-to-jobs).
If your tool is complex or benefits from caching,
you can create a custom container image based on the
[`gitlab-terraform`](https://gitlab.com/gitlab-org/terraform-images) images.
You can use your custom image in subsequent Terraform jobs.
To define a custom container image:
1. Define a new `Dockerfile` with custom tooling. For example, install `bash` and `jq` in `.gitlab/ci/Dockerfile`:
```dockerfile
FROM registry.gitlab.com/gitlab-org/terraform-images/stable:latest
RUN apk add --update bash jq
```
1. In a new job, define a `prepare` stage that builds the image whenever the `Dockerfile` changes.
- The built image is pushed to the [GitLab Container Registry](../../packages/container_registry). A tag is applied to indicate whether the image was built from a merge request or from the default branch.
1. Use your image in your Terraform jobs, such as `build` and `deploy`.
- You can combine your image with specialized `before_script` configurations to perform setup commands, like to generate inputs for Terraform.
For example, a fully functioning pipeline configuration might look like:
```yaml
include:
- template: Terraform.latest.gitlab-ci.yml
variables:
IMAGE_TAG: latest
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
changes:
- .gitlab/ci/Dockerfile
variables:
IMAGE_TAG: ${CI_COMMIT_REF_SLUG}
- when: always
stages:
- prepare
- validate
- test
- build
- deploy
- cleanup
prepare:image:
needs: []
stage: prepare
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
rules:
# Tag with the commit SHA if we're in an MR
- if: $CI_MERGE_REQUEST_IID
changes:
- .gitlab/ci/Dockerfile
variables:
DOCKER_TAG: $CI_COMMIT_REF_SLUG
# If we're on our main branch, tag with "latest"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
changes:
- .gitlab/ci/Dockerfile
variables:
DOCKER_TAG: latest
before_script:
# Authenticate to the docker registry and dependency proxy
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\"}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}/.gitlab/ci"
--cache=true
--dockerfile "${CI_PROJECT_DIR}/.gitlab/ci/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${DOCKER_TAG}"
build:
image: ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}
deploy:
image: ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}
```
For an example repository, see the [GitLab Terraform template usage project](https://gitlab.com/gitlab-org/configure/examples/terraform-template-usage).

View File

@ -40,7 +40,7 @@ To create an issue description template:
where `mytemplate` is the name of your issue template.
1. Commit to your default branch.
To check if this has worked correctly, [create a new issue](issues/managing_issues.md#create-an-issue)
To check if this has worked correctly, [create a new issue](issues/create_issues.md)
and see if you can find your description template in the **Choose a template** dropdown list.
## Create a merge request template
@ -81,7 +81,7 @@ To discard any changes to the description you've made after selecting the templa
NOTE:
You can create shortcut links to create an issue using a designated template.
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`. Read more about [creating issues using a URL with prefilled values](issues/managing_issues.md#using-a-url-with-prefilled-values).
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`. Read more about [creating issues using a URL with prefilled values](issues/create_issues.md#using-a-url-with-prefilled-values).
### Supported variables in merge request templates

View File

@ -0,0 +1,221 @@
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Create an issue **(FREE)**
When you create an issue, you are prompted to enter the fields of the issue.
If you know the values you want to assign to an issue, you can use
[quick actions](../quick_actions.md) to enter them.
You can create an issue in many ways in GitLab:
- [From a project](#from-a-project)
- [From a group](#from-a-group)
- [From another issue or incident](#from-another-issue-or-incident)
- [From an issue board](#from-an-issue-board)
- [By sending an email](#by-sending-an-email)
- [Using a URL with prefilled values](#using-a-url-with-prefilled-values)
- [Using Service Desk](#using-service-desk)
## From a project
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue:
1. On the top bar, select **Main menu > Projects** and find your project.
1. Either:
- On the left sidebar, select **Issues**, and then, in the top right corner, select **New issue**.
- On the top bar, select the plus sign (**{plus-square}**) and then, under **This project**,
select **New issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
## From a group
Issues belong to projects, but when you're in a group, you can access and create issues that belong
to the projects in the group.
Prerequisites:
- You must have at least the Guest role for the project in the group.
To create an issue from a group:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Issues**.
1. In the top right corner, select **Select project to create issue**.
1. Select the project you'd like to create an issue for. The button now reflects the selected
project.
1. Select **New issue in `<project name>`**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
The project you selected most recently becomes the default for your next visit.
This can save you a lot of time, if you mostly create issues for the same project.
## From another issue or incident
> - New issue becoming linked to the issue of origin [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68226) in GitLab 14.3.
> - **Relate to…** checkbox [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/198494) in GitLab 14.9.
You can create a new issue from an existing one. The two issues can then be marked as related.
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from another issue:
1. In an existing issue, select the vertical ellipsis (**{ellipsis_v}**).
1. Select **New related issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
The new issue form has a **Relate to issue #123** checkbox, where `123` is the ID of the
issue of origin. If you keep this checkbox checked, the two issues become
[linked](related_issues.md).
1. Select **Create issue**.
The newly created issue opens.
## From an issue board
You can create a new issue from an [issue board](../issue_board.md).
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from a project issue board:
1. On the top bar, select **Main menu > Projects** and find your project.
1. Select **Issues > Boards**.
1. At the top of a board list, select **New issue** (**{plus-square}**).
1. Enter the issue's title.
1. Select **Create issue**.
To create an issue from a group issue board:
1. On the top bar, select **Main menu > Groups** and find your group.
1. Select **Issues > Boards**.
1. At the top of a board list, select **New issue** (**{plus-square}**).
1. Enter the issue's title.
1. Under **Projects**, select the project in the group that the issue should belong to.
1. Select **Create issue**.
The issue is created and shows up in the board list. It shares the list's characteristic, so, for
example, if the list is scoped to a label `Frontend`, the new issue also has this label.
## By sending an email
> - Generated email address format changed in GitLab 11.7.
> - The older format is still supported, so existing aliases and contacts still work.
You can send an email to create an issue in a project on the project's
**Issues List** page.
Prerequisites:
- Your GitLab instance must have [incoming email](../../../administration/incoming_email.md)
configured.
- There must be at least one issue in the issue list.
- You must have at least the Guest role for the project.
To email an issue to a project:
1. On the top bar, select **Main menu > Projects** and find your project.
1. Select **Issues**.
1. At the bottom of the page, select **Email a new issue to this project**.
1. To copy the email address, select **Copy** (**{copy-to-clipboard}**).
1. From your email client, send an email to this address.
The subject is used as the title of the new issue, and the email body becomes the description.
You can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md).
A new issue is created, with your user as the author.
You can save this address as a contact in your email client to use it again.
WARNING:
The email address you see is a private email address, generated just for you.
**Keep it to yourself**, because anyone who knows it can create issues or merge requests as if they
were you.
To regenerate the email address:
1. On the issues list, select **Email a new issue to this project**.
1. Select **reset this token**.
## Using a URL with prefilled values
> - Ability to use both `issuable_template` and `issue[description]` in the same URL [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80554) in GitLab 14.9.
> - Ability to specify `add_related_issue` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/198494) in GitLab 14.9.
To link directly to the new issue page with prefilled fields, use query
string parameters in a URL. You can embed a URL in an external
HTML page to create issues with certain fields prefilled.
| Field | URL parameter | Notes |
| -------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Title | `issue[title]` | Must be [URL-encoded](../../../api/index.md#namespaced-path-encoding). |
| Issue type | `issue[issue_type]` | Either `incident` or `issue`. |
| Description template | `issuable_template` | Must be [URL-encoded](../../../api/index.md#namespaced-path-encoding). |
| Description | `issue[description]` | Must be [URL-encoded](../../../api/index.md#namespaced-path-encoding). If used in combination with `issuable_template` or a [default issue template](../description_templates.md#set-a-default-template-for-merge-requests-and-issues), the `issue[description]` value is appended to the template. |
| Confidential | `issue[confidential]` | If `true`, the issue is marked as confidential. |
| Relate to… | `add_related_issue` | A numeric issue ID. If present, the issue form shows a [**Relate to…** checkbox](#from-another-issue-or-incident) to optionally link the new issue to the specified existing issue. |
Adapt these examples to form your new issue URL with prefilled fields.
To create an issue in the GitLab project:
- With a prefilled title and description:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Whoa%2C%20we%27re%20half-way%20there&issue[description]=Whoa%2C%20livin%27%20in%20a%20URL
```
- With a prefilled title and description template:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issuable_template=Feature%20Proposal%20-%20basic
```
- With a prefilled title, description, and marked as confidential:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea&issue[confidential]=true
```
## Using Service Desk
To offer email support, enable [Service Desk](../service_desk.md) for your project.
Now, when your customer sends a new email, a new issue can be created in
the appropriate project and followed up from there.
### Fields in the new issue form
> - Adding the new issue to an epic [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13847) in GitLab 13.1.
> - Iteration field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233517) in GitLab 15.6.
When you're creating a new issue, you can complete the following fields:
- Title
- Type: either issue (default) or incident
- [Description template](../description_templates.md): overwrites anything in the Description text box
- Description: you can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md)
- Checkbox to make the issue [confidential](confidential_issues.md)
- [Assignees](managing_issues.md#assignee)
- [Weight](issue_weight.md)
- [Epic](../../group/epics/index.md)
- [Due date](due_dates.md)
- [Milestone](../milestones/index.md)
- [Labels](../labels.md)
- [Iteration](../../group/iterations/index.md)

View File

@ -29,7 +29,7 @@ To learn how the GitLab Strategic Marketing department uses GitLab issues with [
## Related topics
- [Create issues](managing_issues.md#create-an-issue)
- [Create issues](create_issues.md)
- [Create an issue from a template](../../project/description_templates.md#use-the-templates)
- [Edit issues](managing_issues.md#edit-an-issue)
- [Move issues](managing_issues.md#move-an-issue)

View File

@ -36,7 +36,7 @@ When you change the weight of an issue, the new value overwrites the previous va
### When you create an issue
To set the issue weight when you [create an issue](managing_issues.md#create-an-issue), enter a
To set the issue weight when you [create an issue](create_issues.md), enter a
number under **Weight**.
### From an existing issue

View File

@ -6,224 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Manage issues **(FREE)**
[GitLab Issues](index.md) are the fundamental medium for collaborating on ideas and
planning work in GitLab.
## Create an issue
When you create an issue, you are prompted to enter the fields of the issue.
If you know the values you want to assign to an issue, you can use
[quick actions](../quick_actions.md) to enter them.
You can create an issue in many ways in GitLab:
- [From a project](#from-a-project)
- [From a group](#from-a-group)
- [From another issue or incident](#from-another-issue-or-incident)
- [From an issue board](#from-an-issue-board)
- [By sending an email](#by-sending-an-email)
- [Using a URL with prefilled values](#using-a-url-with-prefilled-values)
- [Using Service Desk](#using-service-desk)
### From a project
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue:
1. On the top bar, select **Main menu > Projects** and find your project.
1. Either:
- On the left sidebar, select **Issues**, and then, in the top right corner, select **New issue**.
- On the top bar, select the plus sign (**{plus-square}**) and then, under **This project**,
select **New issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
### From a group
Issues belong to projects, but when you're in a group, you can access and create issues that belong
to the projects in the group.
Prerequisites:
- You must have at least the Guest role for the project in the group.
To create an issue from a group:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Issues**.
1. In the top right corner, select **Select project to create issue**.
1. Select the project you'd like to create an issue for. The button now reflects the selected
project.
1. Select **New issue in `<project name>`**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
The project you selected most recently becomes the default for your next visit.
This can save you a lot of time, if you mostly create issues for the same project.
### From another issue or incident
> - New issue becoming linked to the issue of origin [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68226) in GitLab 14.3.
> - **Relate to…** checkbox [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/198494) in GitLab 14.9.
You can create a new issue from an existing one. The two issues can then be marked as related.
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from another issue:
1. In an existing issue, select the vertical ellipsis (**{ellipsis_v}**).
1. Select **New related issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
The new issue form has a **Relate to issue #123** checkbox, where `123` is the ID of the
issue of origin. If you keep this checkbox checked, the two issues become
[linked](related_issues.md).
1. Select **Create issue**.
The newly created issue opens.
### From an issue board
You can create a new issue from an [issue board](../issue_board.md).
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from a project issue board:
1. On the top bar, select **Main menu > Projects** and find your project.
1. Select **Issues > Boards**.
1. At the top of a board list, select **New issue** (**{plus-square}**).
1. Enter the issue's title.
1. Select **Create issue**.
To create an issue from a group issue board:
1. On the top bar, select **Main menu > Groups** and find your group.
1. Select **Issues > Boards**.
1. At the top of a board list, select **New issue** (**{plus-square}**).
1. Enter the issue's title.
1. Under **Projects**, select the project in the group that the issue should belong to.
1. Select **Create issue**.
The issue is created and shows up in the board list. It shares the list's characteristic, so, for
example, if the list is scoped to a label `Frontend`, the new issue also has this label.
### By sending an email
> - Generated email address format changed in GitLab 11.7.
> - The older format is still supported, so existing aliases and contacts still work.
You can send an email to create an issue in a project on the project's
**Issues List** page.
Prerequisites:
- Your GitLab instance must have [incoming email](../../../administration/incoming_email.md)
configured.
- There must be at least one issue in the issue list.
- You must have at least the Guest role for the project.
To email an issue to a project:
1. On the top bar, select **Main menu > Projects** and find your project.
1. Select **Issues**.
1. At the bottom of the page, select **Email a new issue to this project**.
1. To copy the email address, select **Copy** (**{copy-to-clipboard}**).
1. From your email client, send an email to this address.
The subject is used as the title of the new issue, and the email body becomes the description.
You can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md).
A new issue is created, with your user as the author.
You can save this address as a contact in your email client to use it again.
WARNING:
The email address you see is a private email address, generated just for you.
**Keep it to yourself**, because anyone who knows it can create issues or merge requests as if they
were you.
To regenerate the email address:
1. On the issues list, select **Email a new issue to this project**.
1. Select **reset this token**.
### Using a URL with prefilled values
> - Ability to use both `issuable_template` and `issue[description]` in the same URL [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80554) in GitLab 14.9.
> - Ability to specify `add_related_issue` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/198494) in GitLab 14.9.
To link directly to the new issue page with prefilled fields, use query
string parameters in a URL. You can embed a URL in an external
HTML page to create issues with certain fields prefilled.
| Field | URL parameter | Notes |
| -------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Title | `issue[title]` | Must be [URL-encoded](../../../api/index.md#namespaced-path-encoding). |
| Issue type | `issue[issue_type]` | Either `incident` or `issue`. |
| Description template | `issuable_template` | Must be [URL-encoded](../../../api/index.md#namespaced-path-encoding). |
| Description | `issue[description]` | Must be [URL-encoded](../../../api/index.md#namespaced-path-encoding). If used in combination with `issuable_template` or a [default issue template](../description_templates.md#set-a-default-template-for-merge-requests-and-issues), the `issue[description]` value is appended to the template. |
| Confidential | `issue[confidential]` | If `true`, the issue is marked as confidential. |
| Relate to… | `add_related_issue` | A numeric issue ID. If present, the issue form shows a [**Relate to…** checkbox](#from-another-issue-or-incident) to optionally link the new issue to the specified existing issue. |
Adapt these examples to form your new issue URL with prefilled fields.
To create an issue in the GitLab project:
- With a prefilled title and description:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Whoa%2C%20we%27re%20half-way%20there&issue[description]=Whoa%2C%20livin%27%20in%20a%20URL
```
- With a prefilled title and description template:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issuable_template=Feature%20Proposal%20-%20basic
```
- With a prefilled title, description, and marked as confidential:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea&issue[confidential]=true
```
### Using Service Desk
To offer email support, enable [Service Desk](../service_desk.md) for your project.
Now, when your customer sends a new email, a new issue can be created in
the appropriate project and followed up from there.
### Fields in the new issue form
> - Adding the new issue to an epic [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13847) in GitLab 13.1.
> - Iteration field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233517) in GitLab 15.6.
When you're creating a new issue, you can complete the following fields:
- Title
- Type: either issue (default) or incident
- [Description template](../description_templates.md): overwrites anything in the Description text box
- Description: you can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md)
- Checkbox to make the issue [confidential](confidential_issues.md)
- [Assignees](#assignee)
- [Weight](issue_weight.md)
- [Epic](../../group/epics/index.md)
- [Due date](due_dates.md)
- [Milestone](../milestones/index.md)
- [Labels](../labels.md)
- [Iteration](../../group/iterations/index.md)
After you create an issue, you can start working with it.
## Edit an issue
@ -239,27 +22,7 @@ To edit an issue:
1. Edit the available fields.
1. Select **Save changes**.
### Reorder list items in the issue description
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15260) in GitLab 15.0.
When you view an issue that has a list in the description, you can also reorder the list items.
Prerequisites:
- You must have at least the Reporter role for the project, be the author of the issue, or be
assigned to the issue.
- The issue's description must have an [ordered, unordered](../../markdown.md#lists), or
[task](../../markdown.md#task-lists) list.
To reorder list items, when viewing an issue:
1. Hover over the list item row to make the drag icon (**{drag-vertical}**) visible.
1. Select and hold the drag icon.
1. Drag the row to the new position in the list.
1. Release the drag icon.
### Bulk edit issues from a project
## Bulk edit issues from a project
> - Assigning epic [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/210470) in GitLab 13.2.
> - Editing health status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218395) in GitLab 13.2.
@ -283,7 +46,7 @@ To edit multiple issues at the same time:
When bulk editing issues in a project, you can edit the following attributes:
- Status (open or closed)
- [Assignees](#assignee)
- [Assignees](managing_issues.md#assignee)
- [Epic](../../group/epics/index.md)
- [Milestone](../milestones/index.md)
- [Labels](../labels.md)
@ -396,6 +159,26 @@ To do it:
1. To exit the Rails console, enter `quit`.
## Reorder list items in the issue description
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15260) in GitLab 15.0.
When you view an issue that has a list in the description, you can also reorder the list items.
Prerequisites:
- You must have at least the Reporter role for the project, be the author of the issue, or be
assigned to the issue.
- The issue's description must have an [ordered, unordered](../../markdown.md#lists), or
[task](../../markdown.md#task-lists) list.
To reorder list items, when viewing an issue:
1. Hover over the list item row to make the drag icon (**{drag-vertical}**) visible.
1. Select and hold the drag icon.
1. Drag the row to the new position in the list.
1. Release the drag icon.
## Close an issue
When you decide that an issue is resolved or no longer needed, you can close it.

View File

@ -17,14 +17,14 @@ When a project is shared with a group:
- All group members, including members of subgroups or projects that belong to the group,
are assigned the same role in the project.
This role is displayed in the Max role column of the Project members list.
Each member's role is displayed in **Project information > Members > Max role**.
- The group is listed in the **Groups** tab.
- The project is listed on the group dashboard.
Be aware of the restrictions that apply when sharing projects with:
Be aware of the restrictions that apply when you share projects with:
- [Groups with a more restrictive visibility level](#share-projects-with-groups-with-a-more-restrictive-visibility-level).
- [Group lock](#share-project-with-group-lock).
- [Restricted sharing](#prevent-project-sharing).
## Share projects with groups with a more restrictive visibility level
@ -41,7 +41,7 @@ For example, you can share:
This restriction applies to subgroups as well. For example, `group/subgroup01/project`:
- Can not be shared with `group`.
- Can't be shared with `group`.
- Can be shared with `group/subgroup02` or `group/subgroup01/subgroup03`.
When you share a project with a group that has a more restrictive visibility level than the project:
@ -51,7 +51,7 @@ When you share a project with a group that has a more restrictive visibility lev
- Project members who are direct or indirect members of the group can see
group members listed in addition to members of the project.
## Share a project with a group of users
## Share a project with a group
> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/247208) in GitLab 13.11 from a form to a modal
window [with a flag](../../feature_flags.md). Disabled by default.
@ -76,10 +76,10 @@ To share a project with a group:
1. Optional. Select an **Access expiration date**.
1. Select **Invite**.
## Share project with group lock
## Prevent project sharing
It is possible to prevent projects in a group from
You can prevent members of a group from
[sharing a project with another group](../members/share_project_with_groups.md).
This allows for tighter control over project access.
This restriction allows for tighter control over project access.
Learn more about [Share with group lock](../../group/access_and_permissions.md#prevent-a-project-from-being-shared-with-groups).
For more information, see [Prevent a project from being shared with groups](../../group/access_and_permissions.md#prevent-a-project-from-being-shared-with-groups).

View File

@ -182,7 +182,7 @@ granting them push access:
1. [Create a new group](../../../group/manage.md#create-a-group).
1. [Add the user to the group](../../../group/manage.md#add-users-to-a-group),
and select the Reporter role for the user.
1. [Share the project with your group](../../members/share_project_with_groups.md#share-a-project-with-a-group-of-users),
1. [Share the project with your group](../../members/share_project_with_groups.md#share-a-project-with-a-group),
based on the Reporter role.
1. Go to your project and select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval rules**, and either:

View File

@ -1,6 +1,7 @@
const IS_EE = require('./config/helpers/is_ee_env');
const isESLint = require('./config/helpers/is_eslint');
const IS_JH = require('./config/helpers/is_jh_env');
const { TEST_HOST } = require('./spec/frontend/__helpers__/test_constants');
module.exports = (path, options = {}) => {
const {
@ -156,6 +157,7 @@ module.exports = (path, options = {}) => {
'dateformat',
'lowlight',
'vscode-languageserver-types',
'yaml',
...gfmParserDependencies,
];
@ -186,11 +188,16 @@ module.exports = (path, options = {}) => {
'^.+\\.(md|zip|png|yml|yaml)$': './spec/frontend/__helpers__/raw_transformer.js',
},
transformIgnorePatterns: [`node_modules/(?!(${transformIgnoreNodeModules.join('|')}))`],
timers: 'legacy',
fakeTimers: {
enableGlobally: true,
doNotFake: ['nextTick', 'setImmediate'],
legacyFakeTimers: true,
},
testEnvironment: '<rootDir>/spec/frontend/environment.js',
testEnvironmentOptions: {
IS_EE,
IS_JH,
url: TEST_HOST,
},
testRunner: 'jest-jasmine2',
};

View File

@ -24,6 +24,8 @@ module.exports = {
'^jh_else_ce_test_helpers(/.*)$': '<rootDir>/jh/spec/frontend_integration/test_helpers$1',
},
}),
timers: 'real',
fakeTimers: {
enableGlobally: false,
},
testTimeout: process.env.CI ? 20000 : 7000,
};

View File

@ -49,6 +49,8 @@ module API
end
# rubocop: disable CodeReuse/ActiveRecord
get ':id/jobs', urgency: :low, feature_category: :continuous_integration do
check_rate_limit!(:jobs_index, scope: current_user) if enforce_jobs_api_rate_limits(@project)
authorize_read_builds!
builds = user_project.builds.order('id DESC')

View File

@ -167,6 +167,10 @@ module API
current_authenticated_job.project == project
end
def enforce_jobs_api_rate_limits(project)
::Feature.enabled?(:ci_enforce_rate_limits_jobs_api, project)
end
# rubocop: disable CodeReuse/ActiveRecord
def find_group(id)
if id.to_s =~ INTEGER_ID_REGEX

View File

@ -27,8 +27,6 @@ module API
requires :namespace_path, type: String, desc: 'Path for the namespace that should be subscribed'
end
post do
not_found! unless Feature.enabled?(:jira_connect_oauth, current_user)
jwt = Atlassian::JiraConnect::Jwt::Symmetric.new(params[:jwt])
installation = JiraConnectInstallation.find_by_client_key(jwt.iss_claim)

View File

@ -54,7 +54,8 @@ module Gitlab
phone_verification_send_code: { threshold: 10, interval: 1.hour },
phone_verification_verify_code: { threshold: 10, interval: 10.minutes },
namespace_exists: { threshold: 20, interval: 1.minute },
fetch_google_ip_list: { threshold: 10, interval: 1.minute }
fetch_google_ip_list: { threshold: 10, interval: 1.minute },
jobs_index: { threshold: 600, interval: 1.minute }
}.freeze
end

View File

@ -9,25 +9,29 @@ module Gitlab
attr_reader :attributes
def initialize(pipeline, attributes = {})
def initialize(pipeline, attributes = {}, build = nil)
super(pipeline)
@build = build
@attributes = attributes
end
def variables
strong_memoize(:variables) do
# This is a temporary piece of technical debt to allow us access
# to the CI variables to evaluate rules before we persist a Build
# with the result. We should refactor away the extra Build.new,
# but be able to get CI Variables directly from the Seed::Build.
stub_build.scoped_variables
end
build.scoped_variables
end
strong_memoize_attr :variables
private
def build
@build || stub_build
end
def stub_build
# This is a temporary piece of technical debt to allow us access
# to the CI variables to evaluate rules before we persist a Build
# with the result. We should refactor away the extra Build.new,
# but be able to get CI Variables directly from the Seed::Build.
::Ci::Build.new(build_attributes)
end

View File

@ -9,12 +9,13 @@ module Gitlab
delegate :dig, to: :@seed_attributes
def initialize(context, attributes, stages_for_needs_lookup = [])
def initialize(context, attributes, stages_for_needs_lookup, stage)
@context = context
@pipeline = context.pipeline
@seed_attributes = attributes
@stages_for_needs_lookup = stages_for_needs_lookup.compact
@needs_attributes = dig(:needs_attributes)
@stage = stage
@resource_group_key = attributes.delete(:resource_group_key)
@job_variables = @seed_attributes.delete(:job_variables)
@root_variables_inheritance = @seed_attributes.delete(:root_variables_inheritance) { true }
@ -33,6 +34,8 @@ module Gitlab
.new(attributes.delete(:cache), @pipeline)
calculate_yaml_variables!
@processable = initialize_processable
end
def name
@ -40,36 +43,41 @@ module Gitlab
end
def included?
strong_memoize(:inclusion) do
logger.instrument(:pipeline_seed_build_inclusion) do
if @using_rules
rules_result.pass?
elsif @using_only || @using_except
all_of_only? && none_of_except?
else
true
end
logger.instrument(:pipeline_seed_build_inclusion) do
if @using_rules
rules_result.pass?
elsif @using_only || @using_except
all_of_only? && none_of_except?
else
true
end
end
end
strong_memoize_attr :included?, :inclusion
def errors
strong_memoize(:errors) do
# We check rules errors before checking "included?" because rules affects its inclusion status.
next rules_errors if rules_errors
next unless included?
# We check rules errors before checking "included?" because rules affects its inclusion status.
return rules_errors if rules_errors
return unless included?
[needs_errors, variable_expansion_errors].compact.flatten
end
[needs_errors, variable_expansion_errors].compact.flatten
end
strong_memoize_attr :errors
# TODO: Method used only in specs. Replace with `to_resource.attributes` when
# the feature flag ci_reuse_build_in_seed_context is removed.
# Then remove this method.
def attributes
@seed_attributes
.deep_merge(pipeline_attributes)
.deep_merge(rules_attributes)
.deep_merge(allow_failure_criteria_attributes)
.deep_merge(@cache.cache_attributes)
.deep_merge(runner_tags)
if reuse_build_in_seed_context?
initial_attributes.deep_merge(evaluated_attributes)
else
@seed_attributes
.deep_merge(pipeline_attributes)
.deep_merge(rules_attributes)
.deep_merge(allow_failure_criteria_attributes)
.deep_merge(@cache.cache_attributes)
.deep_merge(runner_tags)
end
end
def bridge?
@ -80,12 +88,28 @@ module Gitlab
end
def to_resource
strong_memoize(:resource) do
initialize_processable
if reuse_build_in_seed_context?
# The `options` attribute need to be entirely reassigned because they may
# be overridden by evaluated_attributes.
# We also don't want to reassign all the `initial_attributes` since those
# can affect performance. We only want to assign what's changed.
assignable_attributes = initial_attributes.slice(:options)
.deep_merge(evaluated_attributes)
processable.assign_attributes(assignable_attributes)
processable
else
legacy_initialize_processable
end
end
strong_memoize_attr :to_resource
def initialize_processable
private
attr_reader :processable
delegate :logger, to: :@context
def legacy_initialize_processable
if bridge?
::Ci::Bridge.new(attributes)
else
@ -93,9 +117,28 @@ module Gitlab
end
end
private
def initialize_processable
return unless reuse_build_in_seed_context?
delegate :logger, to: :@context
if bridge?
::Ci::Bridge.new(initial_attributes)
else
::Ci::Build.new(initial_attributes)
end
end
def initial_attributes
@seed_attributes
.deep_merge(pipeline_attributes)
.deep_merge(ci_stage: @stage)
.deep_merge(@cache.cache_attributes)
end
def evaluated_attributes
rules_attributes
.deep_merge(allow_failure_criteria_attributes)
.deep_merge(runner_tags)
end
def all_of_only?
@only.all? { |spec| spec.satisfied_by?(@pipeline, evaluate_context) }
@ -155,40 +198,39 @@ module Gitlab
end
def rules_attributes
strong_memoize(:rules_attributes) do
next {} unless @using_rules
return {} unless @using_rules
rules_variables_result = ::Gitlab::Ci::Variables::Helpers.merge_variables(
@seed_attributes[:yaml_variables], rules_result.variables
)
rules_variables_result = ::Gitlab::Ci::Variables::Helpers.merge_variables(
@seed_attributes[:yaml_variables], rules_result.variables
)
rules_result.build_attributes.merge(yaml_variables: rules_variables_result)
end
rules_result.build_attributes.merge(yaml_variables: rules_variables_result)
end
strong_memoize_attr :rules_attributes
def rules_result
strong_memoize(:rules_result) do
@rules.evaluate(@pipeline, evaluate_context)
end
@rules.evaluate(@pipeline, evaluate_context)
end
strong_memoize_attr :rules_result
def rules_errors
strong_memoize(:rules_errors) do
["Failed to parse rule for #{name}: #{rules_result.errors.join(', ')}"] if rules_result.errors.present?
end
["Failed to parse rule for #{name}: #{rules_result.errors.join(', ')}"] if rules_result.errors.present?
end
strong_memoize_attr :rules_errors
def evaluate_context
strong_memoize(:evaluate_context) do
if reuse_build_in_seed_context?
Gitlab::Ci::Build::Context::Build.new(@pipeline, @seed_attributes, processable)
else
Gitlab::Ci::Build::Context::Build.new(@pipeline, @seed_attributes)
end
end
strong_memoize_attr :evaluate_context
def runner_tags
strong_memoize(:runner_tags) do
{ tag_list: evaluate_runner_tags }.compact
end
{ tag_list: evaluate_runner_tags }.compact
end
strong_memoize_attr :runner_tags
def evaluate_runner_tags
@seed_attributes.delete(:tag_list)&.map do |tag|
@ -211,6 +253,11 @@ module Gitlab
from: @context.root_variables, to: @job_variables, inheritance: @root_variables_inheritance
)
end
def reuse_build_in_seed_context?
Feature.enabled?(:ci_reuse_build_in_seed_context, @pipeline.project)
end
strong_memoize_attr :reuse_build_in_seed_context?, :reuse_build_in_seed_context
end
end
end

View File

@ -10,54 +10,49 @@ module Gitlab
delegate :size, to: :seeds
delegate :dig, to: :seeds
def initialize(context, attributes, previous_stages)
@context = context
@pipeline = context.pipeline
@attributes = attributes
@previous_stages = previous_stages
attr_reader :attributes
@builds = attributes.fetch(:builds).map do |attributes|
Seed::Build.new(context, attributes, previous_stages + [self])
def initialize(context, stage_attributes, previous_stages)
pipeline = context.pipeline
@attributes = {
name: stage_attributes.fetch(:name),
position: stage_attributes.fetch(:index),
pipeline: pipeline,
project: pipeline.project,
partition_id: pipeline.partition_id
}
@stage = ::Ci::Stage.new(@attributes)
@builds = stage_attributes.fetch(:builds).map do |build_attributes|
Seed::Build.new(context, build_attributes, previous_stages + [self], @stage)
end
end
def attributes
{ name: @attributes.fetch(:name),
position: @attributes.fetch(:index),
pipeline: @pipeline,
project: @pipeline.project,
partition_id: @pipeline.partition_id }
end
def seeds
strong_memoize(:seeds) do
@builds.select(&:included?)
end
@builds.select(&:included?)
end
strong_memoize_attr :seeds
def errors
strong_memoize(:errors) do
@builds.flat_map(&:errors).compact
end
@builds.flat_map(&:errors).compact
end
strong_memoize_attr :errors
def seeds_names
strong_memoize(:seeds_names) do
seeds.map(&:name).to_set
end
seeds.map(&:name).to_set
end
strong_memoize_attr :seeds_names
def included?
seeds.any?
end
def to_resource
strong_memoize(:stage) do
::Ci::Stage.new(attributes).tap do |stage|
stage.statuses = seeds.map(&:to_resource)
end
end
@stage.statuses = seeds.map(&:to_resource)
@stage
end
strong_memoize_attr :to_resource
end
end
end

View File

@ -50,24 +50,24 @@ module Gitlab
'eo' => 0,
'es' => 35,
'fil_PH' => 0,
'fr' => 85,
'fr' => 94,
'gl_ES' => 0,
'id_ID' => 0,
'it' => 1,
'ja' => 30,
'ko' => 21,
'nb_NO' => 25,
'ko' => 20,
'nb_NO' => 24,
'nl_NL' => 0,
'pl_PL' => 3,
'pt_BR' => 58,
'ro_RO' => 98,
'ru' => 25,
'pt_BR' => 57,
'ro_RO' => 96,
'ru' => 26,
'si_LK' => 11,
'tr_TR' => 11,
'uk' => 52,
'zh_CN' => 98,
'zh_CN' => 97,
'zh_HK' => 1,
'zh_TW' => 100
'zh_TW' => 99
}.freeze
private_constant :TRANSLATION_LEVELS

View File

@ -256,7 +256,6 @@
redis_slot: code_review
category: code_review
aggregation: weekly
feature_flag: usage_data_diff_searches
- name: i_code_review_total_suggestions_applied
redis_slot: code_review
category: code_review

View File

@ -0,0 +1,80 @@
# frozen_string_literal: true
namespace :gitlab do
namespace :feature_categories do
desc 'GitLab | Feature categories | Build index page for groups'
task index: :environment do
require 'pathname'
controller_actions = Gitlab::RequestEndpoints
.all_controller_actions
.each_with_object({}) do |(controller, action), hash|
feature_category = controller.feature_category_for_action(action).to_s
hash[feature_category] ||= []
hash[feature_category] << {
klass: controller.to_s,
action: action,
source_location: source_location(controller, action)
}
end
endpoints = Gitlab::RequestEndpoints.all_api_endpoints.each_with_object({}) do |route, hash|
klass = route.app.options[:for]
path = API::Base.path_for_app(route.app)
feature_category = klass.feature_category_for_action(path).to_s
hash[feature_category] ||= []
hash[feature_category] << {
klass: klass.to_s,
action: path,
source_location: source_location(klass)
}
end
workers = Gitlab::SidekiqConfig.workers_for_all_queues_yml.flatten.each_with_object({}) do |worker, hash|
feature_category = worker.get_feature_category.to_s
next unless worker.klass.name
hash[feature_category] ||= []
hash[feature_category] << {
klass: worker.klass.name,
source_location: source_location(worker.klass.name)
}
end
database_tables = Dir['db/docs/*.yml'].each_with_object({}) do |file, hash|
yaml = YAML.safe_load(File.read(file))
table_name = yaml['table_name']
yaml['feature_categories'].each do |feature_category|
hash[feature_category] ||= []
hash[feature_category] << table_name
end
end
puts YAML.dump('controller_actions' => controller_actions,
'api_endpoints' => endpoints,
'sidekiq_workers' => workers,
'database_tables' => database_tables)
end
def source_location(klass, method = nil)
file, line =
if method && klass.method_defined?(method)
klass.instance_method(method).source_location
else
Kernel.const_source_location(klass.to_s)
end
relative = Pathname.new(file).relative_path_from(Rails.root).to_s
if relative.starts_with?('../') || relative.starts_with?('/')
nil
else
[relative, line]
end
end
end
end

View File

@ -2755,6 +2755,9 @@ msgstr ""
msgid "AdminSettings|Auto DevOps domain"
msgstr ""
msgid "AdminSettings|By default, set a limit to 0 to have no limit."
msgstr ""
msgid "AdminSettings|CI/CD limits"
msgstr ""
@ -2998,9 +3001,6 @@ msgstr ""
msgid "AdminSettings|Set a CI/CD template as the required pipeline configuration for all projects in the instance. Project CI/CD configuration merges into the required pipeline configuration when the pipeline runs. %{link_start}What is a required pipeline configuration?%{link_end}"
msgstr ""
msgid "AdminSettings|Set limit to 0 to disable it."
msgstr ""
msgid "AdminSettings|Set the expiration time of authentication tokens of newly registered group runners."
msgstr ""
@ -3046,6 +3046,9 @@ msgstr ""
msgid "AdminSettings|There are Advanced Search migrations pending that require indexing to pause. Indexing must remain paused until GitLab completes the migrations."
msgstr ""
msgid "AdminSettings|This limit cannot be disabled. Set to 0 to block all DAG dependencies."
msgstr ""
msgid "AdminSettings|To enable Registration Features, first enable Service Ping."
msgstr ""
@ -23423,6 +23426,9 @@ msgstr ""
msgid "JiraService|Change GitLab version"
msgstr ""
msgid "JiraService|Continue setup in GitLab"
msgstr ""
msgid "JiraService|Define the type of Jira issue to create from a vulnerability."
msgstr ""
@ -23471,6 +23477,9 @@ msgstr ""
msgid "JiraService|If different from Web URL."
msgstr ""
msgid "JiraService|In order to complete the set up, youll need to complete a few steps in GitLab."
msgstr ""
msgid "JiraService|Issues created from vulnerabilities in this project will be Jira issues, even if GitLab issues are enabled."
msgstr ""
@ -41383,6 +41392,9 @@ msgstr ""
msgid "The name of the Jenkins project. Copy the name from the end of the URL to the project."
msgstr ""
msgid "The new Web IDE"
msgstr ""
msgid "The number of changes to fetch from GitLab when cloning a repository. Lower values can speed up pipeline execution. Set to %{code_open}0%{code_close} or blank to fetch all branches and tags for each job"
msgstr ""
@ -43633,15 +43645,15 @@ msgstr ""
msgid "Try grouping with different labels"
msgstr ""
msgid "Try it out now"
msgstr ""
msgid "Try logging in using your username or email. If you have forgotten your password, try recovering it"
msgstr ""
msgid "Try out GitLab Pipelines"
msgstr ""
msgid "Try out the new Web IDE"
msgstr ""
msgid "Try the troubleshooting steps here."
msgstr ""
@ -45111,7 +45123,7 @@ msgstr ""
msgid "Using the %{codeStart}needs%{codeEnd} keyword makes jobs run before their stage is reached. Jobs run as soon as their %{codeStart}needs%{codeEnd} relationships are met, which speeds up your pipelines."
msgstr ""
msgid "VS Code in your browser. View code and make changes from the same UI as in your local IDE 🎉"
msgid "VS Code in your browser. View code and make changes from the same UI as in your local IDE."
msgstr ""
msgid "Valid From"

View File

@ -212,13 +212,13 @@
"@gitlab/stylelint-config": "4.1.0",
"@graphql-eslint/eslint-plugin": "3.12.0",
"@testing-library/dom": "^7.16.2",
"@types/jest": "^27.5.1",
"@types/jest": "^28.1.3",
"@vue/test-utils": "1.3.0",
"@vue/vue2-jest": "^27.0.0",
"@vue/vue2-jest": "^28.1.0",
"ajv": "^8.10.0",
"ajv-formats": "^2.1.1",
"axios-mock-adapter": "^1.15.0",
"babel-jest": "^27.5.1",
"babel-jest": "^28.1.3",
"chalk": "^2.4.1",
"cheerio": "^1.0.0-rc.9",
"commander": "^2.20.3",
@ -235,13 +235,13 @@
"istanbul-lib-coverage": "^3.0.0",
"istanbul-lib-report": "^3.0.0",
"istanbul-reports": "^3.0.0",
"jest": "^27.5.1",
"jest-canvas-mock": "^2.1.2",
"jest-diff": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"jest-jasmine2": "^27.5.1",
"jest-junit": "^12.0.0",
"jest-util": "^27.5.1",
"jest": "^28.1.3",
"jest-canvas-mock": "^2.4.0",
"jest-diff": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-jasmine2": "^28.1.3",
"jest-junit": "^12.3.0",
"jest-util": "^28.1.3",
"jsonlint": "^1.6.3",
"markdownlint-cli": "0.32.2",
"miragejs": "^0.1.40",

View File

@ -0,0 +1,66 @@
# frozen_string_literal: true
require 'rubocop-rspec'
module RuboCop
module Cop
module RSpec
# This cop checks for the usage of TestProf methods in migration specs.
#
# @example
#
# # bad
# let_it_be(:user) { table(:users).create(username: 'test') }
# let_it_be_with_reload(:user) { table(:users).create(username: 'test') }
# let_it_be_with_refind(:user) { table(:users).create(username: 'test') }
#
# before_all do
# do_something
# end
#
# # good
# let(:user) { table(:users).create(username: 'test') }
# let!(:user) { table(:users).create(username: 'test') }
#
# before(:all) do
# do_something
# end
#
# before do
# do_something
# end
class AvoidTestProf < RuboCop::Cop::Base
MESSAGE = "Prefer %{alternatives} over `%{method}` in migration specs. " \
'See ' \
'https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#testprof-in-migration-specs'
LET_ALTERNATIVES = %w[`let` `let!`].freeze
ALTERNATIVES = {
let_it_be: LET_ALTERNATIVES,
let_it_be_with_reload: LET_ALTERNATIVES,
let_it_be_with_refind: LET_ALTERNATIVES,
before_all: %w[`before` `before(:all)`]
}.freeze
FORBIDDEN_METHODS = ALTERNATIVES.keys.map(&:inspect).join(' ')
RESTRICT_ON_SEND = ALTERNATIVES.keys
def_node_matcher :forbidden_method_usage, <<~PATTERN
(send nil? ${#{FORBIDDEN_METHODS}} ...)
PATTERN
def on_send(node)
method = forbidden_method_usage(node)
return unless method
alternatives = ALTERNATIVES.fetch(method).join(' or ')
add_offense(
node,
message: format(MESSAGE, method: method, alternatives: alternatives)
)
end
end
end
end
end

View File

@ -16,10 +16,6 @@ global:
secret: shared-gitlab-initial-root-password
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true
certmanager:
install: false
@ -37,10 +33,6 @@ gitlab:
storageClass: ssd
nodeSelector:
preemptible: "false"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-false
podAnnotations:
<<: *safe-to-evict
@ -139,10 +131,6 @@ gitlab-runner:
memory: 150Mi
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true
podAnnotations:
<<: *safe-to-evict
@ -156,10 +144,6 @@ minio:
memory: 280Mi
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true
podAnnotations:
<<: *safe-to-evict
@ -182,10 +166,6 @@ nginx-ingress:
timeoutSeconds: 5
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true
defaultBackend:
resources:
requests:
@ -196,10 +176,6 @@ nginx-ingress:
memory: 24Mi
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true
postgresql:
metrics:
@ -214,10 +190,6 @@ postgresql:
master:
nodeSelector:
preemptible: "false"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-false
podAnnotations:
<<: *safe-to-evict
@ -237,10 +209,6 @@ redis:
master:
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true
podAnnotations:
<<: *safe-to-evict
@ -257,7 +225,3 @@ registry:
memory: 45Mi
nodeSelector:
preemptible: "true"
# TODO: Remove me as soon as the old nodepools are deleted
#
# See https://gitlab.com/gitlab-org/quality/engineering-productivity-infrastructure/-/issues/40
cloud.google.com/gke-nodepool: containerd-preemptible-true

View File

@ -183,7 +183,7 @@ RSpec.describe 'Commits', feature_category: :source_code_management do
set_cookie('new_repo', 'true')
visit project_commits_path(project, branch_name)
expect(find('.js-project-refs-dropdown')).to have_content branch_name
expect(find('.ref-selector')).to have_content branch_name
end
end

View File

@ -208,6 +208,10 @@ RSpec.describe 'User browses commits', feature_category: :source_code_management
expect(page).not_to have_link 'Create merge request'
end
it 'shows ref switcher with correct text', :js do
expect(find('.ref-selector')).to have_text('master')
end
context 'when click the compare tab' do
before do
wait_for_requests
@ -220,9 +224,18 @@ RSpec.describe 'User browses commits', feature_category: :source_code_management
end
end
context 'feature branch' do
context 'feature branch', :js do
let(:visit_commits_page) do
visit project_commits_path(project, 'feature')
visit project_commits_path(project)
find('.ref-selector').click
wait_for_requests
page.within('.ref-selector') do
fill_in 'Search by Git revision', with: 'feature'
wait_for_requests
find('li', text: 'feature', match: :prefer_exact).click
end
end
context 'when project does not have open merge requests' do
@ -230,6 +243,10 @@ RSpec.describe 'User browses commits', feature_category: :source_code_management
visit_commits_page
end
it 'shows ref switcher with correct text' do
expect(find('.ref-selector')).to have_text('feature')
end
it 'renders project commits' do
commit = project.repository.commit('0b4bc9a')

View File

@ -165,7 +165,7 @@ RSpec.describe "Projects > Settings > Pipelines settings", feature_category: :pr
let(:page_token) { find('#registration_token').text }
before do
click_button 'Reset registration token'
click_link 'Reset registration token'
end
it 'changes registration token' do

View File

@ -9,6 +9,7 @@ RSpec.describe 'Projects > Show > User interacts with project stars', feature_ca
let(:user) { create(:user) }
before do
stub_feature_flags(vscode_web_ide: false)
sign_in(user)
visit(project_path(project))
end

View File

@ -6,6 +6,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js, feature_cate
let(:project) { create(:project, :public, :repository) }
before do
stub_feature_flags(vscode_web_ide: false)
sign_in(project.first_owner)
end

View File

@ -3,6 +3,8 @@ const loader = require('graphql-tag/loader');
module.exports = {
process(src) {
return loader.call({ cacheable() {} }, src);
return {
code: loader.call({ cacheable() {} }, src),
};
},
};

View File

@ -1,6 +1,6 @@
/* eslint-disable import/no-commonjs */
module.exports = {
process: (content) => {
return `module.exports = ${JSON.stringify(content)}`;
return { code: `module.exports = ${JSON.stringify(content)}` };
},
};

View File

@ -1,18 +1,22 @@
/* eslint-disable import/no-commonjs */
const babelJestTransformer = require('babel-jest');
const { createTransformer } = require('babel-jest');
// This Jest will transform the code of a WebWorker module into a FakeWebWorker subclass.
// This is meant to mirror Webpack's [`worker-loader`][1].
// [1]: https://webpack.js.org/loaders/worker-loader/
module.exports = {
process: (contentArg, filename, ...args) => {
const { code: content } = babelJestTransformer.default.process(contentArg, filename, ...args);
const { code: content } = createTransformer().process(contentArg, filename, ...args);
return `const { FakeWebWorker } = require("helpers/web_worker_fake");
const jestTransformedWorkerCode = `const { FakeWebWorker } = require("helpers/web_worker_fake");
module.exports = class JestTransformedWorker extends FakeWebWorker {
constructor() {
super(${JSON.stringify(filename)}, ${JSON.stringify(content)});
}
};`;
return {
code: jestTransformedWorkerCode,
};
},
};

View File

@ -6,6 +6,6 @@ module.exports = {
process: (sourceContent) => {
const jsonContent = JsYaml.load(sourceContent);
const json = JSON.stringify(jsonContent);
return `module.exports = ${json}`;
return { code: `module.exports = ${json}` };
},
};

View File

@ -37,12 +37,12 @@ describe('RunnerTypeBadge', () => {
};
beforeEach(() => {
jest.useFakeTimers('modern');
jest.useFakeTimers({ legacyFakeTimers: false });
jest.setSystemTime(new Date('2021-01-01T00:00:00Z'));
});
afterEach(() => {
jest.useFakeTimers('legacy');
jest.useFakeTimers({ legacyFakeTimers: true });
wrapper.destroy();
});

View File

@ -448,13 +448,15 @@ describe('GroupRunnersApp', () => {
it('navigates to the next page', async () => {
await findRunnerPaginationNext().trigger('click');
expect(mockGroupRunnersHandler).toHaveBeenLastCalledWith({
groupFullPath: mockGroupFullPath,
membership: MEMBERSHIP_DESCENDANTS,
sort: CREATED_DESC,
first: RUNNER_PAGE_SIZE,
after: pageInfo.endCursor,
});
expect(mockGroupRunnersHandler).toHaveBeenLastCalledWith(
expect.objectContaining({
groupFullPath: mockGroupFullPath,
membership: MEMBERSHIP_DESCENDANTS,
sort: CREATED_DESC,
first: RUNNER_PAGE_SIZE,
after: pageInfo.endCursor,
}),
);
});
});

View File

@ -4,7 +4,7 @@ import Api from '~/api';
import * as actions from '~/deploy_freeze/store/actions';
import * as types from '~/deploy_freeze/store/mutation_types';
import getInitialState from '~/deploy_freeze/store/state';
import createFlash from '~/flash';
import { createAlert } from '~/flash';
import * as logger from '~/lib/logger';
import axios from '~/lib/utils/axios_utils';
import { freezePeriodsFixture } from '../helpers';
@ -99,8 +99,8 @@ describe('deploy freeze store actions', () => {
});
describe('addFreezePeriod', () => {
it('dispatch correct actions on adding a freeze period', () => {
testAction(
it('dispatch correct actions on adding a freeze period', async () => {
await testAction(
actions.addFreezePeriod,
{},
state,
@ -110,32 +110,33 @@ describe('deploy freeze store actions', () => {
{ type: 'receiveFreezePeriodSuccess' },
{ type: 'fetchFreezePeriods' },
],
() =>
expect(Api.createFreezePeriod).toHaveBeenCalledWith(state.projectId, {
freeze_start: state.freezeStartCron,
freeze_end: state.freezeEndCron,
cron_timezone: state.selectedTimezoneIdentifier,
}),
);
expect(Api.createFreezePeriod).toHaveBeenCalledWith(state.projectId, {
freeze_start: state.freezeStartCron,
freeze_end: state.freezeEndCron,
cron_timezone: state.selectedTimezoneIdentifier,
});
});
it('should show flash error and set error in state on add failure', () => {
it('should show alert and set error in state on add failure', async () => {
Api.createFreezePeriod.mockRejectedValue();
testAction(
await testAction(
actions.addFreezePeriod,
{},
state,
[],
[{ type: 'requestFreezePeriod' }, { type: 'receiveFreezePeriodError' }],
() => expect(createFlash).toHaveBeenCalled(),
);
expect(createAlert).toHaveBeenCalled();
});
});
describe('updateFreezePeriod', () => {
it('dispatch correct actions on updating a freeze period', () => {
testAction(
it('dispatch correct actions on updating a freeze period', async () => {
await testAction(
actions.updateFreezePeriod,
{},
state,
@ -145,33 +146,34 @@ describe('deploy freeze store actions', () => {
{ type: 'receiveFreezePeriodSuccess' },
{ type: 'fetchFreezePeriods' },
],
() =>
expect(Api.updateFreezePeriod).toHaveBeenCalledWith(state.projectId, {
id: state.selectedId,
freeze_start: state.freezeStartCron,
freeze_end: state.freezeEndCron,
cron_timezone: state.selectedTimezoneIdentifier,
}),
);
expect(Api.updateFreezePeriod).toHaveBeenCalledWith(state.projectId, {
id: state.selectedId,
freeze_start: state.freezeStartCron,
freeze_end: state.freezeEndCron,
cron_timezone: state.selectedTimezoneIdentifier,
});
});
it('should show flash error and set error in state on add failure', () => {
it('should show alert and set error in state on add failure', async () => {
Api.updateFreezePeriod.mockRejectedValue();
testAction(
await testAction(
actions.updateFreezePeriod,
{},
state,
[],
[{ type: 'requestFreezePeriod' }, { type: 'receiveFreezePeriodError' }],
() => expect(createFlash).toHaveBeenCalled(),
);
expect(createAlert).toHaveBeenCalled();
});
});
describe('fetchFreezePeriods', () => {
it('dispatch correct actions on fetchFreezePeriods', () => {
testAction(
return testAction(
actions.fetchFreezePeriods,
{},
state,
@ -183,26 +185,26 @@ describe('deploy freeze store actions', () => {
);
});
it('should show flash error and set error in state on fetch variables failure', () => {
it('should show alert and set error in state on fetch variables failure', async () => {
Api.freezePeriods.mockRejectedValue();
testAction(
await testAction(
actions.fetchFreezePeriods,
{},
state,
[{ type: types.REQUEST_FREEZE_PERIODS }],
[],
() =>
expect(createFlash).toHaveBeenCalledWith({
message: 'There was an error fetching the deploy freezes.',
}),
);
expect(createAlert).toHaveBeenCalledWith({
message: 'There was an error fetching the deploy freezes.',
});
});
});
describe('deleteFreezePeriod', () => {
it('dispatch correct actions on deleting a freeze period', () => {
testAction(
it('dispatch correct actions on deleting a freeze period', async () => {
await testAction(
actions.deleteFreezePeriod,
freezePeriodFixture,
state,
@ -211,20 +213,17 @@ describe('deploy freeze store actions', () => {
{ type: 'RECEIVE_DELETE_FREEZE_PERIOD_SUCCESS', payload: freezePeriodFixture.id },
],
[],
() =>
expect(Api.deleteFreezePeriod).toHaveBeenCalledWith(
state.projectId,
freezePeriodFixture.id,
),
);
expect(Api.deleteFreezePeriod).toHaveBeenCalledWith(state.projectId, freezePeriodFixture.id);
});
it('should show flash error and set error in state on delete failure', () => {
it('should show alert and set error in state on delete failure', async () => {
jest.spyOn(logger, 'logError').mockImplementation();
const error = new Error();
Api.deleteFreezePeriod.mockRejectedValue(error);
testAction(
await testAction(
actions.deleteFreezePeriod,
freezePeriodFixture,
state,
@ -233,12 +232,11 @@ describe('deploy freeze store actions', () => {
{ type: 'RECEIVE_DELETE_FREEZE_PERIOD_ERROR', payload: freezePeriodFixture.id },
],
[],
() => {
expect(createFlash).toHaveBeenCalled();
expect(logger.logError).toHaveBeenCalledWith('Unable to delete deploy freeze', error);
},
);
expect(createAlert).toHaveBeenCalled();
expect(logger.logError).toHaveBeenCalledWith('Unable to delete deploy freeze', error);
});
});
});

View File

@ -1,7 +1,7 @@
/* eslint-disable import/no-commonjs, max-classes-per-file */
const path = require('path');
const JSDOMEnvironment = require('jest-environment-jsdom');
const { TestEnvironment } = require('jest-environment-jsdom');
const { ErrorWithStack } = require('jest-util');
const {
setGlobalDateToFakeDate,
@ -11,10 +11,10 @@ const { TEST_HOST } = require('./__helpers__/test_constants');
const ROOT_PATH = path.resolve(__dirname, '../..');
class CustomEnvironment extends JSDOMEnvironment {
constructor(config, context) {
class CustomEnvironment extends TestEnvironment {
constructor({ globalConfig, projectConfig }, context) {
// Setup testURL so that window.location is setup properly
super({ ...config, testURL: TEST_HOST }, context);
super({ globalConfig, projectConfig: { ...projectConfig, testURL: TEST_HOST } }, context);
// Fake the `Date` for `jsdom` which fixes things like document.cookie
// https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39496#note_503084332
@ -39,8 +39,7 @@ class CustomEnvironment extends JSDOMEnvironment {
},
});
const { testEnvironmentOptions } = config;
const { IS_EE } = testEnvironmentOptions;
const { IS_EE } = projectConfig.testEnvironmentOptions;
this.global.gon = {
ee: IS_EE,
};

View File

@ -1,4 +1,5 @@
import { start } from '@gitlab/web-ide';
import { GITLAB_WEB_IDE_FEEDBACK_ISSUE } from '~/ide/constants';
import { initGitlabWebIDE } from '~/ide/init_gitlab_web_ide';
import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_action';
import { createAndSubmitForm } from '~/lib/utils/create_and_submit_form';
@ -14,6 +15,7 @@ const TEST_NONCE = 'test123nonce';
const TEST_PROJECT_PATH = 'group1/project1';
const TEST_BRANCH_NAME = '12345-foo-patch';
const TEST_GITLAB_URL = 'https://test-gitlab/';
const TEST_USER_PREFERENCES_PATH = '/user/preferences';
const TEST_GITLAB_WEB_IDE_PUBLIC_PATH = 'test/webpack/assets/gitlab-web-ide/public/path';
const TEST_IDE_REMOTE_PATH = '/-/ide/remote/:remote_host/:remote_path';
const TEST_START_REMOTE_PARAMS = {
@ -35,6 +37,7 @@ describe('ide/init_gitlab_web_ide', () => {
el.dataset.cspNonce = TEST_NONCE;
el.dataset.branchName = TEST_BRANCH_NAME;
el.dataset.ideRemotePath = TEST_IDE_REMOTE_PATH;
el.dataset.userPreferencesPath = TEST_USER_PREFERENCES_PATH;
document.body.append(el);
};
@ -74,6 +77,10 @@ describe('ide/init_gitlab_web_ide', () => {
ref: TEST_BRANCH_NAME,
gitlabUrl: TEST_GITLAB_URL,
nonce: TEST_NONCE,
links: {
userPreferences: TEST_USER_PREFERENCES_PATH,
feedbackIssue: GITLAB_WEB_IDE_FEEDBACK_ISSUE,
},
handleStartRemote: expect.any(Function),
});
});

View File

@ -1,12 +1,14 @@
import { nextTick } from 'vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import SetupInstructions from '~/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/setup_instructions.vue';
import SignInGitlabMultiversion from '~/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/index.vue';
import VersionSelectForm from '~/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/version_select_form.vue';
import SignInOauthButton from '~/jira_connect/subscriptions/components/sign_in_oauth_button.vue';
import VersionSelectForm from '~/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/version_select_form.vue';
import { updateInstallation } from '~/jira_connect/subscriptions/api';
import { reloadPage, persistBaseUrl, retrieveBaseUrl } from '~/jira_connect/subscriptions/utils';
import { GITLAB_COM_BASE_PATH } from '~/jira_connect/subscriptions/constants';
jest.mock('~/jira_connect/subscriptions/api', () => {
return {
@ -21,8 +23,9 @@ describe('SignInGitlabMultiversion', () => {
const mockBasePath = 'gitlab.mycompany.com';
const findVersionSelectForm = () => wrapper.findComponent(VersionSelectForm);
const findSetupInstructions = () => wrapper.findComponent(SetupInstructions);
const findSignInOauthButton = () => wrapper.findComponent(SignInOauthButton);
const findVersionSelectForm = () => wrapper.findComponent(VersionSelectForm);
const findSubtitle = () => wrapper.findByTestId('subtitle');
const createComponent = () => {
@ -59,15 +62,48 @@ describe('SignInGitlabMultiversion', () => {
});
describe('when version is selected', () => {
beforeEach(() => {
retrieveBaseUrl.mockReturnValue(mockBasePath);
createComponent();
describe('when on self-managed', () => {
beforeEach(() => {
retrieveBaseUrl.mockReturnValue(mockBasePath);
createComponent();
});
it('renders correct subtitle', () => {
expect(findSubtitle().text()).toBe(SignInGitlabMultiversion.i18n.signInSubtitle);
});
it('renders setup instructions', () => {
expect(findSetupInstructions().exists()).toBe(true);
});
describe('when SetupInstructions emits `next` event', () => {
beforeEach(async () => {
findSetupInstructions().vm.$emit('next');
await nextTick();
});
it('renders sign in button', () => {
expect(findSignInOauthButton().props('gitlabBasePath')).toBe(mockBasePath);
});
it('hides setup instructions', () => {
expect(findSetupInstructions().exists()).toBe(false);
});
});
});
describe('sign in button', () => {
describe('when on GitLab.com', () => {
beforeEach(() => {
retrieveBaseUrl.mockReturnValue(GITLAB_COM_BASE_PATH);
createComponent();
});
it('does not render setup instructions', () => {
expect(findSetupInstructions().exists()).toBe(false);
});
it('renders sign in button', () => {
expect(findSignInOauthButton().exists()).toBe(true);
expect(findSignInOauthButton().props('gitlabBasePath')).toBe(mockBasePath);
expect(findSignInOauthButton().props('gitlabBasePath')).toBe(GITLAB_COM_BASE_PATH);
});
describe('when button emits `sign-in` event', () => {
@ -90,9 +126,5 @@ describe('SignInGitlabMultiversion', () => {
});
});
});
it('renders correct subtitle', () => {
expect(findSubtitle().text()).toBe(SignInGitlabMultiversion.i18n.signInSubtitle);
});
});
});

View File

@ -0,0 +1,35 @@
import { shallowMount } from '@vue/test-utils';
import { GlButton, GlLink } from '@gitlab/ui';
import { OAUTH_SELF_MANAGED_DOC_LINK } from '~/jira_connect/subscriptions/constants';
import SetupInstructions from '~/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/setup_instructions.vue';
describe('SetupInstructions', () => {
let wrapper;
const findGlButton = () => wrapper.findComponent(GlButton);
const findGlLink = () => wrapper.findComponent(GlLink);
const createComponent = () => {
wrapper = shallowMount(SetupInstructions);
};
describe('template', () => {
beforeEach(() => {
createComponent();
});
it('renders "Learn more" link to documentation', () => {
expect(findGlLink().attributes('href')).toBe(OAUTH_SELF_MANAGED_DOC_LINK);
});
describe('when button is clicked', () => {
it('emits "next" event', () => {
expect(wrapper.emitted('next')).toBeUndefined();
findGlButton().vm.$emit('click');
expect(wrapper.emitted('next')).toHaveLength(1);
});
});
});
});

View File

@ -435,6 +435,7 @@ describe('monitoring/utils', () => {
describe('setCustomVariablesFromUrl', () => {
beforeEach(() => {
window.history.pushState = jest.fn();
jest.spyOn(urlUtils, 'updateHistory');
});

View File

@ -1,5 +1,4 @@
import { shallowMount } from '@vue/test-utils';
import { GlDropdownItem } from '@gitlab/ui';
import { nextTick } from 'vue';
import { trimText } from 'helpers/text_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
@ -31,12 +30,8 @@ describe('detailedMetric', () => {
const findExpandedBacktraceBtnAtIndex = (index) => findExpandBacktraceBtns().at(index);
const findDetailsLabel = () => wrapper.findByTestId('performance-bar-details-label');
const findSortOrderDropdown = () => wrapper.findByTestId('performance-bar-sort-order');
const clickSortOrderDropdownItem = (sortOrder) =>
findSortOrderDropdown()
.findAllComponents(GlDropdownItem)
.filter((item) => item.text() === sortOrderOptions[sortOrder])
.at(0)
.vm.$emit('click');
const selectSortOrder = (sortOrder) =>
findSortOrderDropdown().vm.$emit('select', sortOrderOptions[sortOrder].value);
const findEmptyDetailNotice = () => wrapper.findByTestId('performance-bar-empty-detail-notice');
const findAllDetailDurations = () =>
wrapper.findAllByTestId('performance-item-duration').wrappers.map((w) => w.text());
@ -334,11 +329,11 @@ describe('detailedMetric', () => {
});
it('changes sortOrder on select', async () => {
clickSortOrderDropdownItem(sortOrders.CHRONOLOGICAL);
selectSortOrder(sortOrders.CHRONOLOGICAL);
await nextTick();
expect(findAllDetailDurations()).toEqual(['23ms', '100ms', '75ms']);
clickSortOrderDropdownItem(sortOrders.DURATION);
selectSortOrder(sortOrders.DURATION);
await nextTick();
expect(findAllDetailDurations()).toEqual(['100ms', '75ms', '23ms']);
});

View File

@ -114,8 +114,6 @@ This reference tag is a mix of letters and numbers [^footnote].
});
it('renders table of contents', async () => {
jest.useFakeTimers();
renderMarkdown.mockResolvedValueOnce(`
<ul class="section-nav">
</ul>

View File

@ -358,4 +358,22 @@ RSpec.describe Gitlab::Ci::CronParser do
end
end
end
describe '#match?' do
let(:run_date) { Time.zone.local(2021, 3, 2, 1, 0) }
subject(:matched) { described_class.new(cron, Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE).match?(run_date) }
context 'when cron matches up' do
let(:cron) { '0 1 2 3 *' }
it { is_expected.to eq(true) }
end
context 'when cron does not match' do
let(:cron) { '5 4 3 2 1' }
it { is_expected.to eq(false) }
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Ci::Pipeline::Seed::Stage do
RSpec.describe Gitlab::Ci::Pipeline::Seed::Stage, feature_category: :pipeline_authoring do
let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:previous_stages) { [] }

View File

@ -6,7 +6,7 @@ require_migration!
RSpec.describe FinalizeGroupMemberNamespaceIdMigration, :migration do
let(:batched_migrations) { table(:batched_background_migrations) }
let_it_be(:migration) { described_class::MIGRATION }
let!(:migration) { described_class::MIGRATION }
describe '#up' do
shared_examples 'finalizes the migration' do

Some files were not shown because too many files have changed in this diff Show More