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 @@