diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-02 15:06:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-02 15:06:59 +0300 |
commit | e9570ea27e2dc549962b9b318af369e9363fd1c4 (patch) | |
tree | 1a6aabfa0b41df8f6400a7bbcabe0bdb54f10fe7 | |
parent | 7e8ecb5c00aae3b7072a5b8ff2c53db03c0bc579 (diff) |
Add latest changes from gitlab-org/gitlab@master
71 files changed, 485 insertions, 734 deletions
@@ -598,5 +598,8 @@ gem 'telesignenterprise', '~> 2.2' # BufferedIO patch # Updating this version will require updating scripts/allowed_warnings.txt gem 'net-protocol', '~> 0.1.3' +# Lock this until we make DNS rebinding work with the updated net-http: +# https://gitlab.com/gitlab-org/gitlab/-/issues/413528 +gem 'net-http', '= 0.1.1' gem 'duo_api', '~> 1.3' diff --git a/Gemfile.checksum b/Gemfile.checksum index ad83d9f0985..605b11430c4 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -378,6 +378,7 @@ {"name":"nap","version":"1.1.0","platform":"ruby","checksum":"949691660f9d041d75be611bb2a8d2fd559c467537deac241f4097d9b5eea576"}, {"name":"neighbor","version":"0.2.3","platform":"ruby","checksum":"70887ac2110d0c7ab243ee988f64359b8bb94a63a0c78542bbeef4f33b1933e5"}, {"name":"nenv","version":"0.3.0","platform":"ruby","checksum":"d9de6d8fb7072228463bf61843159419c969edb34b3cef51832b516ae7972765"}, +{"name":"net-http","version":"0.1.1","platform":"ruby","checksum":"75a4e109b6f9af32fad0e98a6180c47aceb415927ca3bd70c8fc3e7dbbabbe86"}, {"name":"net-http-persistent","version":"4.0.1","platform":"ruby","checksum":"2752f4cce05fd1c45e0537c6f3a98fa5a4899efd5f88e63c104ed5f05cbddef9"}, {"name":"net-imap","version":"0.3.4","platform":"ruby","checksum":"a82a59e2a429433dc54cae5a8b2979ffe49da8c66085740811bfa337dc3729b5"}, {"name":"net-ldap","version":"0.18.0","platform":"ruby","checksum":"59adc934c4ab000c8bb02cffb6d415af6cc17f03e1fee80823a60436ac730c77"}, @@ -665,6 +666,7 @@ {"name":"uniform_notifier","version":"1.16.0","platform":"ruby","checksum":"99b39ee4a0864e3b49f375b5e5803eb26d35ed6eb1719c96407573a87bc4dbb5"}, {"name":"unleash","version":"3.2.2","platform":"ruby","checksum":"0f6e56498de920de66a01bceffb93933693ade646bb853fc70eb16bd1026b93b"}, {"name":"unparser","version":"0.6.7","platform":"ruby","checksum":"ae42e73edfa273766e66c166368fb75ca5972cd8ec50c536253e0f6299a9dec8"}, +{"name":"uri","version":"0.12.1","platform":"ruby","checksum":"8c219a8840557ff1b321b8a34f8ede1940b7d224a75893677cd87dedece12fee"}, {"name":"uri_template","version":"0.7.0","platform":"ruby","checksum":"312c8fe13700db86ac9d05ea997af3db03abdf50c65b1801d775bc7a695f185d"}, {"name":"valid_email","version":"0.1.3","platform":"ruby","checksum":"b81452b51b64c4beb67913f68db52c20ecb4d73d45512f5b282ab4a3f4416570"}, {"name":"validate_email","version":"0.1.6","platform":"ruby","checksum":"9dfe9016d527b17a8d3a6e95e4dc50a125400eef899d13d4cc2a254393f82ee4"}, diff --git a/Gemfile.lock b/Gemfile.lock index 5d050e0494b..95cb3700f71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -979,6 +979,9 @@ GEM neighbor (0.2.3) activerecord (>= 5.2) nenv (0.3.0) + net-http (0.1.1) + net-protocol + uri net-http-persistent (4.0.1) connection_pool (~> 2.2) net-imap (0.3.4) @@ -1582,6 +1585,7 @@ GEM unparser (0.6.7) diff-lcs (~> 1.3) parser (>= 3.2.0) + uri (0.12.1) uri_template (0.7.0) valid_email (0.1.3) activemodel @@ -1822,6 +1826,7 @@ DEPENDENCIES minitest (~> 5.11.0) multi_json (~> 1.14.1) neighbor (~> 0.2.3) + net-http (= 0.1.1) net-ldap (~> 0.18.0) net-ntp net-protocol (~> 0.1.3) diff --git a/app/assets/javascripts/analytics/shared/constants.js b/app/assets/javascripts/analytics/shared/constants.js index c98cf90f406..e9d6d121e6d 100644 --- a/app/assets/javascripts/analytics/shared/constants.js +++ b/app/assets/javascripts/analytics/shared/constants.js @@ -1,4 +1,5 @@ -import { masks } from '~/lib/dateformat'; +import dateFormat, { masks } from '~/lib/dateformat'; +import { nDaysBefore, getStartOfDay } from '~/lib/utils/datetime_utility'; import { s__ } from '~/locale'; import { helpPagePath } from '~/helpers/help_page_helper'; @@ -13,6 +14,10 @@ export const dateFormats = { month: 'mmmm', }; +const startOfToday = getStartOfDay(new Date(), { utc: true }); +const last180Days = nDaysBefore(startOfToday, DATE_RANGE_LIMIT, { utc: true }); +const formatDateParam = (d) => dateFormat(d, dateFormats.isoDate, true); + export const METRIC_POPOVER_LABEL = s__('ValueStreamAnalytics|View details'); export const KEY_METRICS = { @@ -46,6 +51,12 @@ export const VULNERABILITY_METRICS = { HIGH: VULNERABILITY_HIGH_TYPE, }; +export const MERGE_REQUEST_THROUGHPUT_TYPE = 'merge_request_throughput'; + +export const MERGE_REQUEST_METRICS = { + THROUGHPUT: MERGE_REQUEST_THROUGHPUT_TYPE, +}; + export const METRIC_TOOLTIPS = { [DORA_METRICS.DEPLOYMENT_FREQUENCY]: { description: s__( @@ -121,6 +132,16 @@ export const METRIC_TOOLTIPS = { projectLink: '-/security/vulnerability_report', docsLink: helpPagePath('user/application_security/vulnerability_report/index'), }, + [MERGE_REQUEST_METRICS.THROUGHPUT]: { + description: s__('ValueStreamAnalytics|The number of merge requests merged by month.'), + groupLink: '-/analytics/productivity_analytics', + projectLink: `-/analytics/merge_request_analytics?start_date=${formatDateParam( + last180Days, + )}&end_date=${formatDateParam(startOfToday)}`, + docsLink: helpPagePath('user/analytics/merge_request_analytics', { + anchor: 'view-the-number-of-merge-requests-in-a-date-range', + }), + }, }; // TODO: Remove this once the migration to METRIC_TOOLTIPS is complete diff --git a/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue b/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue index c61c02c8b3a..ea9702258b7 100644 --- a/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue +++ b/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue @@ -24,6 +24,11 @@ export default { required: false, default: TYPE_ISSUE, }, + selected: { + type: Boolean, + required: false, + default: false, + }, }, computed: { isBusy() { @@ -53,6 +58,7 @@ export default { name="warning-solid" aria-hidden="true" class="merge-icon" + :class="{ 'gl-left-6!': selected }" :size="12" /> <gl-badge v-if="isBusy" size="sm" variant="warning" class="gl-ml-2"> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/unresolved_discussions.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/unresolved_discussions.vue index af036c01032..e4e81a5e2d1 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/unresolved_discussions.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/unresolved_discussions.vue @@ -3,7 +3,6 @@ import { GlButton } from '@gitlab/ui'; import { s__ } from '~/locale'; import notesEventHub from '~/notes/event_hub'; import BoldText from '~/vue_merge_request_widget/components/bold_text.vue'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import StateContainer from '../state_container.vue'; const message = s__('mrWidget|%{boldStart}Merge blocked:%{boldEnd} all threads must be resolved.'); @@ -16,7 +15,6 @@ export default { GlButton, StateContainer, }, - mixins: [glFeatureFlagsMixin()], props: { mr: { type: Object, @@ -52,16 +50,6 @@ export default { > {{ s__('mrWidget|Go to first unresolved thread') }} </gl-button> - <gl-button - v-if="mr.createIssueToResolveDiscussionsPath && !glFeatures.hideCreateIssueResolveAll" - :href="mr.createIssueToResolveDiscussionsPath" - class="js-create-issue gl-align-self-start gl-vertical-align-top" - size="small" - variant="confirm" - category="secondary" - > - {{ s__('mrWidget|Resolve all with new issue') }} - </gl-button> </template> </state-container> </template> diff --git a/app/assets/javascripts/vue_shared/components/user_select/user_select.vue b/app/assets/javascripts/vue_shared/components/user_select/user_select.vue index abd3575d020..ac4d1517d52 100644 --- a/app/assets/javascripts/vue_shared/components/user_select/user_select.vue +++ b/app/assets/javascripts/vue_shared/components/user_select/user_select.vue @@ -345,7 +345,7 @@ export default { data-testid="selected-participant" @click.native.capture.stop="unselect(item.username)" > - <sidebar-participant :user="item" :issuable-type="issuableType" /> + <sidebar-participant :user="item" :issuable-type="issuableType" selected /> </gl-dropdown-item> <template v-if="showCurrentUser"> <gl-dropdown-divider /> diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 4423929e48b..0ce52f75913 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -49,7 +49,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo push_frontend_feature_flag(:realtime_approvals, project) push_frontend_feature_flag(:saved_replies, current_user) push_frontend_feature_flag(:code_quality_inline_drawer, project) - push_frontend_feature_flag(:hide_create_issue_resolve_all, project) push_frontend_feature_flag(:auto_merge_labels_mr_widget, project) push_force_frontend_feature_flag(:summarize_my_code_review, summarize_my_code_review_enabled?) push_frontend_feature_flag(:mr_activity_filters, current_user) diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index bc07c3f4370..e09736cad6c 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -9,7 +9,6 @@ - compact_mode = false unless local_assigns[:compact_mode] == true - show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project) - css_class = "gl-sm-display-flex gl-align-items-center gl-vertical-align-middle!" if project.description.blank? && !show_last_commit_as_description -- cache_key = project_list_cache_key(project, pipeline_status: pipeline_status) - updated_tooltip = time_ago_with_tooltip(project.last_activity_date) - show_pipeline_status_icon = pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project) - last_pipeline = last_pipeline_from_status_cache(project) if show_pipeline_status_icon @@ -17,14 +16,13 @@ - css_metadata_classes = "gl-display-flex gl-align-items-center gl-ml-5 gl-reset-color! icon-wrapper has-tooltip" %li.project-row - = cache(cache_key) do - - if avatar - .project-cell.gl-w-11 - = link_to project_path(project), class: dom_class(project) do - - if project.creator && use_creator_avatar - = render Pajamas::AvatarComponent.new(project.creator, size: 48, alt: '', class: 'gl-mr-5') - - else - = render Pajamas::AvatarComponent.new(project, size: 48, alt: '', class: 'gl-mr-5') + - if avatar + .project-cell.gl-w-11 + = link_to project_path(project), class: dom_class(project) do + - if project.creator && use_creator_avatar + = render Pajamas::AvatarComponent.new(project.creator, size: 48, alt: '', class: 'gl-mr-5') + - else + = render Pajamas::AvatarComponent.new(project, size: 48, alt: '', class: 'gl-mr-5') .project-cell{ class: css_class } .project-details.gl-pr-9.gl-sm-pr-0.gl-w-full.gl-display-flex.gl-flex-direction-column{ data: { qa_selector: 'project_content', qa_project_name: project.name } } .gl-display-flex.gl-align-items-center.gl-flex-wrap diff --git a/config/feature_flags/development/hide_create_issue_resolve_all.yml b/config/feature_flags/development/hide_create_issue_resolve_all.yml deleted file mode 100644 index 504961f8f5b..00000000000 --- a/config/feature_flags/development/hide_create_issue_resolve_all.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: hide_create_issue_resolve_all -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116322 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/404498 -milestone: '15.11' -type: development -group: group::ux paper cuts -default_enabled: false diff --git a/config/initializers/net_http_patch.rb b/config/initializers/net_http_patch.rb index 4f851d5ee6d..8231423e1a5 100644 --- a/config/initializers/net_http_patch.rb +++ b/config/initializers/net_http_patch.rb @@ -6,9 +6,11 @@ # See Ruby-lang issue https://bugs.ruby-lang.org/issues/17542 # See issue on GitLab https://gitlab.com/gitlab-org/gitlab/-/issues/289836 +require 'net/http' + # This file can be removed once Ruby 3.0 is no longer supported: # https://gitlab.com/gitlab-org/gitlab/-/issues/396223 -return if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(3.1) +return if Gem::Version.new(Net::HTTP::VERSION) >= Gem::Version.new('0.2.0') module Net class HTTP < Protocol diff --git a/config/routes.rb b/config/routes.rb index 575b3089307..3a09bf4b136 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -284,6 +284,7 @@ InitializerConnections.raise_if_new_database_connection do draw :user draw :project draw :unmatched_project + draw :well_known # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/210024 scope as: 'deprecated' do diff --git a/config/routes/well_known.rb b/config/routes/well_known.rb new file mode 100644 index 00000000000..0c48f116da9 --- /dev/null +++ b/config/routes/well_known.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +get '/.well-known/change-password', to: redirect('-/profile/password/edit'), status: 302 diff --git a/db/fixtures/development/99_common_metrics.rb b/db/fixtures/development/99_common_metrics.rb deleted file mode 100644 index d52f78ea536..00000000000 --- a/db/fixtures/development/99_common_metrics.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true - -::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute diff --git a/db/fixtures/production/999_common_metrics.rb b/db/fixtures/production/999_common_metrics.rb deleted file mode 100644 index d52f78ea536..00000000000 --- a/db/fixtures/production/999_common_metrics.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true - -::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute diff --git a/doc/administration/geo/setup/index.md b/doc/administration/geo/setup/index.md index 3f3a5c29e78..4dbd2ef6167 100644 --- a/doc/administration/geo/setup/index.md +++ b/doc/administration/geo/setup/index.md @@ -47,7 +47,7 @@ If one or more of your sites is using the [2K reference architecture](../../refe [Configure the GitLab chart with GitLab Geo](https://docs.gitlab.com/charts/advanced/geo/). -## Geo and self-compiled installations +## Geo and self-compiled installations Geo is not supported when you use a [self-compiled GitLab installation](../../../install/installation.md). diff --git a/doc/api/project_job_token_scopes.md b/doc/api/project_job_token_scopes.md index 04dc3291bc4..132f961a344 100644 --- a/doc/api/project_job_token_scopes.md +++ b/doc/api/project_job_token_scopes.md @@ -28,10 +28,10 @@ Supported attributes: If successful, returns [`200`](rest/index.md#status-codes) and the following response attributes: -| Attribute | Type | Description | -|:-------------------|:---------|:----------------------| -| `inbound_enabled` | boolean | Indicates if the CI/CD job token generated in other projects has access to this project. | -| `outbound_enabled` | boolean | Indicates if the CI/CD job token generated in this project has access to other projects. [Deprecated and planned for removal in GitLab 17.0 .](../update/removals.md#limit-ci_job_token-scope-is-disabled) | +| Attribute | Type | Description | +|:-------------------|:--------|:----------------------| +| `inbound_enabled` | boolean | Indicates if the CI/CD job token generated in other projects has access to this project. | +| `outbound_enabled` | boolean | Indicates if the CI/CD job token generated in this project has access to other projects. [Deprecated and planned for removal in GitLab 17.0 .](../update/removals.md#limit-ci_job_token-scope-is-disabled) | Example request: @@ -58,9 +58,9 @@ PATCH /projects/:id/job_token_scope Supported attributes: -| Attribute | Type | Required | Description | -|-----------|----------------|-------------------------|-------------| -| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. | +| Attribute | Type | Required | Description | +|-----------|----------------|------------------------|-------------| +| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. | | `enabled` | boolean | **{check-circle}** Yes | Indicates CI/CD job tokens generated in other projects have restricted access to this project. | If successful, returns [`204`](rest/index.md#status-codes) and no response body. @@ -69,7 +69,7 @@ Example request: ```shell curl --request PATCH \ - --url "https://gitlab.example.com/api/v4/projects/7/job_token_scope" \ + --url "https://gitlab.example.com/api/v4/projects/1/job_token_scope" \ --header 'PRIVATE-TOKEN: <your_access_token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": false }' @@ -141,3 +141,71 @@ Example response: ... } ``` + +## Create a new project to a project's CI/CD job token inbound allowlist + +Add a project to the [CI/CD job token inbound allowlist](../ci/jobs/ci_job_token.md#allow-access-to-your-project-with-a-job-token) of a project. + +```plaintext +POST /projects/:id/job_token_scope/allowlist +``` + +Supported attributes: + +| Attribute | Type | Required | Description | +|---------------------|----------------|------------------------|-------------| +| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. | +| `target_project_id` | integer | **{check-circle}** Yes | The ID of the project added to the CI/CD job token inbound allowlist. | + +If successful, returns [`201`](rest/index.md#status-codes) and the following response attributes: + +| Attribute | Type | Description | +|:--------------------|:--------|:----------------------| +| `source_project_id` | integer | The ID of the project whose CI/CD job token inbound allowlist is added to. | +| `target_project_id` | integer | The ID of the project that is added to the inbound allowlist of the source project. | + +Example request: + +```shell +curl --request PATCH \ + --url "https://gitlab.example.com/api/v4/projects/1/job_token_scope" \ + --header 'PRIVATE-TOKEN: <your_access_token>' \ + --header 'Content-Type: application/json' \ + --data '{ "target_project_id": 2 }' +``` + +Example response: + +```json +{ + "source_project_id": 1, + "target_project_id": 2 +} +``` + +## Remove a project from a project's CI/CD job token inbound allowlist + +Remove a project from the [CI/CD job token inbound allowlist](../ci/jobs/ci_job_token.md#allow-access-to-your-project-with-a-job-token) of a project. + +```plaintext +DELETE /projects/:id/job_token_scope/allowlist/:target_project_id +``` + +Supported attributes: + +| Attribute | Type | Required | Description | +|---------------------|----------------|------------------------|-------------| +| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. | +| `target_project_id` | integer | **{check-circle}** Yes | The ID of the project that is removed from the CI/CD job token inbound allowlist. | + +If successful, returns [`204`](rest/index.md#status-codes) and no response body. + +Example request: + +```shell + +curl --request DELETE \ + --url "https://gitlab.example.com/api/v4/projects/1/job_token_scope/allowlist/2" \ + --header 'PRIVATE-TOKEN: <your_access_token>' \ + --header 'Content-Type: application/json' +``` diff --git a/doc/ci/runners/saas/linux_saas_runner.md b/doc/ci/runners/saas/linux_saas_runner.md index f596d4da8c5..d0ddbdfcaf0 100644 --- a/doc/ci/runners/saas/linux_saas_runner.md +++ b/doc/ci/runners/saas/linux_saas_runner.md @@ -37,6 +37,30 @@ We offer GPU-enabled SaaS runners for heavy compute including ModelOps or HPC wo | Specs | 4 vCPU, 16 GB RAM, 1 Nvidia Tesla T4 GPU (or similar) | | GitLab CI/CD tags | `saas-linux-medium-amd64-gpu-standard` | +As with all our Linux runners, your job runs in an isolated virtual machine (VM) +with a bring-your-own-image policy. GitLab mounts the GPU from the host VM into +your isolated environment. To use the GPU, you must use a Docker image with the +GPU driver installed. For Nvidia GPUs, you can use their [CUDA Toolkit](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda). + +## Example of GPU job + +In the following example of the `.gitlab-ci.yml` file, the Nvidia CUDA base Ubuntu image is used. +In in the `script:` section we install Python. + +```yaml +gpu-job: + stage: build + tags: + - saas-linux-medium-amd64-gpu-standard + image: nvcr.io/nvidia/cuda:12.1.1-base-ubuntu22.04 + script: + - apt-get update + - apt-get install -y python3.10 + - python3.10 --version +``` + +If you don't want to install larger libraries such as Tensorflow or XGBoost each time you run a job, you can create your own image with all the required components pre-installed. + ## Example of how to tag a job To use a machine type other than `small`, add a `tags:` keyword to your job. @@ -89,7 +113,7 @@ Below are the settings for SaaS runners on Linux. [distributed cache](https://docs.gitlab.com/runner/configuration/autoscale.html#distributed-runners-caching) that's stored in a Google Cloud Storage (GCS) bucket. Cache contents not updated in the last 14 days are automatically removed, based on the - [object lifecycle management policy](https://cloud.google.com/storage/docs/lifecycle). The maximum size of an + [object lifecycle management policy](https://cloud.google.com/storage/docs/lifecycle). The maximum size of an uploaded cache artifact can be 5GB after the cache becomes a compressed archive. - **Timeout settings**: Jobs handled by the SaaS Runners on Linux diff --git a/doc/development/uploads/index.md b/doc/development/uploads/index.md index a62e8ea2d58..92b52d2b59c 100644 --- a/doc/development/uploads/index.md +++ b/doc/development/uploads/index.md @@ -1,6 +1,6 @@ --- -stage: none -group: unassigned +stage: SaaS Platforms +group: Scalability info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments --- diff --git a/doc/development/uploads/working_with_uploads.md b/doc/development/uploads/working_with_uploads.md index 5575297ad6b..e487f2a19d3 100644 --- a/doc/development/uploads/working_with_uploads.md +++ b/doc/development/uploads/working_with_uploads.md @@ -1,6 +1,6 @@ --- -stage: none -group: unassigned +stage: SaaS Platforms +group: Scalability info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments --- diff --git a/doc/topics/git/lfs/img/lfs-icon.png b/doc/topics/git/lfs/img/lfs-icon.png Binary files differdeleted file mode 100644 index eef9a14187a..00000000000 --- a/doc/topics/git/lfs/img/lfs-icon.png +++ /dev/null diff --git a/doc/topics/git/lfs/img/lfs_badge_v16_0.png b/doc/topics/git/lfs/img/lfs_badge_v16_0.png Binary files differnew file mode 100644 index 00000000000..d78da8b5f02 --- /dev/null +++ b/doc/topics/git/lfs/img/lfs_badge_v16_0.png diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md index 4f0d1bfc5e6..9c32ab2ed94 100644 --- a/doc/topics/git/lfs/index.md +++ b/doc/topics/git/lfs/index.md @@ -11,25 +11,37 @@ Managing large files such as audio, video and graphics files has always been one of the shortcomings of Git. The general recommendation is to not have Git repositories larger than 1 GB to preserve performance. -![Git LFS tracking status](img/lfs-icon.png) +Your Git LFS client communicates with the GitLab server over HTTPS. It uses HTTP Basic authentication +to authorize client requests. After the request is authorized, Git LFS client receives +instructions on where to fetch or where to push the large file. -Files tracked by Git LFS display an icon to indicate if the file is stored as a -blob or an LFS pointer. +In the repository view, files tracked by Git LFS display an **LFS** badge next to the filename: -## How it works +![Git LFS tracking status](img/lfs_badge_v16_0.png) -Git LFS client communicates with the GitLab server over HTTPS. It uses HTTP Basic Authentication -to authorize client requests. After the request is authorized, Git LFS client receives -instructions from where to fetch or where to push the large file. +## Configure your GitLab server for Git LFS **(FREE SELF)** + +To install Git LFS on your self-managed GitLab server, see +[GitLab Git Large File Storage (LFS) Administration](../../../administration/lfs/index.md). + +## Enable Git LFS for a project + +Prerequisites: + +- You must have at least the Developer role in the project. -## GitLab server configuration +To do this: -Documentation for GitLab instance administrators is under [LFS administration doc](../../../administration/lfs/index.md). +1. On the top bar, select **Main menu > Projects** and find your project. +1. On the left sidebar, select **Settings > General**. +1. Expand the **Visibility, project features, permissions** section. +1. Turn on the **Git Large File Storage (LFS)** toggle. +1. Select **Save changes**. -## Prerequisites +## Install the Git LFS client locally -- Git LFS must be [enabled in project settings](../../../user/project/settings/index.md#configure-project-visibility-features-and-permissions). -- [Git LFS client](https://git-lfs.com/) version 1.0.1 or later must be installed. +Install the [Git LFS client](https://github.com/git-lfs/git-lfs) appropriate for +your operating system. GitLab requires version 1.0.1 or later of the Git LFS client. ## Known limitations diff --git a/doc/user/analytics/value_streams_dashboard.md b/doc/user/analytics/value_streams_dashboard.md index b207dff1f11..1a58679cfc0 100644 --- a/doc/user/analytics/value_streams_dashboard.md +++ b/doc/user/analytics/value_streams_dashboard.md @@ -150,3 +150,4 @@ panels: | Number of deploys | Total number of deploys to production. | [Merge Request Analytics](https://gitlab.com/gitlab-org/gitlab/-/analytics/merge_request_analytics) | [Merge request analytics](merge_request_analytics.md) | `deploys` | | Critical vulnerabilities over time | Critical vulnerabilities over time in project or group | [Vulnerability report](https://gitlab.com/gitlab-org/gitlab/-/security/vulnerability_report) | [Vulnerability report](../application_security/vulnerability_report/index.md) | `vulnerability_critical` | | High vulnerabilities over time | High vulnerabilities over time in project or group | [Vulnerability report](https://gitlab.com/gitlab-org/gitlab/-/security/vulnerability_report) | [Vulnerability report](../application_security/vulnerability_report/index.md) | `vulnerability_high` | +| Merge request throughput | The number of merge requests merged by month. | [Merge Request Analytics](https://gitlab.com/gitlab-org/gitlab/-/analytics/merge_request_analytics) | [Merge request analytics](merge_request_analytics.md) | `merge_request_throughput` | diff --git a/lib/api/entities/project_scope_link.rb b/lib/api/entities/project_scope_link.rb new file mode 100644 index 00000000000..8a5466a0418 --- /dev/null +++ b/lib/api/entities/project_scope_link.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module API + module Entities + class ProjectScopeLink < Grape::Entity + expose :source_project_id, documentation: { type: 'integer' } + expose :target_project_id, documentation: { type: 'integer' } + end + end +end diff --git a/lib/api/markdown.rb b/lib/api/markdown.rb index f348e20cc0b..5ef60ab0b94 100644 --- a/lib/api/markdown.rb +++ b/lib/api/markdown.rb @@ -2,6 +2,11 @@ module API class Markdown < ::API::Base + include APIGuard + + # Although this API endpoint responds to POST requests, it is a read-only operation + allow_access_with_scope :read_api + before { authenticate! if Feature.enabled?(:authenticate_markdown_api, type: :ops) } feature_category :team_planning diff --git a/lib/api/project_job_token_scope.rb b/lib/api/project_job_token_scope.rb index a0fac590269..79710bffeaf 100644 --- a/lib/api/project_job_token_scope.rb +++ b/lib/api/project_job_token_scope.rb @@ -74,6 +74,46 @@ module API present paginate(inbound_projects), with: Entities::BasicProjectDetails end + desc 'Add target project to allowlist.' do + failure [ + { code: 400, message: 'Bad Request' }, + { code: 401, message: 'Unauthorized' }, + { code: 403, message: 'Forbidden' }, + { code: 404, message: 'Not found' }, + { code: 422, message: 'Unprocessable entity' } + ] + success status: 201, model: Entities::BasicProjectDetails + tags %w[projects_job_token_scope] + end + params do + requires :id, + allow_blank: false, + desc: 'ID of user project', + documentation: { example: 1 }, + type: Integer + + requires :target_project_id, + allow_blank: false, + desc: 'ID of target project', + documentation: { example: 2 }, + type: Integer + end + post ':id/job_token_scope/allowlist' do + authorize_admin_project + + target_project_id = declared_params(include_missing: false).fetch(:target_project_id) + target_project = Project.find_by_id(target_project_id) + break not_found!("target_project_id not found") if target_project.blank? + + result = ::Ci::JobTokenScope::AddProjectService + .new(user_project, current_user) + .execute(target_project, direction: :inbound) + + break bad_request!(result[:message]) if result.error? + + present result.payload[:project_link], with: Entities::ProjectScopeLink + end + desc 'Delete project from allowlist.' do failure [ { code: 400, message: 'Bad Request' }, @@ -84,11 +124,18 @@ module API success code: 204 tags %w[projects_job_token_scope] end - params do - requires :id, type: Integer, desc: 'ID of user project', documentation: { example: 1 } - requires :target_project_id, type: Integer, - desc: 'ID of the project to be removed from the allowlist', documentation: { example: 2 } + requires :id, + allow_blank: false, + desc: 'ID of user project', + documentation: { example: 1 }, + type: Integer + + requires :target_project_id, + allow_blank: false, + desc: 'ID of the project to be removed from the allowlist', + documentation: { example: 2 }, + type: Integer end delete ':id/job_token_scope/allowlist/:target_project_id' do target_project = find_project!(params[:target_project_id]) diff --git a/lib/gitlab/database_importers/common_metrics.rb b/lib/gitlab/database_importers/common_metrics.rb deleted file mode 100644 index f964ae8a275..00000000000 --- a/lib/gitlab/database_importers/common_metrics.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module DatabaseImporters - module CommonMetrics - end - end -end diff --git a/lib/gitlab/database_importers/common_metrics/importer.rb b/lib/gitlab/database_importers/common_metrics/importer.rb deleted file mode 100644 index 6c61e05674e..00000000000 --- a/lib/gitlab/database_importers/common_metrics/importer.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module DatabaseImporters - module CommonMetrics - class Importer - MissingQueryId = Class.new(StandardError) - - attr_reader :content - - def initialize(filename = 'common_metrics.yml') - @content = YAML.load_file(Rails.root.join('config', 'prometheus', filename)) - end - - def execute - CommonMetrics::PrometheusMetric.reset_column_information - - process_content do |id, attributes| - find_or_build_metric!(id) - .update!(**attributes) - end - end - - private - - def process_content(&blk) - content['panel_groups'].map do |group| - process_group(group, &blk) - end - end - - def process_group(group, &blk) - attributes = { - group: find_group_title_key(group['group']) - } - - group['panels'].map do |panel| - process_panel(panel, attributes, &blk) - end - end - - def process_panel(panel, attributes, &blk) - attributes = attributes.merge( - title: panel['title'], - y_label: panel['y_label']) - - panel['metrics'].map do |metric_details| - process_metric_details(metric_details, attributes, &blk) - end - end - - def process_metric_details(metric_details, attributes, &blk) - attributes = attributes.merge( - legend: metric_details['label'], - query: metric_details['query_range'], - unit: metric_details['unit']) - - yield(metric_details['id'], attributes) - end - - def find_or_build_metric!(id) - raise MissingQueryId unless id - - CommonMetrics::PrometheusMetric.common.find_by(identifier: id) || - CommonMetrics::PrometheusMetric.new(common: true, identifier: id) - end - - def find_group_title_key(title) - CommonMetrics::PrometheusMetricEnums.groups[find_group_title(title)] - end - - def find_group_title(title) - CommonMetrics::PrometheusMetricEnums.group_titles.invert[title] - end - end - end - end -end diff --git a/lib/gitlab/database_importers/common_metrics/prometheus_metric.rb b/lib/gitlab/database_importers/common_metrics/prometheus_metric.rb deleted file mode 100644 index b4a392cbea9..00000000000 --- a/lib/gitlab/database_importers/common_metrics/prometheus_metric.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module DatabaseImporters - module CommonMetrics - class PrometheusMetric < ApplicationRecord - enum group: PrometheusMetricEnums.groups - scope :common, -> { where(common: true) } - end - end - end -end diff --git a/lib/gitlab/database_importers/common_metrics/prometheus_metric_enums.rb b/lib/gitlab/database_importers/common_metrics/prometheus_metric_enums.rb deleted file mode 100644 index 8a5f53be20f..00000000000 --- a/lib/gitlab/database_importers/common_metrics/prometheus_metric_enums.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module DatabaseImporters - module CommonMetrics - module PrometheusMetricEnums - def self.groups - { - # built-in groups - nginx_ingress_vts: -1, - ha_proxy: -2, - aws_elb: -3, - nginx: -4, - kubernetes: -5, - nginx_ingress: -6, - - # custom groups - business: 0, - response: 1, - system: 2, - custom: 3, - - cluster_health: -100 - } - end - - def self.group_titles - { - business: _('Business metrics (Custom)'), - response: _('Response metrics (Custom)'), - system: _('System metrics (Custom)'), - nginx_ingress_vts: _('Response metrics (NGINX Ingress VTS)'), - nginx_ingress: _('Response metrics (NGINX Ingress)'), - ha_proxy: _('Response metrics (HA Proxy)'), - aws_elb: _('Response metrics (AWS ELB)'), - nginx: _('Response metrics (NGINX)'), - kubernetes: _('System metrics (Kubernetes)'), - cluster_health: _('Cluster Health'), - custom: _('Custom metrics') - } - end - end - end - end -end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 3258260f921..04f4852b9a2 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -13818,6 +13818,9 @@ msgstr "" msgid "DORA4Metrics|Median time an incident was open in a production environment over the given time period." msgstr "" +msgid "DORA4Metrics|Merge request throughput" +msgstr "" + msgid "DORA4Metrics|Metrics comparison for %{name} group" msgstr "" @@ -49721,6 +49724,9 @@ msgstr "" msgid "ValueStreamAnalytics|Tasks by type" msgstr "" +msgid "ValueStreamAnalytics|The number of merge requests merged by month." +msgstr "" + msgid "ValueStreamAnalytics|The time it takes an organization to recover from a failure in production." msgstr "" @@ -54461,9 +54467,6 @@ msgstr "" msgid "mrWidget|Remove from merge train" msgstr "" -msgid "mrWidget|Resolve all with new issue" -msgstr "" - msgid "mrWidget|Resolve conflicts" msgstr "" diff --git a/spec/db/development/import_common_metrics_spec.rb b/spec/db/development/import_common_metrics_spec.rb deleted file mode 100644 index 396eae9293e..00000000000 --- a/spec/db/development/import_common_metrics_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Import metrics on development seed' do - subject { load Rails.root.join('db', 'fixtures', 'development', '99_common_metrics.rb') } - - it "imports all prometheus metrics" do - expect(PrometheusMetric.common).to be_empty - - subject - - expect(PrometheusMetric.common).not_to be_empty - end -end diff --git a/spec/db/production/import_common_metrics_spec.rb b/spec/db/production/import_common_metrics_spec.rb deleted file mode 100644 index 1cc0c2fd77f..00000000000 --- a/spec/db/production/import_common_metrics_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Import metrics on production seed' do - subject { load Rails.root.join('db', 'fixtures', 'production', '999_common_metrics.rb') } - - it "imports all prometheus metrics" do - expect(PrometheusMetric.common).to be_empty - - subject - - expect(PrometheusMetric.common).not_to be_empty - end -end diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index 686654bda30..b5e08c65823 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -206,7 +206,6 @@ RSpec.describe 'Database schema', feature_category: :database do 'Clusters::Cluster' => %w[platform_type provider_type], 'CommitStatus' => %w[failure_reason], 'GenericCommitStatus' => %w[failure_reason], - 'Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetric' => %w[group], 'InternalId' => %w[usage], 'List' => %w[list_type], 'NotificationSetting' => %w[level], diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb index c982052fc0e..7f6a044a575 100644 --- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb @@ -20,7 +20,6 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j before do stub_feature_flags(moved_mr_sidebar: false) - stub_feature_flags(hide_create_issue_resolve_all: false) end describe 'as a user with access to the project' do @@ -45,7 +44,6 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j it 'hides the link for creating a new issue' do expect(page).not_to have_selector resolve_all_discussions_link_selector - expect(page).not_to have_content "Resolve all with new issue" end end @@ -67,6 +65,7 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j before do project.project_feature.update_attribute(:issues_access_level, ProjectFeature::DISABLED) visit project_merge_request_path(project, merge_request) + find('.discussions-counter .dropdown-toggle').click end it 'does not show a link to create a new issue' do @@ -82,22 +81,6 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j it 'shows a warning that the merge request contains unresolved threads' do expect(page).to have_content 'all threads must be resolved' end - - it 'has a link to resolve all threads by creating an issue' do - expect(page).to have_link 'Resolve all with new issue', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) - end - - context 'creating an issue for threads' do - before do - page.within '.mr-state-widget' do - page.click_link 'Resolve all with new issue', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) - - wait_for_all_requests - end - end - - it_behaves_like 'creating an issue for a thread' - end end end end diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb deleted file mode 100644 index 1b68f78e993..00000000000 --- a/spec/features/markdown/metrics_spec.rb +++ /dev/null @@ -1,244 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_store_caching, :sidekiq_inline, feature_category: :metrics do - include PrometheusHelpers - include KubernetesHelpers - include GrafanaApiHelpers - include MetricsDashboardUrlHelpers - - let_it_be(:user) { create(:user) } - let_it_be(:project) { create(:project, :with_prometheus_integration) } - let_it_be(:environment) { create(:environment, project: project) } - - let(:issue) { create(:issue, project: project, description: description) } - let(:description) { "See [metrics dashboard](#{metrics_url}) for info." } - let(:metrics_url) { urls.metrics_project_environment_url(project, environment) } - - before do - stub_feature_flags(remove_monitor_metrics: false) - clear_host_from_memoized_variables - stub_gitlab_domain - - project.add_developer(user) - sign_in(user) - end - - after do - clear_host_from_memoized_variables - end - - shared_examples_for 'metrics dashboard unavailable' do - context 'when metrics dashboard feature is unavailable' do - before do - stub_feature_flags(remove_monitor_metrics: true) - end - - it 'shows no embedded metrics' do - visit project_issue_path(project, issue) - - expect(page).to have_no_css('div.prometheus-graph') - end - end - end - - context 'internal metrics embeds' do - before do - import_common_metrics - stub_any_prometheus_request_with_response - - allow(Prometheus::ProxyService).to receive(:new).and_call_original - end - - include_examples 'metrics dashboard unavailable' - - it 'shows embedded metrics' do - visit project_issue_path(project, issue) - - expect(page).to have_css('div.prometheus-graph') - expect(page).to have_text('Memory Usage (Total)') - expect(page).to have_text('Core Usage (Total)') - - # Ensure that the FE is calling the BE with expected params - expect(Prometheus::ProxyService) - .to have_received(:new) - .with(environment, 'GET', 'query_range', hash_including('start', 'end', 'step')) - .at_least(:once) - end - - context 'with remove_monitor_metrics flag enabled' do - before do - stub_feature_flags(remove_monitor_metrics: true) - end - - it 'does not show embedded metrics' do - visit project_issue_path(project, issue) - - expect(page).not_to have_css('div.prometheus-graph') - expect(page).not_to have_text('Memory Usage (Total)') - expect(page).not_to have_text('Core Usage (Total)') - end - end - - context 'when dashboard params are in included the url' do - let(:metrics_url) { urls.metrics_project_environment_url(project, environment, **chart_params) } - - let(:chart_params) do - { - group: 'System metrics (Kubernetes)', - title: 'Memory Usage (Pod average)', - y_label: 'Memory Used per Pod (MB)' - } - end - - it 'shows embedded metrics for the specific chart' do - visit project_issue_path(project, issue) - - expect(page).to have_css('div.prometheus-graph') - expect(page).to have_text(chart_params[:title]) - expect(page).to have_text(chart_params[:y_label]) - - # Ensure that the FE is calling the BE with expected params - expect(Prometheus::ProxyService) - .to have_received(:new) - .with(environment, 'GET', 'query_range', hash_including('start', 'end', 'step')) - .at_least(:once) - end - - context 'when two dashboard urls are included' do - let(:chart_params_2) do - { - group: 'System metrics (Kubernetes)', - title: 'Core Usage (Total)', - y_label: 'Total Cores' - } - end - - let(:metrics_url_2) { urls.metrics_project_environment_url(project, environment, **chart_params_2) } - let(:description) { "See [metrics dashboard](#{metrics_url}) for info. \n See [metrics dashboard](#{metrics_url_2}) for info." } - let(:issue) { create(:issue, project: project, description: description) } - - it 'shows embedded metrics for both urls' do - visit project_issue_path(project, issue) - - expect(page).to have_css('div.prometheus-graph') - expect(page).to have_text(chart_params[:title]) - expect(page).to have_text(chart_params[:y_label]) - expect(page).to have_text(chart_params_2[:title]) - expect(page).to have_text(chart_params_2[:y_label]) - - # Ensure that the FE is calling the BE with expected params - expect(Prometheus::ProxyService) - .to have_received(:new) - .with(environment, 'GET', 'query_range', hash_including('start', 'end', 'step')) - .at_least(:once) - end - end - end - end - - context 'grafana metrics embeds' do - let(:grafana_integration) { create(:grafana_integration, project: project) } - let(:grafana_base_url) { grafana_integration.grafana_url } - let(:metrics_url) { valid_grafana_dashboard_link(grafana_base_url) } - - before do - stub_dashboard_request(grafana_base_url) - stub_datasource_request(grafana_base_url) - stub_all_grafana_proxy_requests(grafana_base_url) - - allow(Grafana::ProxyService).to receive(:new).and_call_original - end - - include_examples 'metrics dashboard unavailable' - - it 'shows embedded metrics', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/402973' do - visit project_issue_path(project, issue) - - expect(page).to have_css('div.prometheus-graph') - expect(page).to have_text('Expired / Evicted') - expect(page).to have_text('expired - test-attribute-value') - - # Ensure that the FE is calling the BE with expected params - expect(Grafana::ProxyService) - .to have_received(:new) - .with(project, anything, anything, hash_including('query', 'start', 'end', 'step')) - .at_least(:once) - end - end - - context 'transient metrics embeds' do - let(:metrics_url) { urls.metrics_dashboard_project_environment_url(project, environment, embed_json: embed_json) } - let(:title) { 'Important Metrics' } - let(:embed_json) do - { - panel_groups: [{ - panels: [{ - type: 'area-chart', - title: title, - y_label: 'metric', - metrics: [{ - query_range: 'metric * 0.5 < 1' - }] - }] - }] - }.to_json - end - - before do - stub_any_prometheus_request_with_response - end - - include_examples 'metrics dashboard unavailable' - - it 'shows embedded metrics' do - visit project_issue_path(project, issue) - - expect(page).to have_css('div.prometheus-graph') - expect(page).to have_text(title) - end - end - - context 'for GitLab embedded cluster health metrics' do - before do - project.add_maintainer(user) - import_common_metrics - stub_any_prometheus_request_with_response - - allow(Prometheus::ProxyService).to receive(:new).and_call_original - - create(:clusters_integrations_prometheus, cluster: cluster) - stub_kubeclient_discover(cluster.platform.api_url) - stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body) - stub_prometheus_request(%r{prometheus/api/v1}, body: prometheus_values_body) - end - - let_it_be(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [project], user: user) } - - let(:params) { [project.namespace.path, project.path, cluster.id] } - let(:query_params) { { group: 'Cluster Health', title: 'CPU Usage', y_label: 'CPU (cores)' } } - let(:metrics_url) { urls.namespace_project_cluster_url(*params, **query_params) } - let(:description) { "# Summary \n[](#{metrics_url})" } - - include_examples 'metrics dashboard unavailable' - - it 'shows embedded metrics' do - visit project_issue_path(project, issue) - - expect(page).to have_css('div.prometheus-graph') - expect(page).to have_text(query_params[:title]) - expect(page).to have_text(query_params[:y_label]) - expect(page).not_to have_text(metrics_url) - - expect(Prometheus::ProxyService) - .to have_received(:new) - .with(cluster, 'GET', 'query_range', hash_including('start', 'end', 'step')) - .at_least(:once) - end - end - - def import_common_metrics - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end -end diff --git a/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js b/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js index 25a19b5808b..00fa0a8ae56 100644 --- a/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js +++ b/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js @@ -16,7 +16,12 @@ describe('Sidebar participant component', () => { const findAvatar = () => wrapper.findComponent(GlAvatarLabeled); const findIcon = () => wrapper.findComponent(GlIcon); - const createComponent = ({ status = null, issuableType = TYPE_ISSUE, canMerge = false } = {}) => { + const createComponent = ({ + status = null, + issuableType = TYPE_ISSUE, + canMerge = false, + selected = false, + } = {}) => { wrapper = shallowMount(SidebarParticipant, { propsData: { user: { @@ -25,6 +30,7 @@ describe('Sidebar participant component', () => { status, }, issuableType, + selected, }, stubs: { GlAvatarLabeled, @@ -52,13 +58,27 @@ describe('Sidebar participant component', () => { }); describe('when on merge request sidebar', () => { - it('when project member cannot merge', () => { - createComponent({ issuableType: TYPE_MERGE_REQUEST }); + describe('when project member cannot merge', () => { + it('renders a `cannot-merge` icon', () => { + createComponent({ issuableType: TYPE_MERGE_REQUEST }); - expect(findIcon().exists()).toBe(true); + expect(findIcon().exists()).toBe(true); + }); + + it('does not apply `gl-left-6!` class to an icon if participant is not selected', () => { + createComponent({ issuableType: TYPE_MERGE_REQUEST, canMerge: false }); + + expect(findIcon().classes('gl-left-6!')).toBe(false); + }); + + it('applies `gl-left-6!` class to an icon if participant is selected', () => { + createComponent({ issuableType: TYPE_MERGE_REQUEST, canMerge: false, selected: true }); + + expect(findIcon().classes('gl-left-6!')).toBe(true); + }); }); - it('when project member can merge', () => { + it('does not render an icon when project member can merge', () => { createComponent({ issuableType: TYPE_MERGE_REQUEST, canMerge: true }); expect(findIcon().exists()).toBe(false); diff --git a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_unresolved_discussions_spec.js b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_unresolved_discussions_spec.js index 19825318a4f..d36ad4983c6 100644 --- a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_unresolved_discussions_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_unresolved_discussions_spec.js @@ -4,19 +4,12 @@ import { removeBreakLine } from 'helpers/text_helper'; import notesEventHub from '~/notes/event_hub'; import UnresolvedDiscussions from '~/vue_merge_request_widget/components/states/unresolved_discussions.vue'; -function createComponent({ path = '', propsData = {}, provide = {} } = {}) { +function createComponent({ path = '' } = {}) { return mount(UnresolvedDiscussions, { propsData: { mr: { createIssueToResolveDiscussionsPath: path, }, - ...propsData, - }, - provide: { - glFeatures: { - hideCreateIssueResolveAll: false, - }, - ...provide, }, }); } @@ -46,11 +39,7 @@ describe('UnresolvedDiscussions', () => { expect(text).toContain('Merge blocked:'); expect(text).toContain('all threads must be resolved.'); - expect(wrapper.element.innerText).toContain('Resolve all with new issue'); expect(wrapper.element.innerText).toContain('Go to first unresolved thread'); - expect(wrapper.element.querySelector('.js-create-issue').getAttribute('href')).toEqual( - TEST_HOST, - ); }); }); @@ -60,26 +49,7 @@ describe('UnresolvedDiscussions', () => { expect(text).toContain('Merge blocked:'); expect(text).toContain('all threads must be resolved.'); - expect(wrapper.element.innerText).not.toContain('Resolve all with new issue'); expect(wrapper.element.innerText).toContain('Go to first unresolved thread'); - expect(wrapper.element.querySelector('.js-create-issue')).toEqual(null); - }); - }); - - describe('when `hideCreateIssueResolveAll` is enabled', () => { - beforeEach(() => { - wrapper = createComponent({ - path: TEST_HOST, - provide: { - glFeatures: { - hideCreateIssueResolveAll: true, - }, - }, - }); - }); - - it('do not show jump to first button', () => { - expect(wrapper.text()).not.toContain('Create issue to resolve all threads'); }); }); }); diff --git a/spec/initializers/net_http_patch_spec.rb b/spec/initializers/net_http_patch_spec.rb index 82f896e1fa7..b9f5299b58c 100644 --- a/spec/initializers/net_http_patch_spec.rb +++ b/spec/initializers/net_http_patch_spec.rb @@ -11,7 +11,7 @@ RSpec.describe 'Net::HTTP patch proxy user and password encoding' do before do # This file can be removed once Ruby 3.0 is no longer supported: # https://gitlab.com/gitlab-org/gitlab/-/issues/396223 - skip if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(3.1) + skip if Gem::Version.new(Net::HTTP::VERSION) >= Gem::Version.new('0.2.0') end describe '#proxy_user' do diff --git a/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb b/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb deleted file mode 100644 index 1150de880b5..00000000000 --- a/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb +++ /dev/null @@ -1,122 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::DatabaseImporters::CommonMetrics::Importer do - subject { described_class.new } - - context "does import common_metrics.yml" do - let(:groups) { subject.content['panel_groups'] } - let(:panels) { groups.flat_map { |group| group['panels'] } } - let(:metrics) { panels.flat_map { |group| group['metrics'] } } - let(:metric_ids) { metrics.map { |metric| metric['id'] } } - - before do - subject.execute - end - - it "has the same amount of groups" do - expect(PrometheusMetric.common.group(:group).count.count).to eq(groups.count) - end - - it "has the same amount of panels" do - expect(PrometheusMetric.common.group(:group, :title).count.count).to eq(panels.count) - end - - it "has the same amount of metrics" do - expect(PrometheusMetric.common.count).to eq(metrics.count) - end - - it "does not have duplicate IDs" do - expect(metric_ids).to eq(metric_ids.uniq) - end - - it "imports all IDs" do - expect(PrometheusMetric.common.pluck(:identifier)).to contain_exactly(*metric_ids) - end - end - - context "does import common_metrics.yml" do - it "when executed from outside of the Rails.root" do - Dir.chdir(Dir.tmpdir) do - expect { subject.execute }.not_to raise_error - end - - expect(PrometheusMetric.common).not_to be_empty - end - end - - context 'does import properly all fields' do - let(:query_identifier) { 'response-metric' } - let(:dashboard) do - { - panel_groups: [{ - group: 'Response metrics (NGINX Ingress)', - panels: [{ - title: "Throughput", - y_label: "Requests / Sec", - metrics: [{ - id: query_identifier, - query_range: 'my-query', - unit: 'my-unit', - label: 'status code' - }] - }] - }] - } - end - - before do - expect(subject).to receive(:content) { dashboard.deep_stringify_keys } - end - - shared_examples 'stores metric' do - let(:metric) { PrometheusMetric.find_by(identifier: query_identifier) } - - it 'with all data' do - expect(metric.group).to eq('nginx_ingress') - expect(metric.title).to eq('Throughput') - expect(metric.y_label).to eq('Requests / Sec') - expect(metric.unit).to eq('my-unit') - expect(metric.legend).to eq('status code') - expect(metric.query).to eq('my-query') - end - end - - context 'if ID is missing' do - let(:query_identifier) {} - - it 'raises exception' do - expect { subject.execute }.to raise_error(Gitlab::DatabaseImporters::CommonMetrics::Importer::MissingQueryId) - end - end - - context 'for existing common metric with different ID' do - let!(:existing_metric) { create(:prometheus_metric, :common, identifier: 'my-existing-metric') } - - before do - subject.execute - end - - it_behaves_like 'stores metric' do - it 'and existing metric is not changed' do - expect(metric).not_to eq(existing_metric) - end - end - end - - context 'when metric with ID exists ' do - let!(:existing_metric) { create(:prometheus_metric, :common, identifier: 'response-metric') } - - before do - subject.execute - end - - it_behaves_like 'stores metric' do - it 'and existing metric is changed' do - expect(metric).to eq(existing_metric) - end - end - end - end -end diff --git a/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb b/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb deleted file mode 100644 index 98a8e144d16..00000000000 --- a/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetric do - it 'group enum equals ::PrometheusMetric' do - expect(described_class.groups).to eq(::PrometheusMetric.groups) - end - - it '.group_titles equals ::PrometheusMetric' do - existing_group_titles = Enums::PrometheusMetric.group_details.transform_values do |value| - value[:group_title] - end - expect(Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetricEnums.group_titles).to eq(existing_group_titles) - end -end diff --git a/spec/requests/api/markdown_spec.rb b/spec/requests/api/markdown_spec.rb index db5bbd610fc..8298d0bf150 100644 --- a/spec/requests/api/markdown_spec.rb +++ b/spec/requests/api/markdown_spec.rb @@ -5,13 +5,18 @@ require "spec_helper" RSpec.describe API::Markdown, feature_category: :team_planning do describe "POST /markdown" do let(:user) {} # No-op. It gets overwritten in the contexts below. + let(:token) {} # No-op. It gets overwritten in the contexts below. let(:disable_authenticate_markdown_api) { false } before do stub_commonmark_sourcepos_disabled stub_feature_flags(authenticate_markdown_api: false) if disable_authenticate_markdown_api - post api("/markdown", user), params: params + if token + post api("/markdown", personal_access_token: token), params: params + else + post api("/markdown", user), params: params + end end shared_examples "rendered markdown text without GFM" do @@ -85,6 +90,13 @@ RSpec.describe API::Markdown, feature_category: :team_planning do let(:issue_url) { "http://#{Gitlab.config.gitlab.host}/#{issue.project.namespace.path}/#{issue.project.path}/-/issues/#{issue.iid}" } let(:text) { ":tada: Hello world! :100: #{issue.to_reference}" } + context "when personal access token has only read_api scope" do + let(:token) { create(:personal_access_token, user: user, scopes: [:read_api]) } + let(:params) { { text: text } } + + it_behaves_like "rendered markdown text without GFM" + end + context "when not using gfm" do context "without project" do let(:params) { { text: text } } diff --git a/spec/requests/api/project_job_token_scope_spec.rb b/spec/requests/api/project_job_token_scope_spec.rb index b7ee1fe774f..06e28d57ca6 100644 --- a/spec/requests/api/project_job_token_scope_spec.rb +++ b/spec/requests/api/project_job_token_scope_spec.rb @@ -264,6 +264,132 @@ RSpec.describe API::ProjectJobTokenScope, feature_category: :secrets_management end end + describe "POST /projects/:id/job_token_scope/allowlist" do + let_it_be(:project) { create(:project, :public) } + let_it_be(:project_inbound_allowed) { create(:project, :public) } + let_it_be(:user) { create(:user) } + + let(:post_job_token_scope_allowlist_path) { "/projects/#{project.id}/job_token_scope/allowlist" } + + let(:post_job_token_scope_allowlist_params) do + { target_project_id: project_inbound_allowed.id } + end + + subject do + post api(post_job_token_scope_allowlist_path, user), params: post_job_token_scope_allowlist_params + end + + context 'when unauthenticated user (missing user)' do + context 'for public project' do + it 'does not return ci cd settings of job token' do + project.update!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) + + post api(post_job_token_scope_allowlist_path) + + expect(response).to have_gitlab_http_status(:unauthorized) + end + end + end + + context 'when authenticated user as maintainer' do + before_all { project.add_maintainer(user) } + + it 'returns unauthorized and blank response when invalid auth credentials are given' do + invalid_personal_access_token = build(:personal_access_token, user: user) + + post api(post_job_token_scope_allowlist_path, user, personal_access_token: invalid_personal_access_token), + params: post_job_token_scope_allowlist_params + + expect(response).to have_gitlab_http_status(:unauthorized) + end + + it 'returns created and creates job token scope link' do + subject + + expect(response).to have_gitlab_http_status(:created) + expect(json_response).to be_present + expect(json_response).to include( + "target_project_id" => project_inbound_allowed.id, + "source_project_id" => project.id + ) + expect(json_response).not_to include "id", "direction" + end + + it 'returns bad_request and does not create an additional job token scope link' do + create( + :ci_job_token_project_scope_link, + source_project: project, + target_project: project_inbound_allowed, + direction: :inbound + ) + + subject + + expect(response).to have_gitlab_http_status(:bad_request) + end + + it 'returns bad_request when adding the source project' do + post api(post_job_token_scope_allowlist_path, user), params: { target_project_id: project.id } + + expect(response).to have_gitlab_http_status(:bad_request) + end + + it 'returns not_found when project for param `project_id` does not exist' do + post api(post_job_token_scope_allowlist_path, user), params: { target_project_id: non_existing_record_id } + + expect(response).to have_gitlab_http_status(:not_found) + end + + it 'returns :bad_request when parameter `project_id` missing' do + post api(post_job_token_scope_allowlist_path, user), params: {} + + expect(response).to have_gitlab_http_status(:bad_request) + end + + it 'returns :bad_request when parameter `project_id` is nil value' do + post api(post_job_token_scope_allowlist_path, user), params: { target_project_id: nil } + + expect(response).to have_gitlab_http_status(:bad_request) + end + + it 'returns :bad_request when parameter `project_id` is empty value' do + post api(post_job_token_scope_allowlist_path, user), params: { target_project_id: '' } + + expect(response).to have_gitlab_http_status(:bad_request) + end + + it 'returns :bad_request when parameter `project_id` is float value' do + post api(post_job_token_scope_allowlist_path, user), params: { target_project_id: 12.34 } + + expect(response).to have_gitlab_http_status(:bad_request) + end + end + + context 'when authenticated user as developer' do + before_all { project.add_developer(user) } + + context 'for private project' do + it 'returns forbidden and no ci cd settings' do + project.update!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) + + subject + + expect(response).to have_gitlab_http_status(:forbidden) + end + end + + context 'for public project' do + it 'returns forbidden and no ci cd settings' do + project.update!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) + + subject + + expect(response).to have_gitlab_http_status(:forbidden) + end + end + end + end + describe 'DELETE /projects/:id/job_token_scope/allowlist/:target_project_id' do let_it_be(:project) { create(:project, :public) } let_it_be(:target_project) { create(:project, :public) } diff --git a/spec/requests/well_known_routing_spec.rb b/spec/requests/well_known_routing_spec.rb new file mode 100644 index 00000000000..d4e77a06953 --- /dev/null +++ b/spec/requests/well_known_routing_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'well-known URLs', feature_category: :system_access do + describe '/.well-known/change-password' do + it 'redirects to edit profile password path' do + get('/.well-known/change-password') + + expect(response).to redirect_to(edit_profile_password_path) + end + end +end diff --git a/spec/views/dashboard/projects/index.html.haml_spec.rb b/spec/views/dashboard/projects/index.html.haml_spec.rb index 72b5901d5e5..08e88e4bdcf 100644 --- a/spec/views/dashboard/projects/index.html.haml_spec.rb +++ b/spec/views/dashboard/projects/index.html.haml_spec.rb @@ -8,7 +8,6 @@ RSpec.describe 'dashboard/projects/index.html.haml' do before do allow(view).to receive(:limited_counter_with_delimiter) allow(view).to receive(:current_user).and_return(user) - allow(view).to receive(:project_list_cache_key) allow(view).to receive(:time_ago_with_tooltip) allow(view).to receive(:project_icon) assign(:projects, [build(:project, name: 'awesome stuff')]) diff --git a/spec/views/shared/projects/_list.html.haml_spec.rb b/spec/views/shared/projects/_list.html.haml_spec.rb index b7b4f97f2b6..1b6c4e00c97 100644 --- a/spec/views/shared/projects/_list.html.haml_spec.rb +++ b/spec/views/shared/projects/_list.html.haml_spec.rb @@ -7,7 +7,6 @@ RSpec.describe 'shared/projects/_list' do before do allow(view).to receive(:projects).and_return(projects) - allow(view).to receive(:project_list_cache_key).and_return('fake_cache_key') end context 'with projects' do diff --git a/workhorse/gitaly_integration_test.go b/workhorse/gitaly_integration_test.go index a21c31aea49..a7ec0b63b9d 100644 --- a/workhorse/gitaly_integration_test.go +++ b/workhorse/gitaly_integration_test.go @@ -18,8 +18,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/gitaly_test.go b/workhorse/gitaly_test.go index de896475a99..6bbc67228c3 100644 --- a/workhorse/gitaly_test.go +++ b/workhorse/gitaly_test.go @@ -23,7 +23,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/git" diff --git a/workhorse/go.mod b/workhorse/go.mod index 19d1971bb8e..a0212b028d6 100644 --- a/workhorse/go.mod +++ b/workhorse/go.mod @@ -26,12 +26,12 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/smartystreets/goconvey v1.7.2 github.com/stretchr/testify v1.8.3 - gitlab.com/gitlab-org/gitaly/v15 v15.11.1 + gitlab.com/gitlab-org/gitaly/v16 v16.0.1 gitlab.com/gitlab-org/labkit v1.18.0 gocloud.dev v0.29.0 golang.org/x/image v0.7.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/net v0.8.0 + golang.org/x/net v0.9.0 golang.org/x/oauth2 v0.5.0 golang.org/x/tools v0.6.0 google.golang.org/grpc v1.54.0 @@ -58,7 +58,7 @@ require ( github.com/DataDog/datadog-go v4.4.0+incompatible // indirect github.com/DataDog/sketches-go v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.0 // indirect - github.com/beevik/ntp v0.3.0 // indirect + github.com/beevik/ntp v0.3.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect @@ -112,8 +112,8 @@ require ( golang.org/x/crypto v0.7.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/mod v0.8.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/sync v0.2.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/workhorse/go.sum b/workhorse/go.sum index c09b3a4d384..29e10f25e1f 100644 --- a/workhorse/go.sum +++ b/workhorse/go.sum @@ -617,8 +617,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiO github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/beevik/ntp v0.3.0 h1:xzVrPrE4ziasFXgBVBZJDP0Wg/KpMwk2KHJ4Ba8GrDw= -github.com/beevik/ntp v0.3.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= +github.com/beevik/ntp v0.3.2 h1:tWwrPRUDbURCK/Voh3Daxl2c60mOiA1z+bOqm4j/aSY= +github.com/beevik/ntp v0.3.2/go.mod h1:hg8DSzEy+KlFOOmR19XMea1MsLaA6vojqM04e2IhuUo= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -1501,7 +1501,7 @@ github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJys github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/miekg/dns v1.1.48/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= -github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= +github.com/miekg/dns v1.1.54 h1:5jon9mWcb0sFJGpnI99tOMhCPyJ+RPVz5b63MQG0VWI= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= @@ -1932,8 +1932,8 @@ github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -gitlab.com/gitlab-org/gitaly/v15 v15.11.1 h1:tVQ6DDeEtz/hoOck52BEzhcZ1jwL2PwaiqJcIhZ3l1U= -gitlab.com/gitlab-org/gitaly/v15 v15.11.1/go.mod h1:9iVjU+Rr+6pBkX7uHrocEubpjN4k7LrwD9ezvzSrN+Y= +gitlab.com/gitlab-org/gitaly/v16 v16.0.1 h1:DAaj2MUrOANGmrEA21vuORKm8C+VGzS1NZxHFLhWF3s= +gitlab.com/gitlab-org/gitaly/v16 v16.0.1/go.mod h1:GDDfuCzp8ewfG+cPaYJa6czKluTQhsZyEr5WAtaqbbk= gitlab.com/gitlab-org/labkit v1.18.0 h1:uYCIqDt/5V1hLIecTR4UNc1sD2+xiYplyKeyfpNN26A= gitlab.com/gitlab-org/labkit v1.18.0/go.mod h1:nlLJvKgXcIclqWMI+rga2TckNBVHOtRCHMxBoVByNoE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -2105,7 +2105,7 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= @@ -2235,8 +2235,8 @@ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmL golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2287,8 +2287,9 @@ golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2444,8 +2445,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/workhorse/internal/api/api.go b/workhorse/internal/api/api.go index 8a7fb191ec4..4b36c9ddcbb 100644 --- a/workhorse/internal/api/api.go +++ b/workhorse/internal/api/api.go @@ -14,7 +14,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/config" "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper" diff --git a/workhorse/internal/git/archive.go b/workhorse/internal/git/archive.go index 3361a8bed44..acccd937038 100644 --- a/workhorse/internal/git/archive.go +++ b/workhorse/internal/git/archive.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/archive_test.go b/workhorse/internal/git/archive_test.go index 4348f5fe6f5..4942f5548f8 100644 --- a/workhorse/internal/git/archive_test.go +++ b/workhorse/internal/git/archive_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/testhelper" diff --git a/workhorse/internal/git/blob.go b/workhorse/internal/git/blob.go index 06b0eb08228..a7b2b0ca332 100644 --- a/workhorse/internal/git/blob.go +++ b/workhorse/internal/git/blob.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/diff.go b/workhorse/internal/git/diff.go index d450d1b9034..ced3cc4a51e 100644 --- a/workhorse/internal/git/diff.go +++ b/workhorse/internal/git/diff.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/error.go b/workhorse/internal/git/error.go index e073df19fff..311c76a01d0 100644 --- a/workhorse/internal/git/error.go +++ b/workhorse/internal/git/error.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "google.golang.org/grpc/status" "gitlab.com/gitlab-org/gitlab/workhorse/internal/log" diff --git a/workhorse/internal/git/error_test.go b/workhorse/internal/git/error_test.go index 11c9baa7d08..af39522c20d 100644 --- a/workhorse/internal/git/error_test.go +++ b/workhorse/internal/git/error_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" diff --git a/workhorse/internal/git/format-patch.go b/workhorse/internal/git/format-patch.go index a4306474aa5..6c15845f2d1 100644 --- a/workhorse/internal/git/format-patch.go +++ b/workhorse/internal/git/format-patch.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/info-refs_test.go b/workhorse/internal/git/info-refs_test.go index 6f45caed01e..57ed3c50111 100644 --- a/workhorse/internal/git/info-refs_test.go +++ b/workhorse/internal/git/info-refs_test.go @@ -8,7 +8,7 @@ import ( grpccodes "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" ) diff --git a/workhorse/internal/git/snapshot.go b/workhorse/internal/git/snapshot.go index 777ecd144a8..168f3641dcb 100644 --- a/workhorse/internal/git/snapshot.go +++ b/workhorse/internal/git/snapshot.go @@ -5,7 +5,7 @@ import ( "io" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/upload-pack_test.go b/workhorse/internal/git/upload-pack_test.go index efe7977acc0..359262542f1 100644 --- a/workhorse/internal/git/upload-pack_test.go +++ b/workhorse/internal/git/upload-pack_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" - "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/testhelper" diff --git a/workhorse/internal/gitaly/blob.go b/workhorse/internal/gitaly/blob.go index 0a47b2da5ff..c84c1731300 100644 --- a/workhorse/internal/gitaly/blob.go +++ b/workhorse/internal/gitaly/blob.go @@ -7,8 +7,8 @@ import ( "net/http" "strconv" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) type BlobClient struct { diff --git a/workhorse/internal/gitaly/diff.go b/workhorse/internal/gitaly/diff.go index cd63dbcbd13..a8f427231bb 100644 --- a/workhorse/internal/gitaly/diff.go +++ b/workhorse/internal/gitaly/diff.go @@ -6,8 +6,8 @@ import ( "io" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) type DiffClient struct { diff --git a/workhorse/internal/gitaly/gitaly.go b/workhorse/internal/gitaly/gitaly.go index eace87dda36..d9dbbdbb605 100644 --- a/workhorse/internal/gitaly/gitaly.go +++ b/workhorse/internal/gitaly/gitaly.go @@ -15,9 +15,9 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" - gitalyauth "gitlab.com/gitlab-org/gitaly/v15/auth" - gitalyclient "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + gitalyauth "gitlab.com/gitlab-org/gitaly/v16/auth" + gitalyclient "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" diff --git a/workhorse/internal/gitaly/namespace.go b/workhorse/internal/gitaly/namespace.go index 1e6cb079ee0..a9bc2d07a7e 100644 --- a/workhorse/internal/gitaly/namespace.go +++ b/workhorse/internal/gitaly/namespace.go @@ -1,6 +1,6 @@ package gitaly -import "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" +import "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" // NamespaceClient encapsulates NamespaceService calls type NamespaceClient struct { diff --git a/workhorse/internal/gitaly/repository.go b/workhorse/internal/gitaly/repository.go index cd5ae463a19..ad7ef869316 100644 --- a/workhorse/internal/gitaly/repository.go +++ b/workhorse/internal/gitaly/repository.go @@ -5,8 +5,8 @@ import ( "fmt" "io" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) // RepositoryClient encapsulates RepositoryService calls diff --git a/workhorse/internal/gitaly/smarthttp.go b/workhorse/internal/gitaly/smarthttp.go index 06ed215f4ec..e0ddf5ae4eb 100644 --- a/workhorse/internal/gitaly/smarthttp.go +++ b/workhorse/internal/gitaly/smarthttp.go @@ -5,9 +5,9 @@ import ( "fmt" "io" - gitalyclient "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + gitalyclient "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) type SmartHTTPClient struct { diff --git a/workhorse/internal/gitaly/unmarshal_test.go b/workhorse/internal/gitaly/unmarshal_test.go index 2e59fe973bf..39e3a3f2502 100644 --- a/workhorse/internal/gitaly/unmarshal_test.go +++ b/workhorse/internal/gitaly/unmarshal_test.go @@ -5,7 +5,7 @@ import ( "github.com/golang/protobuf/proto" //lint:ignore SA1019 https://gitlab.com/gitlab-org/gitlab/-/issues/324868 "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" ) func TestUnmarshalJSON(t *testing.T) { diff --git a/workhorse/internal/testhelper/gitaly.go b/workhorse/internal/testhelper/gitaly.go index 55fbcf2db2d..b468f0941de 100644 --- a/workhorse/internal/testhelper/gitaly.go +++ b/workhorse/internal/testhelper/gitaly.go @@ -19,8 +19,8 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/labkit/log" ) diff --git a/workhorse/main_test.go b/workhorse/main_test.go index 382fb16a16c..05834ab5d64 100644 --- a/workhorse/main_test.go +++ b/workhorse/main_test.go @@ -22,7 +22,7 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/labkit/log" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" |