From 4df10dee372b4d7dfdc5baadeda2bf9d14959c0c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 31 Mar 2025 21:07:09 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab-ci.yml | 10 + .../internal_affairs/numblock_handler.yml | 1 - .../redundant_message_argument.yml | 1 - .../rspec/shared_groups_metadata.yml | 5 - .../javascripts/access_tokens/constants.js | 146 +++++++-------- .../credentials_filter_sort_app.vue | 6 +- app/assets/javascripts/credentials/utils.js | 8 +- app/finders/ci/build_name_finder.rb | 52 +----- .../resolvers/project_jobs_resolver.rb | 16 +- .../protection/access_level_interface.rb | 7 + .../namespaces/adjourned_deletable.rb | 35 ++++ app/models/group.rb | 5 +- app/models/project.rb | 1 + app/models/work_item.rb | 2 +- .../wip/downtier_delayed_deletion.yml | 9 + .../settings/product_usage_data_enabled.yml | 19 ++ .../17-6-cancel-rest-api-change.yml | 41 ----- ...8-container-registry-aws-sdk-signature.yml | 4 +- .../18-0-updating-ci-job-token.yml | 8 +- doc/api/graphql/reference/_index.md | 5 +- doc/api/jobs.md | 2 +- doc/ci/jobs/_index.md | 146 +++++++++++++++ doc/ci/jobs/job_logs.md | 64 ------- doc/update/breaking_windows.md | 3 +- doc/update/deprecations.md | 27 +-- doc/user/duo_amazon_q/_index.md | 17 ++ .../authenticate_with_container_registry.md | 2 + doc/user/packages/npm_registry/_index.md | 48 +++++ .../project/merge_requests/status_checks.md | 9 + lib/api/ci/pipelines.rb | 1 + lib/authn/token_field/prefix_helper.rb | 9 + lib/authn/tokens/feed_token.rb | 3 +- lib/gitlab/ci/parsers/sbom/license.rb | 3 + .../Dependency-Scanning.latest.gitlab-ci.yml | 54 +----- .../templates/Jobs/SAST.latest.gitlab-ci.yml | 85 +++++++++ locale/gitlab.pot | 51 +++--- rubocop/cop/rspec/shared_groups_metadata.rb | 52 ------ scripts/frontend/quarantined_vue3_specs.txt | 1 - .../admin/projects_controller_spec.rb | 1 + spec/controllers/groups_controller_spec.rb | 1 + spec/features/groups_spec.rb | 1 + spec/features/markdown/copy_as_gfm_spec.rb | 4 + spec/finders/ci/build_name_finder_spec.rb | 92 ++-------- .../shared/components/daterange_spec.js | 2 +- .../table/expiration_datepicker_spec.js | 12 +- .../components/search_box_by_type_spec.js | 8 +- spec/frontend/vue_compat_test_setup.js | 9 +- .../markdown/markdown_editor_spec.js | 4 +- .../protection/access_level_type_spec.rb | 27 +++ .../protection/tag_rule_type_spec.rb | 6 + .../authn/agnostic_token_identifier_spec.rb | 24 ++- .../authn/token_field/prefix_helper_spec.rb | 90 +++++++-- spec/lib/gitlab/ci/config/entry/retry_spec.rb | 28 ++- .../gitlab/ci/parsers/sbom/license_spec.rb | 14 ++ spec/lib/gitlab/git/merge_base_spec.rb | 40 ++-- .../namespaces/adjourned_deletable_spec.rb | 171 ++++++++++++++++++ .../protection/tag_rule/delete_spec.rb | 3 +- spec/requests/api/groups_spec.rb | 4 + .../organizations/groups_controller_spec.rb | 4 + .../cop/rspec/shared_groups_metadata_spec.rb | 70 ------- spec/spec_helper.rb | 2 + .../current_organization_context.rb | 2 +- .../models/disable_sti_shared_examples.rb | 2 +- .../groups/settings/_remove.html.haml_spec.rb | 4 + 64 files changed, 968 insertions(+), 615 deletions(-) delete mode 100644 .rubocop_todo/rspec/shared_groups_metadata.yml create mode 100644 app/models/concerns/namespaces/adjourned_deletable.rb create mode 100644 config/feature_flags/wip/downtier_delayed_deletion.yml create mode 100644 config/metrics/settings/product_usage_data_enabled.yml delete mode 100644 data/deprecations/17-6-cancel-rest-api-change.yml delete mode 100644 rubocop/cop/rspec/shared_groups_metadata.rb create mode 100644 spec/graphql/types/container_registry/protection/access_level_type_spec.rb create mode 100644 spec/models/concerns/namespaces/adjourned_deletable_spec.rb delete mode 100644 spec/rubocop/cop/rspec/shared_groups_metadata_spec.rb diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e2f292f470..6287daf5511 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -99,10 +99,15 @@ workflow: # Example of project bot usernames (the format changed over time): # - project_278964_bot2 # - project_278964_bot_7fb4d1cca8242cb399a0b8f483783120 + # + # We set the DOCKER_AUTH_CONFIG variable to authenticate to Docker Hub to not be impacted by rate limitations + # We don't set DOCKER_AUTH_CONFIG as a CI/CD group/project variable, because it would then have higher precedence than .gitlab-ci.yml, + # and we would always reconfigure the docker deamon for any CI/CD pipeline. - if: '$CI_MERGE_REQUEST_IID && $GITLAB_USER_LOGIN =~ /project_\d+_bot/' variables: <<: [*next-ruby-variables, *default-merge-request-variables] GITLAB_DEPENDENCY_PROXY_ADDRESS: "" + DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_OVERRIDE}" PIPELINE_NAME: 'Ruby $RUBY_VERSION MR (triggered by a project token)' - <<: *if-merge-request-security-canonical-sync variables: @@ -145,10 +150,15 @@ workflow: # Example of project bot usernames (the format changed over time): # - project_278964_bot2 # - project_278964_bot_7fb4d1cca8242cb399a0b8f483783120 + # + # We set the DOCKER_AUTH_CONFIG variable to authenticate to Docker Hub to not be impacted by rate limitations + # We don't set DOCKER_AUTH_CONFIG as a CI/CD group/project variable, because it would then have higher precedence than .gitlab-ci.yml, + # and we would always reconfigure the docker deamon for any CI/CD pipeline. - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $GITLAB_USER_LOGIN =~ /project_\d+_bot/' variables: <<: [*default-ruby-variables, *default-branch-pipeline-failure-variables] GITLAB_DEPENDENCY_PROXY_ADDRESS: "" + DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_OVERRIDE}" PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch (triggered by a project token)' # For `$CI_DEFAULT_BRANCH` from wider community contributors, we don't want to run any pipelines on pushes, # because normally we want to run merge request pipelines and scheduled pipelines, not for repository synchronization. diff --git a/.rubocop_todo/internal_affairs/numblock_handler.yml b/.rubocop_todo/internal_affairs/numblock_handler.yml index 39aceed84d9..dd3d556758a 100644 --- a/.rubocop_todo/internal_affairs/numblock_handler.yml +++ b/.rubocop_todo/internal_affairs/numblock_handler.yml @@ -11,4 +11,3 @@ InternalAffairs/NumblockHandler: - 'rubocop/cop/migration/with_lock_retries_disallowed_method.rb' - 'rubocop/cop/qa/ambiguous_page_object_name.rb' - 'rubocop/cop/rspec/feature_category.rb' - - 'rubocop/cop/rspec/shared_groups_metadata.rb' diff --git a/.rubocop_todo/internal_affairs/redundant_message_argument.yml b/.rubocop_todo/internal_affairs/redundant_message_argument.yml index 626a7229ec6..424762d8e49 100644 --- a/.rubocop_todo/internal_affairs/redundant_message_argument.yml +++ b/.rubocop_todo/internal_affairs/redundant_message_argument.yml @@ -15,6 +15,5 @@ InternalAffairs/RedundantMessageArgument: - 'rubocop/cop/migration/prevent_single_statement_with_disable_ddl_transaction.rb' - 'rubocop/cop/migration/schema_addition_methods_no_post.rb' - 'rubocop/cop/redis_queue_usage.rb' - - 'rubocop/cop/rspec/shared_groups_metadata.rb' - 'rubocop/cop/sidekiq_api_usage.rb' - 'rubocop/cop/sidekiq_redis_call.rb' diff --git a/.rubocop_todo/rspec/shared_groups_metadata.yml b/.rubocop_todo/rspec/shared_groups_metadata.yml deleted file mode 100644 index b8de7d415bb..00000000000 --- a/.rubocop_todo/rspec/shared_groups_metadata.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -RSpec/SharedGroupsMetadata: - Exclude: - - 'spec/lib/gitlab/ci/config/entry/retry_spec.rb' - - 'spec/lib/gitlab/git/merge_base_spec.rb' diff --git a/app/assets/javascripts/access_tokens/constants.js b/app/assets/javascripts/access_tokens/constants.js index 47adae87fbe..fbd6c379c8d 100644 --- a/app/assets/javascripts/access_tokens/constants.js +++ b/app/assets/javascripts/access_tokens/constants.js @@ -11,6 +11,81 @@ export const FEED_TOKEN = 'feedToken'; export const INCOMING_EMAIL_TOKEN = 'incomingEmailToken'; export const STATIC_OBJECT_TOKEN = 'staticObjectToken'; +export const FILTER_OPTIONS = [ + { + icon: 'status', + title: s__('AccessTokens|State'), + type: 'state', + token: GlFilteredSearchToken, + operators: OPERATORS_IS, + unique: true, + options: [ + { value: 'active', title: s__('AccessTokens|Active') }, + { value: 'inactive', title: s__('AccessTokens|Inactive') }, + ], + }, + { + icon: 'remove', + title: s__('AccessTokens|Revoked'), + type: 'revoked', + token: GlFilteredSearchToken, + operators: OPERATORS_IS, + unique: true, + options: [ + { value: 'true', title: __('Yes') }, + { value: 'false', title: __('No') }, + ], + }, + { + icon: 'history', + title: __('Created date'), + type: 'created', + token: DateToken, + operators: OPERATORS_AFTER_BEFORE, + unique: true, + }, + { + icon: 'history', + title: __('Expiration date'), + type: 'expires', + token: DateToken, + operators: OPERATORS_AFTER_BEFORE, + unique: true, + }, + { + icon: 'history', + title: __('Last used date'), + type: 'last_used', + token: DateToken, + operators: OPERATORS_AFTER_BEFORE, + unique: true, + }, +]; + +export const FILTER_OPTIONS_CREDENTIALS_INVENTORY = [ + { + icon: 'key', + title: s__('CredentialsInventory|Type'), + type: 'filter', + token: GlFilteredSearchToken, + operators: OPERATORS_IS, + unique: true, + options: [ + { + value: 'personal_access_tokens', + title: s__('CredentialsInventory|Personal access tokens'), + }, + { value: 'ssh_keys', title: s__('CredentialsInventory|SSH keys') }, + { + value: 'resource_access_tokens', + title: s__('CredentialsInventory|Project and group access tokens'), + }, + { value: 'gpg_keys', title: s__('CredentialsInventory|GPG keys') }, + ], + }, + ...FILTER_OPTIONS, +]; + export const DEFAULT_SORT = { value: 'expires', isAsc: true }; export const SORT_OPTIONS = [ @@ -48,77 +123,6 @@ export const SORT_OPTIONS = [ }, ]; -export const TOKENS = [ - { - icon: 'key', - title: s__('CredentialsInventory|Type'), - type: 'filter', - token: GlFilteredSearchToken, - operators: OPERATORS_IS, - unique: true, - options: [ - { - value: 'personal_access_tokens', - title: s__('CredentialsInventory|Personal access tokens'), - }, - { value: 'ssh_keys', title: s__('CredentialsInventory|SSH keys') }, - { - value: 'resource_access_tokens', - title: s__('CredentialsInventory|Project and group access tokens'), - }, - { value: 'gpg_keys', title: s__('CredentialsInventory|GPG keys') }, - ], - }, - { - icon: 'status', - title: s__('CredentialsInventory|State'), - type: 'state', - token: GlFilteredSearchToken, - operators: OPERATORS_IS, - unique: true, - options: [ - { value: 'active', title: s__('CredentialsInventory|Active') }, - { value: 'inactive', title: s__('CredentialsInventory|Inactive') }, - ], - }, - { - icon: 'remove', - title: s__('CredentialsInventory|Revoked'), - type: 'revoked', - token: GlFilteredSearchToken, - operators: OPERATORS_IS, - unique: true, - options: [ - { value: 'true', title: __('Yes') }, - { value: 'false', title: __('No') }, - ], - }, - { - icon: 'history', - title: s__('CredentialsInventory|Created date'), - type: 'created', - token: DateToken, - operators: OPERATORS_AFTER_BEFORE, - unique: true, - }, - { - icon: 'history', - title: s__('CredentialsInventory|Expiration date'), - type: 'expires', - token: DateToken, - operators: OPERATORS_AFTER_BEFORE, - unique: true, - }, - { - icon: 'history', - title: s__('CredentialsInventory|Last used date'), - type: 'last_used', - token: DateToken, - operators: OPERATORS_AFTER_BEFORE, - unique: true, - }, -]; - export const STATISTICS_CONFIG = [ { title: s__('AccessTokens|Active tokens'), diff --git a/app/assets/javascripts/credentials/components/credentials_filter_sort_app.vue b/app/assets/javascripts/credentials/components/credentials_filter_sort_app.vue index d4e71f63339..0166c3f816a 100644 --- a/app/assets/javascripts/credentials/components/credentials_filter_sort_app.vue +++ b/app/assets/javascripts/credentials/components/credentials_filter_sort_app.vue @@ -1,6 +1,6 @@