From e3bd590af430a430dcbcdd25751c46bbd1ecf56c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 8 Feb 2022 18:16:03 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/rules.gitlab-ci.yml | 16 +- CHANGELOG.md | 21 +++ GITALY_SERVER_VERSION | 2 +- .../components/blob_viewers/index.js | 2 +- .../queries/blob_info.query.graphql | 1 + .../components/source_viewer/constants.js | 111 +++++++++++++ .../{ => source_viewer}/source_viewer.vue | 34 ++-- .../components/source_viewer/utils.js | 26 +++ .../stylesheets/framework/variables.scss | 2 +- app/assets/stylesheets/themes/_dark.scss | 8 + app/helpers/application_settings_helper.rb | 4 +- app/models/application_setting.rb | 6 + .../application_setting_implementation.rb | 12 +- app/models/instance_configuration.rb | 7 +- .../import_export/project_export_presenter.rb | 5 +- .../_note_limits.html.haml | 2 +- .../_users_api_limits.html.haml | 14 ++ .../application_settings/network.html.haml | 12 ++ .../members/_access_request_links.html.haml | 3 +- .../update_head_pipeline_worker.rb | 1 - .../enforce_security_report_validation.yml | 8 + ..._get_by_id_limit_to_application_setting.rb | 15 ++ db/schema_migrations/20220207083129 | 1 + db/structure.sql | 2 + doc/development/event_store.md | 1 - .../fe_guide/development_process.md | 24 +++ doc/user/admin_area/settings/index.md | 1 + .../settings/rate_limit_on_users_api.md | 33 ++++ .../workspace/img/1.1-Instance_overview.png | Bin 15189 -> 0 bytes .../workspace/img/1.2-Groups_overview.png | Bin 12431 -> 0 bytes doc/user/workspace/img/1.3-Admin.png | Bin 16113 -> 0 bytes doc/user/workspace/img/Admin_Settings.png | Bin 76891 -> 0 bytes doc/user/workspace/img/hardware_settings.png | Bin 29457 -> 0 bytes doc/user/workspace/index.md | 34 +--- lib/api/settings.rb | 1 + lib/api/users.rb | 7 +- lib/gitlab/application_rate_limiter.rb | 4 +- lib/gitlab/ci/parsers/security/common.rb | 17 +- .../dependency-scanning-report-format.json | 1 + lib/gitlab/ci/reports/security/report.rb | 2 +- lib/gitlab/event_store/subscriber.rb | 9 +- locale/gitlab.pot | 18 ++- qa/qa/page/component/blob_content.rb | 2 +- spec/features/admin/admin_settings_spec.rb | 14 ++ .../components/blob_content_viewer_spec.js | 2 +- spec/frontend/repository/mock_data.js | 1 + .../{ => source_viewer}/source_viewer_spec.js | 42 +++-- .../components/source_viewer/utils_spec.js | 13 ++ .../application_settings_helper_spec.rb | 9 ++ .../gitlab/ci/parsers/security/common_spec.rb | 152 ++++++++++++++---- spec/lib/gitlab/event_store/store_spec.rb | 7 +- spec/models/application_setting_spec.rb | 7 +- spec/models/instance_configuration_spec.rb | 4 +- spec/requests/api/settings_spec.rb | 4 +- spec/requests/api/users_spec.rb | 25 ++- .../update_service_spec.rb | 18 +++ 56 files changed, 633 insertions(+), 134 deletions(-) create mode 100644 app/assets/javascripts/vue_shared/components/source_viewer/constants.js rename app/assets/javascripts/vue_shared/components/{ => source_viewer}/source_viewer.vue (73%) create mode 100644 app/assets/javascripts/vue_shared/components/source_viewer/utils.js create mode 100644 app/views/admin/application_settings/_users_api_limits.html.haml create mode 100644 config/feature_flags/development/enforce_security_report_validation.yml create mode 100644 db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb create mode 100644 db/schema_migrations/20220207083129 create mode 100644 doc/user/admin_area/settings/rate_limit_on_users_api.md delete mode 100644 doc/user/workspace/img/1.1-Instance_overview.png delete mode 100644 doc/user/workspace/img/1.2-Groups_overview.png delete mode 100644 doc/user/workspace/img/1.3-Admin.png delete mode 100644 doc/user/workspace/img/Admin_Settings.png delete mode 100644 doc/user/workspace/img/hardware_settings.png create mode 120000 lib/gitlab/ci/parsers/security/validators/schemas/dependency-scanning-report-format.json rename spec/frontend/vue_shared/components/{ => source_viewer}/source_viewer_spec.js (67%) create mode 100644 spec/frontend/vue_shared/components/source_viewer/utils_spec.js diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 5e183177a63..c9c83937434 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -569,11 +569,13 @@ - <<: *if-merge-request-labels-run-review-app - <<: *if-auto-deploy-branches - changes: *code-qa-patterns + - changes: *workhorse-patterns .frontend:rules:compile-test-assets: rules: - - changes: *code-backstage-qa-patterns - <<: *if-merge-request-labels-run-all-rspec + - changes: *code-backstage-qa-patterns + - changes: *workhorse-patterns .frontend:rules:compile-test-assets-as-if-foss: rules: @@ -583,6 +585,7 @@ - <<: *if-merge-request-labels-run-all-rspec - changes: *code-backstage-qa-patterns - changes: *startup-css-patterns + - changes: *workhorse-patterns .frontend:rules:compile-test-assets-as-if-jh: rules: @@ -604,6 +607,7 @@ allow_failure: true - changes: *startup-css-patterns allow_failure: true + - changes: *workhorse-patterns .frontend:rules:default-frontend-jobs: rules: @@ -1335,8 +1339,9 @@ .rails:rules:detect-tests: rules: - - changes: *code-backstage-qa-patterns - <<: *if-merge-request-labels-run-all-rspec + - changes: *code-backstage-qa-patterns + - changes: *workhorse-patterns .rails:rules:detect-previous-failed-tests: rules: @@ -1803,6 +1808,8 @@ allow_failure: true - changes: *startup-css-patterns allow_failure: true + - changes: *workhorse-patterns + allow_failure: true ####################### # Test metadata rules # @@ -1810,7 +1817,7 @@ .test-metadata:rules:retrieve-tests-metadata: rules: - changes: *code-backstage-patterns - when: on_success + - changes: *workhorse-patterns - <<: *if-merge-request-labels-run-all-rspec .test-metadata:rules:update-tests-metadata: @@ -1827,8 +1834,7 @@ ################### .workhorse:rules:workhorse: rules: - - <<: *if-default-refs - changes: *workhorse-patterns + - changes: *workhorse-patterns ################### # yaml-lint rules # diff --git a/CHANGELOG.md b/CHANGELOG.md index 19948bb0118..1c2b44662f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,27 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 14.7.2 (2022-02-08) + +### Added (1 change) + +- [Allow self-hosted instances to render same-origin Iframe](gitlab-org/gitlab@eb7c78363cdfc670286967872d8458fc5f6d82e8) ([merge request](gitlab-org/gitlab!79966)) + +### Fixed (4 changes) + +- [Geo: Fix reverify object stored files](gitlab-org/gitlab@603700dcca3b8f25a3b80b44b11a73df549c0cb3) ([merge request](gitlab-org/gitlab!79966)) **GitLab Enterprise Edition** +- [Geo: Fix verification failures of remote stored files](gitlab-org/gitlab@2eb8ac7e88dcd40f0e8266966655962e4d6e3171) ([merge request](gitlab-org/gitlab!79966)) **GitLab Enterprise Edition** +- [GitLab Version - CE Admin Dashboard [RUN ALL RSPEC] [RUN AS-IF-FOSS]](gitlab-org/gitlab@f2253ce2d729fa202a26b54f3ca870b932ea1855) ([merge request](gitlab-org/gitlab!79966)) +- [Fix cluster integration HTTP adapter](gitlab-org/gitlab@c05027ef4d7ec35fc16e8e16dc6e5af201f665c3) ([merge request](gitlab-org/gitlab!79966)) + +### Changed (1 change) + +- [Update to ruby-magic v0.5.4](gitlab-org/gitlab@ced6ef1001730dc2851f58f7db3229d1c585b9d3) ([merge request](gitlab-org/gitlab!79966)) + +### Removed (1 change) + +- [Disable sandboxed_mermaid feature flag by default](gitlab-org/gitlab@70c40d43169bd48d360ed7a6a03c33c05d5e3738) ([merge request](gitlab-org/gitlab!79966)) + ## 14.7.1 (2022-02-03) ### Security diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index efbed93a512..ea67bb9e62b 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -269b04ae5248eea05fe2d6ca02e33fdd3f6cee76 +32b9777c9f3f217324d95d6e25b6ed1ddee13f68 diff --git a/app/assets/javascripts/repository/components/blob_viewers/index.js b/app/assets/javascripts/repository/components/blob_viewers/index.js index daa11802cc5..e942f59e7d8 100644 --- a/app/assets/javascripts/repository/components/blob_viewers/index.js +++ b/app/assets/javascripts/repository/components/blob_viewers/index.js @@ -3,7 +3,7 @@ const viewers = { image: () => import('./image_viewer.vue'), video: () => import('./video_viewer.vue'), empty: () => import('./empty_viewer.vue'), - text: () => import('~/vue_shared/components/source_viewer.vue'), + text: () => import('~/vue_shared/components/source_viewer/source_viewer.vue'), pdf: () => import('./pdf_viewer.vue'), lfs: () => import('./lfs_viewer.vue'), }; diff --git a/app/assets/javascripts/repository/queries/blob_info.query.graphql b/app/assets/javascripts/repository/queries/blob_info.query.graphql index aeba84d481d..91b5ff9ccf1 100644 --- a/app/assets/javascripts/repository/queries/blob_info.query.graphql +++ b/app/assets/javascripts/repository/queries/blob_info.query.graphql @@ -20,6 +20,7 @@ query getBlobInfo($projectPath: ID!, $filePath: String!, $ref: String!) { rawSize rawTextBlob fileType + language path editBlobPath ideEditPath diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js new file mode 100644 index 00000000000..9efe0147c37 --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js @@ -0,0 +1,111 @@ +// Language map from Rouge::Lexer to highlight.js +// Rouge::Lexer - We use it on the BE to determine the language of a source file (https://github.com/rouge-ruby/rouge/blob/master/docs/Languages.md). +// Highlight.js - We use it on the FE to highlight the syntax of a source file (https://github.com/highlightjs/highlight.js/tree/main/src/languages). +export const ROUGE_TO_HLJS_LANGUAGE_MAP = { + bsl: '1c', + actionscript: 'actionscript', + ada: 'ada', + apache: 'apache', + applescript: 'applescript', + armasm: 'armasm', + awk: 'awk', + c: 'c', + ceylon: 'ceylon', + clean: 'clean', + clojure: 'clojure', + cmake: 'cmake', + coffeescript: 'coffeescript', + coq: 'coq', + cpp: 'cpp', + crystal: 'crystal', + csharp: 'csharp', + css: 'css', + d: 'd', + dart: 'dart', + pascal: 'delphi', + diff: 'diff', + jinja: 'django', + docker: 'dockerfile', + batchfile: 'dos', + elixir: 'elixir', + elm: 'elm', + erb: 'erb', + erlang: 'erlang', + fortran: 'fortran', + fsharp: 'fsharp', + gherkin: 'gherkin', + glsl: 'glsl', + go: 'go', + gradle: 'gradle', + groovy: 'groovy', + haml: 'haml', + handlebars: 'handlebars', + haskell: 'haskell', + haxe: 'haxe', + http: 'http', + hylang: 'hy', + ini: 'ini', + isbl: 'isbl', + java: 'java', + javascript: 'javascript', + json: 'json', + julia: 'julia', + kotlin: 'kotlin', + lasso: 'lasso', + tex: 'latex', + common_lisp: 'lisp', + livescript: 'livescript', + llvm: 'llvm', + hlsl: 'lsl', + lua: 'lua', + make: 'makefile', + markdown: 'markdown', + mathematica: 'mathematica', + matlab: 'matlab', + moonscript: 'moonscript', + nginx: 'nginx', + nim: 'nim', + nix: 'nix', + objective_c: 'objectivec', + ocaml: 'ocaml', + perl: 'perl', + php: 'php', + plaintext: 'plaintext', + pony: 'pony', + powershell: 'powershell', + prolog: 'prolog', + properties: 'properties', + protobuf: 'protobuf', + puppet: 'puppet', + python: 'python', + q: 'q', + qml: 'qml', + r: 'r', + reasonml: 'reasonml', + ruby: 'ruby', + rust: 'rust', + sas: 'sas', + scala: 'scala', + scheme: 'scheme', + scss: 'scss', + shell: 'shell', + smalltalk: 'smalltalk', + sml: 'sml', + sqf: 'sqf', + sql: 'sql', + stan: 'stan', + stata: 'stata', + swift: 'swift', + tap: 'tap', + tcl: 'tcl', + twig: 'twig', + typescript: 'typescript', + vala: 'vala', + vb: 'vbnet', + verilog: 'verilog', + vhdl: 'vhdl', + viml: 'vim', + xml: 'xml', + xquery: 'xquery', + yaml: 'yaml', +}; diff --git a/app/assets/javascripts/vue_shared/components/source_viewer.vue b/app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue similarity index 73% rename from app/assets/javascripts/vue_shared/components/source_viewer.vue rename to app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue index f6580a716ee..5aae1812de3 100644 --- a/app/assets/javascripts/vue_shared/components/source_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue @@ -1,14 +1,16 @@