From 380d41a71bda9d5e8da5b03c0069e7fab1afacbc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 15 Jul 2024 18:14:45 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/rails.gitlab-ci.yml | 11 +- .gitlab/ci/rails/shared.gitlab-ci.yml | 6 + .gitlab/ci/rules.gitlab-ci.yml | 6 + .rubocop_todo/rspec/file_path.yml | 1 + GITALY_SERVER_VERSION | 2 +- Gemfile | 2 +- Gemfile.checksum | 2 +- Gemfile.lock | 4 +- app/assets/javascripts/editor/schema/ci.json | 47 ++++++ .../list/components/issue_card_time_info.vue | 6 +- .../permissions/components/settings_panel.vue | 2 +- .../security_configuration/utils.js | 2 +- .../concerns/integrations/actions.rb | 4 +- .../settings/integrations_controller.rb | 8 +- app/finders/banzai/uploads_finder.rb | 2 + app/finders/organizations/groups_finder.rb | 2 +- app/models/ci/build.rb | 2 +- app/models/upload.rb | 13 +- app/policies/group_policy.rb | 1 + app/policies/project_policy.rb | 1 + app/validators/json_schema_validator.rb | 2 +- .../merge_requests/_merge_request.html.haml | 4 +- ...ed_groups.yml => pipeline_run_keyword.yml} | 10 +- .../custom_project_templates.md | 2 +- .../settings/security_and_compliance.md | 4 +- doc/api/groups.md | 93 +++++++++++ doc/api/integrations.md | 94 +++++------ doc/api/projects.md | 95 ++++++++++- doc/ci/pipelines/settings.md | 2 +- doc/ci/yaml/includes.md | 8 +- .../documentation/styleguide/word_list.md | 18 +- .../permissions/predefined_roles.md | 2 +- doc/security/user_file_uploads.md | 3 + .../configuration/enabling_the_analyzer.md | 2 +- .../configuration/enabling_the_analyzer.md | 2 +- .../application_security/policies/index.md | 4 +- .../secret_push_protection/index.md | 2 +- doc/user/group/custom_project_templates.md | 2 +- lib/api/entities/ci/job_request/response.rb | 13 +- lib/api/entities/markdown_upload_admin.rb | 13 ++ lib/api/markdown_uploads.rb | 143 ++++++++++++++++ lib/gitlab/ci/config.rb | 35 +++- lib/gitlab/ci/config/entry/job.rb | 23 ++- lib/gitlab/ci/config/entry/jobs.rb | 2 +- lib/gitlab/ci/pipeline/seed/build.rb | 14 ++ lib/gitlab/ci/yaml_processor/result.rb | 1 + .../menus/security_compliance_menu.rb | 2 +- locale/gitlab.pot | 4 +- .../projects/ci/lints_controller_spec.rb | 6 +- .../settings/integrations_controller_spec.rb | 19 +++ spec/factories/ci/builds.rb | 2 + .../organizations/groups_finder_spec.rb | 12 -- .../editor/schema/ci/ci_schema_spec.js | 4 + .../ci/yaml_tests/negative_tests/run.yml | 58 +++++++ .../ci/yaml_tests/positive_tests/run.yml | 63 +++++++ .../entities/markdown_upload_admin_spec.rb | 26 +++ spec/lib/gitlab/ci/config/entry/job_spec.rb | 158 +++++++++++++++++- spec/lib/gitlab/ci/config/entry/jobs_spec.rb | 4 +- spec/lib/gitlab/ci/config/entry/root_spec.rb | 2 +- spec/lib/gitlab/ci/lint_spec.rb | 2 +- .../lib/gitlab/ci/pipeline/seed/build_spec.rb | 50 ++++++ spec/lib/gitlab/ci/yaml_processor_spec.rb | 4 +- .../menus/security_compliance_menu_spec.rb | 4 +- spec/models/ci/build_spec.rb | 13 ++ spec/policies/project_policy_spec.rb | 4 +- .../admin/integrations_controller_spec.rb | 74 ++++---- .../api/ci/runner/jobs_request_post_spec.rb | 93 +++++++++++ spec/requests/api/markdown_uploads_spec.rb | 133 ++++++++++++++- ...create_downstream_pipeline_service_spec.rb | 6 +- .../creation_errors_and_warnings_spec.rb | 2 +- .../ci/create_pipeline_service/run_spec.rb | 144 ++++++++++++++++ .../policies/group_policy_shared_context.rb | 2 +- .../policies/project_policy_shared_context.rb | 2 +- ...d_compliance_permissions_shared_context.rb | 4 +- vendor/gems/bundler-checksum/.gitlab-ci.yml | 11 +- .../lib/bundler_checksum/command/init.rb | 48 ++++-- .../project_with_checksum_lock/Gemfile.lock | 2 +- .../project_with_checksum_lock/scripts/test | 11 +- workhorse/go.mod | 2 +- workhorse/go.sum | 4 +- 80 files changed, 1484 insertions(+), 208 deletions(-) rename config/feature_flags/gitlab_com_derisk/{filter_deleted_groups.yml => pipeline_run_keyword.yml} (73%) create mode 100644 lib/api/entities/markdown_upload_admin.rb create mode 100644 spec/frontend/editor/schema/ci/yaml_tests/negative_tests/run.yml create mode 100644 spec/frontend/editor/schema/ci/yaml_tests/positive_tests/run.yml create mode 100644 spec/lib/api/entities/markdown_upload_admin_spec.rb create mode 100644 spec/services/ci/create_pipeline_service/run_spec.rb diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index b5153ae668c..0e2993bffcf 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -336,28 +336,27 @@ rspec system pg14 no_gitaly_transactions: rspec-ee migration pg14 no_gitaly_transactions: extends: - rspec-ee migration pg14 - - .gitaly-without-transactions + - .ee-only-gitaly-without-transactions rspec-ee background_migration pg14 no_gitaly_transactions: extends: - rspec-ee background_migration pg14 - - .gitaly-without-transactions + - .ee-only-gitaly-without-transactions rspec-ee unit pg14 no_gitaly_transactions: extends: - rspec-ee unit pg14 - - .gitaly-without-transactions + - .ee-only-gitaly-without-transactions rspec-ee integration pg14 no_gitaly_transactions: extends: - rspec-ee integration pg14 - - .gitaly-without-transactions + - .ee-only-gitaly-without-transactions rspec-ee system pg14 no_gitaly_transactions: extends: - rspec-ee system pg14 - - .gitaly-without-transactions - + - .ee-only-gitaly-without-transactions # Dedicated job to test DB library code against PG13. # Note that these are already tested against PG13 in the `rspec unit pg13` / `rspec-ee unit pg13` jobs. diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml index 41d33510742..941e974484b 100644 --- a/.gitlab/ci/rails/shared.gitlab-ci.yml +++ b/.gitlab/ci/rails/shared.gitlab-ci.yml @@ -66,6 +66,12 @@ include: variables: GITALY_TRANSACTIONS_ENABLED: "false" +.ee-only-gitaly-without-transactions: + extends: + - .rails:rules:ee-only-gitaly-without-transactions + variables: + GITALY_TRANSACTIONS_ENABLED: "false" + .rspec-base-needs: needs: - !reference [.repo-from-artifacts, needs] diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 400d232fd0d..e775ccfd9d1 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -2002,6 +2002,12 @@ - <<: *if-schedule-maintenance - <<: *if-merge-request-labels-run-without-gitaly-transactions +.rails:rules:ee-only-gitaly-without-transactions: + rules: + - <<: *if-not-ee + when: never + - !reference [".rails:rules:gitaly-without-transactions", rules] + .rails:rules:ee-and-foss-migration: rules: - <<: *if-fork-merge-request diff --git a/.rubocop_todo/rspec/file_path.yml b/.rubocop_todo/rspec/file_path.yml index 2b435d164b0..0e0c08a18a1 100644 --- a/.rubocop_todo/rspec/file_path.yml +++ b/.rubocop_todo/rspec/file_path.yml @@ -65,6 +65,7 @@ RSpec/FilePath: - 'spec/services/ci/create_pipeline_service/rate_limit_spec.rb' - 'spec/services/ci/create_pipeline_service/rules_spec.rb' - 'spec/services/ci/create_pipeline_service/scripts_spec.rb' + - 'spec/services/ci/create_pipeline_service/run_spec.rb' - 'spec/services/ci/create_pipeline_service/tags_spec.rb' - 'spec/services/ci/create_pipeline_service/variables_spec.rb' - 'spec/services/ci/create_pipeline_service/workflow_auto_cancel_spec.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index df8e0d57ff2..3442df5ec66 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -47c3c8bc2d5a93e83eee6b250a06e4c39d9c929c +8274bcec3ce5fd5059d83e724a4671bc3dcd2d68 diff --git a/Gemfile b/Gemfile index 5cf4d505cfb..cdb2f98b438 100644 --- a/Gemfile +++ b/Gemfile @@ -565,7 +565,7 @@ group :test do # Moved in `test` because https://gitlab.com/gitlab-org/gitlab/-/issues/217527 gem 'derailed_benchmarks', require: false # rubocop:todo Gemfile/MissingFeatureCategory - gem 'gitlab_quality-test_tooling', '~> 1.30.0', require: false, feature_category: :tooling + gem 'gitlab_quality-test_tooling', '~> 1.31.0', require: false, feature_category: :tooling end gem 'octokit', '~> 9.0', feature_category: :importers diff --git a/Gemfile.checksum b/Gemfile.checksum index d3c067ceca2..ff2b8b6d617 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -234,7 +234,7 @@ {"name":"gitlab-styles","version":"12.0.1","platform":"ruby","checksum":"d8a302b0ab0e1f18e2d11501760f1b85c5e70b5e5ca628828a0786c7984ed133"}, {"name":"gitlab_chronic_duration","version":"0.12.0","platform":"ruby","checksum":"0d766944d415b5c831f176871ee8625783fc0c5bfbef2d79a3a616f207ffc16d"}, {"name":"gitlab_omniauth-ldap","version":"2.2.0","platform":"ruby","checksum":"bb4d20acb3b123ed654a8f6a47d3fac673ece7ed0b6992edb92dca14bad2838c"}, -{"name":"gitlab_quality-test_tooling","version":"1.30.0","platform":"ruby","checksum":"06722db6aed571e2ec22e04a4179215cf0b49c9658ef14f71b8bd2245bc0c56c"}, +{"name":"gitlab_quality-test_tooling","version":"1.31.0","platform":"ruby","checksum":"c13d38f2ba01469179db7211008722b1f4a55270cca561d832b1eee438124f52"}, {"name":"globalid","version":"1.1.0","platform":"ruby","checksum":"b337e1746f0c8cb0a6c918234b03a1ddeb4966206ce288fbb57779f59b2d154f"}, {"name":"gon","version":"6.4.0","platform":"ruby","checksum":"e3a618d659392890f1aa7db420f17c75fd7d35aeb5f8fe003697d02c4b88d2f0"}, {"name":"google-apis-androidpublisher_v3","version":"0.34.0","platform":"ruby","checksum":"d7e1d7dd92f79c498fe2082222a1740d788e022e660c135564b3fd299cab5425"}, diff --git a/Gemfile.lock b/Gemfile.lock index f63e5f1e39a..317aaa3dc73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -754,7 +754,7 @@ GEM omniauth (>= 1.3, < 3) pyu-ruby-sasl (>= 0.0.3.3, < 0.1) rubyntlm (~> 0.5) - gitlab_quality-test_tooling (1.30.0) + gitlab_quality-test_tooling (1.31.0) activesupport (>= 7.0, < 7.2) amatch (~> 0.4.1) gitlab (~> 4.19) @@ -2044,7 +2044,7 @@ DEPENDENCIES gitlab-utils! gitlab_chronic_duration (~> 0.12) gitlab_omniauth-ldap (~> 2.2.0) - gitlab_quality-test_tooling (~> 1.30.0) + gitlab_quality-test_tooling (~> 1.31.0) gon (~> 6.4.0) google-apis-androidpublisher_v3 (~> 0.34.0) google-apis-cloudbilling_v1 (~> 0.21.0) diff --git a/app/assets/javascripts/editor/schema/ci.json b/app/assets/javascripts/editor/schema/ci.json index d6d427b8261..8ecb23b732a 100644 --- a/app/assets/javascripts/editor/schema/ci.json +++ b/app/assets/javascripts/editor/schema/ci.json @@ -880,6 +880,49 @@ } ] }, + "steps": { + "type": "array", + "items": { + "oneOf": [ + { + "required": [ + "step" + ] + }, + { + "required": [ + "script" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Unique identifier for this step." + }, + "step": { + "type": "string", + "description": "Reference to the step to invoke." + }, + "env": { + "$ref": "#/definitions/globalVariables" + }, + "inputs": { + "$ref": "#/definitions/inputs" + }, + "script": { + "type": "string", + "description": "Shell script to evaluate." + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ], + "description": "A single step invocation." + } + }, "optional_script": { "oneOf": [ { @@ -1742,6 +1785,10 @@ "$ref": "#/definitions/script", "markdownDescription": "Shell scripts executed by the Runner. The only required property of jobs. Be careful with special characters (e.g. `:`, `{`, `}`, `&`) and use single or double quotes to avoid issues. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#script)" }, + "run": { + "$ref": "#/definitions/steps", + "markdownDescription": "Specifies a list of steps to execute in the job. The `run` keyword is an alternative to `script` and allows for more advanced job configuration. Each step is an object that defines a single task or command. Use either `run` or `script` in a job, but not both, otherwise the pipeline will error out." + }, "stage": { "description": "Define what stage the job will run in.", "anyOf": [ diff --git a/app/assets/javascripts/issues/list/components/issue_card_time_info.vue b/app/assets/javascripts/issues/list/components/issue_card_time_info.vue index 5945a329759..8bc6896a87a 100644 --- a/app/assets/javascripts/issues/list/components/issue_card_time_info.vue +++ b/app/assets/javascripts/issues/list/components/issue_card_time_info.vue @@ -97,11 +97,7 @@ export default {