Skip to content
Snippets Groups Projects
Select Git revision
  • 504215-remove-strategy_add_to_merge_train_when_pipeline_succeeds-auto-merge-strategy
  • quarantine-flaky-tests-ee-spec-services-app_sec-fuzzing-coverage-corpuses-create_service_spec-rb-44
  • quarantine-flaky-tests-spec-lib-gitlab-database-query_analyzers-prevent_cross_database_modification_spec-rb-138
  • quarantine-flaky-tests-ee-spec-db-seeds-data_seeder-bulk_data_spec-rb-6
  • quarantine-flaky-tests-spec-lib-gitlab-error_tracking-error_repository-open_api_strategy_spec-rb-215
  • quarantine-flaky-tests-ee-spec-models-incident_management-issuable_escalation_status_spec-rb-48
  • quarantine-flaky-tests-spec-models-concerns-cross_database_ignored_tables_spec-rb-133
  • quarantine-flaky-tests-spec-models-concerns-cross_database_ignored_tables_spec-rb-176
  • quarantine-flaky-tests-spec-lib-gitlab-background_migration-backfill_partitioned_web_hook_logs_daily_spec-rb-49
  • 517477-feature-flag-rollout-of-process_auto_merge_on_load
  • cherryhan-master-patch-bd7d
  • overdue-finalize-background-migration--backfill-ci-build-trace-metadata-project-id
  • overdue-finalize-background-migration--backfill-ci-secure-file-states-project-id
  • overdue-finalize-background-migration--backfill-ci-job-artifact-states-project-id
  • overdue-finalize-background-migration--backfill-protected-environment-deploy-access-levels-protected-environment-group-id
  • overdue-finalize-background-migration--backfill-ml-candidate-params-project-id
  • overdue-finalize-background-migration--make-security-policy-bots-private
  • overdue-finalize-background-migration--create-jira-cloud-app-integration-for-jira-connect-subscription
  • overdue-finalize-background-migration--backfill-protected-environment-approval-rules-protected-environment-group-id
  • overdue-finalize-background-migration--backfill-new-audit-event-tables
  • v17.7.6-ee protected
  • v17.8.4-ee protected
  • v17.9.1-ee protected
  • v17.8.3-ee protected
  • v17.7.5-ee protected
  • v17.9.0-ee protected
  • v17.9.0-rc42-ee protected
  • v17.6.5-ee protected
  • v17.7.4-ee protected
  • v17.8.2-ee protected
  • v17.6.4-ee protected
  • v17.7.3-ee protected
  • v17.8.1-ee protected
  • v17.8.0-ee protected
  • v17.7.2-ee protected
  • v17.8.0-rc42-ee protected
  • v17.5.5-ee protected
  • v17.6.3-ee protected
  • v17.7.1-ee protected
  • v17.7.0-ee protected
40 results

api.rb

  • Stan Hu's avatar
    3a0c6dd9
    Upgrade to Grape v1.3.3 · 3a0c6dd9
    Stan Hu authored
    This brings back many of the changes in
    !27276. This was
    reverted due to some failures in the QA tests with nil parameters.
    
    Grape v1.3.3 brings in Ruby 2.7 support and a number of fixes:
    https://github.com/ruby-grape/grape/blob/master/CHANGELOG.md
    
    1. Move all inherited `Grape::API` -> `Grape::API::Instance`
    2. Remove use of Virtus since this has been removed from Grape.
    3. Extract `Rack::Response` from API error
    4. Grape v1.2.3 pulled in a fix used in `SafeFile`:
    https://github.com/ruby-grape/grape/pull/1844, so we no longer need
    to maintain our custom type.
    5. Adapt `WorkhorseFile` with the latest changes to make custom types
    work with Grape and dry-types.
    6. Ensure `Array[String]` is coerced properly.
    
    The change from Virtus to dry-types now requires all strings to be
    coerced to arrays. Before this was done within Virtus.
    
    7. Coerce `Array[Integer]` types to arrays of integers
    
    8. Use a new helper, `coerce_nil_params_to_array!`, that coerces nil
    Array inputs to empty arrays to preserve previous behavior.
    
    If you have a parameter of type `Array[String]`, for example, Grape used
    to coerce a provided `nil` value to `[]`. Grape no longer does this for
    us, so we need a helper method that will automatically do this if the
    parameter is present.
    
    This merge request also introduces two Rubocop rules for Grape v1.3:
    
    1. `Grape::API::Instance` instead of `Grape::API` is required, unless we
    solve #215230.
    
    2. Grape parameters defined with `Array` types (e.g. `Array[String]`,
    `Array[Integer]`) must have a `coerce_with` block or they will fail to
    parse properly. See
    https://github.com/ruby-grape/grape/blob/master/UPGRADING.md for more
    details.
    3a0c6dd9
    History
    Upgrade to Grape v1.3.3
    Stan Hu authored
    This brings back many of the changes in
    !27276. This was
    reverted due to some failures in the QA tests with nil parameters.
    
    Grape v1.3.3 brings in Ruby 2.7 support and a number of fixes:
    https://github.com/ruby-grape/grape/blob/master/CHANGELOG.md
    
    1. Move all inherited `Grape::API` -> `Grape::API::Instance`
    2. Remove use of Virtus since this has been removed from Grape.
    3. Extract `Rack::Response` from API error
    4. Grape v1.2.3 pulled in a fix used in `SafeFile`:
    https://github.com/ruby-grape/grape/pull/1844, so we no longer need
    to maintain our custom type.
    5. Adapt `WorkhorseFile` with the latest changes to make custom types
    work with Grape and dry-types.
    6. Ensure `Array[String]` is coerced properly.
    
    The change from Virtus to dry-types now requires all strings to be
    coerced to arrays. Before this was done within Virtus.
    
    7. Coerce `Array[Integer]` types to arrays of integers
    
    8. Use a new helper, `coerce_nil_params_to_array!`, that coerces nil
    Array inputs to empty arrays to preserve previous behavior.
    
    If you have a parameter of type `Array[String]`, for example, Grape used
    to coerce a provided `nil` value to `[]`. Grape no longer does this for
    us, so we need a helper method that will automatically do this if the
    parameter is present.
    
    This merge request also introduces two Rubocop rules for Grape v1.3:
    
    1. `Grape::API::Instance` instead of `Grape::API` is required, unless we
    solve #215230.
    
    2. Grape parameters defined with `Array` types (e.g. `Array[String]`,
    `Array[Integer]`) must have a `coerce_with` block or they will fail to
    parse properly. See
    https://github.com/ruby-grape/grape/blob/master/UPGRADING.md for more
    details.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.