Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-10-18 06:10:44 +00:00
parent c3df0504a2
commit ccf350cb4c
19 changed files with 138 additions and 104 deletions

View File

@ -1106,15 +1106,6 @@ Layout/ArgumentAlignment:
- 'ee/spec/requests/api/graphql/mutations/security_policy/assign_security_policy_project_spec.rb'
- 'ee/spec/requests/api/graphql/mutations/security_policy/create_security_policy_project_spec.rb'
- 'ee/spec/requests/api/graphql/mutations/security_policy/unassign_security_policy_project_spec.rb'
- 'ee/spec/requests/api/graphql/project/branch_rules/approval_project_rules_spec.rb'
- 'ee/spec/requests/api/graphql/project/dast_profile_schedule_spec.rb'
- 'ee/spec/requests/api/graphql/project/environments_spec.rb'
- 'ee/spec/requests/api/graphql/project/pipeline/code_quality_report_summary_spec.rb'
- 'ee/spec/requests/api/graphql/project/pipeline/dast_profile_spec.rb'
- 'ee/spec/requests/api/graphql/project/pipeline/security_report_finding_spec.rb'
- 'ee/spec/requests/api/graphql/project/pipeline/security_report_findings_spec.rb'
- 'ee/spec/requests/api/graphql/project/pipeline/security_report_summary_spec.rb'
- 'ee/spec/requests/api/graphql/project/pipelines/dast_profile_spec.rb'
- 'ee/spec/requests/api/group_boards_spec.rb'
- 'ee/spec/requests/api/group_clusters_spec.rb'
- 'ee/spec/requests/api/group_push_rule_spec.rb'
@ -1688,17 +1679,6 @@ Layout/ArgumentAlignment:
- 'spec/requests/api/graphql/mutations/todos/restore_many_spec.rb'
- 'spec/requests/api/graphql/mutations/todos/restore_spec.rb'
- 'spec/requests/api/graphql/packages/conan_spec.rb'
- 'spec/requests/api/graphql/project/error_tracking/sentry_errors_request_spec.rb'
- 'spec/requests/api/graphql/project/issue/design_collection/version_spec.rb'
- 'spec/requests/api/graphql/project/merge_request/pipelines_spec.rb'
- 'spec/requests/api/graphql/project/merge_request_spec.rb'
- 'spec/requests/api/graphql/project/merge_requests_spec.rb'
- 'spec/requests/api/graphql/project/milestones_spec.rb'
- 'spec/requests/api/graphql/project/pipeline_spec.rb'
- 'spec/requests/api/graphql/project/project_members_spec.rb'
- 'spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb'
- 'spec/requests/api/graphql/project/project_statistics_spec.rb'
- 'spec/requests/api/graphql/project/terraform/states_spec.rb'
- 'spec/requests/api/graphql/tasks/task_completion_status_spec.rb'
- 'spec/requests/api/graphql/user_query_spec.rb'
- 'spec/requests/api/group_clusters_spec.rb'

View File

@ -34,7 +34,7 @@ export default {
return this.schedule.userPermissions.playPipelineSchedule;
},
isCurrentUserOwner() {
return this.schedule.owner.username === this.currentUser.username;
return this.schedule.owner?.username === this.currentUser.username;
},
canTakeOwnership() {
return !this.isCurrentUserOwner && this.schedule.userPermissions.adminPipelineSchedule;

View File

@ -17,7 +17,7 @@ module Types
field :description, GraphQL::Types::String, null: true, description: 'Description of the pipeline schedule.'
field :owner, ::Types::UserType, null: false, description: 'Owner of the pipeline schedule.'
field :owner, ::Types::UserType, null: true, description: 'Owner of the pipeline schedule.'
field :active, GraphQL::Types::Boolean, null: false, description: 'Indicates if the pipeline schedule is active.'

View File

@ -18,6 +18,9 @@ module Types
field :iid, GraphQL::Types::String, null: false,
description: 'Internal ID of the pipeline.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the pipeline.'
field :sha, GraphQL::Types::String, null: true,
method: :sha,
description: "SHA of the pipeline's commit." do

View File

@ -22045,6 +22045,7 @@ Represents a file or directory in the project repository that has been locked.
| <a id="pipelineiid"></a>`iid` | [`String!`](#string) | Internal ID of the pipeline. |
| <a id="pipelinejobartifacts"></a>`jobArtifacts` | [`[CiJobArtifact!]`](#cijobartifact) | Job artifacts of the pipeline. |
| <a id="pipelinemergerequesteventtype"></a>`mergeRequestEventType` | [`PipelineMergeRequestEventType`](#pipelinemergerequesteventtype) | Event type of the pipeline associated with a merge request. |
| <a id="pipelinename"></a>`name` | [`String`](#string) | Name of the pipeline. |
| <a id="pipelinepath"></a>`path` | [`String`](#string) | Relative path to the pipeline's page. |
| <a id="pipelineproject"></a>`project` | [`Project`](#project) | Project the pipeline belongs to. |
| <a id="pipelinequeuedduration"></a>`queuedDuration` | [`Duration`](#duration) | How long the pipeline was queued before starting. |
@ -22247,7 +22248,7 @@ Represents a pipeline schedule.
| <a id="pipelinescheduleid"></a>`id` | [`ID!`](#id) | ID of the pipeline schedule. |
| <a id="pipelineschedulelastpipeline"></a>`lastPipeline` | [`Pipeline`](#pipeline) | Last pipeline object. |
| <a id="pipelineschedulenextrunat"></a>`nextRunAt` | [`Time!`](#time) | Time when the next pipeline will run. |
| <a id="pipelinescheduleowner"></a>`owner` | [`UserCore!`](#usercore) | Owner of the pipeline schedule. |
| <a id="pipelinescheduleowner"></a>`owner` | [`UserCore`](#usercore) | Owner of the pipeline schedule. |
| <a id="pipelinescheduleproject"></a>`project` | [`Project`](#project) | Project of the pipeline schedule. |
| <a id="pipelineschedulerealnextrun"></a>`realNextRun` | [`Time!`](#time) | Time when the next pipeline will run. |
| <a id="pipelinescheduleref"></a>`ref` | [`String`](#string) | Ref of the pipeline schedule. |

View File

@ -8,7 +8,22 @@ info: To determine the technical writer assigned to the Stage/Group associated w
This page contains a list of common issues you might encounter when working with Jira integrations.
## GitLab cannot comment on a Jira issue
## Jira issue integration
When working with the [Jira issue integration](configure.md), you might encounter the following issues.
### GitLab cannot link to a Jira issue
When you mention a Jira issue ID in GitLab, the issue link might be missing.
[`sidekiq.log`](../../administration/logs/index.md#sidekiq-logs) might contain the following exception:
```plaintext
No Link Issue Permission for issue 'JIRA-1234'
```
To resolve this issue, ensure the Jira user you created for the [Jira issue integration](configure.md) has permission to link issues.
### GitLab cannot comment on a Jira issue
If GitLab cannot comment on a Jira issue, ensure the Jira user you created for the [Jira issue integration](configure.md) has permission to:
@ -38,7 +53,7 @@ In the following example, Jira responds with a `404` because the Jira issue `ALP
}
```
## GitLab cannot close a Jira issue
### GitLab cannot close a Jira issue
If GitLab cannot close a Jira issue:
@ -49,9 +64,9 @@ If GitLab cannot close a Jira issue:
- Check the Jira issue resolution field is not set.
- Check the issue is not struck through in Jira lists.
## CAPTCHA
### CAPTCHA after failed sign-in attempts
CAPTCHA might be triggered after several consecutive failed login attempts,
CAPTCHA might be triggered after several consecutive failed sign-in attempts,
which might lead to a `401 unauthorized` error when testing your Jira integration.
If CAPTCHA has been triggered, you can't use the Jira REST API to
authenticate with the Jira site.
@ -59,18 +74,18 @@ authenticate with the Jira site.
To fix this error, sign in to your Jira instance
and complete the CAPTCHA.
## Jira integration does not work for imported project
### Integration does not work for an imported project
There is a [known bug](https://gitlab.com/gitlab-org/gitlab/-/issues/341571)
where the Jira integration sometimes does not work for a project that has been imported.
As a workaround, disable the integration and then re-enable it.
## Bulk change all Jira integrations to Jira instance-level or group-level values
### Change all Jira projects to instance-level or group-level values
WARNING:
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
### Change all projects instance wide
#### Change all projects instance wide
To change all Jira projects to use instance-level integration settings:
@ -101,7 +116,7 @@ To change all Jira projects to use instance-level integration settings:
1. Modify and save the instance-level integration from the UI to propagate the changes to all group-level and project-level integrations.
### Change all projects in a group
#### Change all projects in a group
To change all Jira projects in a group (and its subgroups) to use group-level integration settings:
@ -137,7 +152,7 @@ To change all Jira projects in a group (and its subgroups) to use group-level in
end
```
## Bulk update the service integration password for all projects
### Update the Jira integration password for all projects
WARNING:
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
@ -153,7 +168,11 @@ p.each do |project|
end
```
## `500 We're sorry` when accessing a Jira issue in GitLab
## Jira issue list
When [viewing Jira issues](issues.md#view-jira-issues) in GitLab, you might encounter the following issues.
### `500 We're sorry` when accessing a Jira issue in GitLab
When accessing a Jira issue in GitLab, you might get a `500 We're sorry. Something went wrong on our end` error.
Check [`production.log`](../../administration/logs/index.md#productionlog) to see if it contains the following exception:
@ -164,7 +183,7 @@ Check [`production.log`](../../administration/logs/index.md#productionlog) to se
If that's the case, ensure the [**Due date** field is visible for issues](https://confluence.atlassian.com/jirakb/due-date-field-is-missing-189431917.html) in the integrated Jira project.
## `An error occurred while requesting data from Jira` when viewing the Jira issue list in GitLab
### `An error occurred while requesting data from Jira`
When you try to view the Jira issue list in GitLab, you might see this message:
@ -181,7 +200,7 @@ The Jira issue list does not load if the project key contains a reserved JQL wor
For more information, see [issue 426176](https://gitlab.com/gitlab-org/gitlab/-/issues/426176).
Your Jira project key must not have [restricted words and characters](https://confluence.atlassian.com/jirasoftwareserver/advanced-searching-939938733.html#Advancedsearching-restrictionsRestrictedwordsandcharacters).
## Jira credentials not allowed to access the data
### Jira credentials not allowed to access the data
When you try to view the Jira issue list in GitLab, you might see this message:
@ -214,14 +233,3 @@ Both methods should return a JSON response:
- `total` gives a count of the issues that match the Jira project key.
- `issues` contains an array of the issues that match the Jira project key.
## GitLab cannot link to a Jira issue
When you mention a Jira issue ID in GitLab, the issue link might be missing.
[`sidekiq.log`](../../administration/logs/index.md#sidekiq-logs) might contain the following exception:
```plaintext
No Link Issue Permission for issue 'JIRA-1234'
```
To resolve this issue, ensure the Jira user you created for the [Jira issue integration](configure.md) has permission to link issues.

View File

@ -202,6 +202,8 @@ panels:
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview of editing label filters in the configuration file, see [GitLab Value Streams Dashboard - Label filters demo](https://www.youtube.com/watch?v=4qDAHCxCfik).
Label filters are appended as query parameters to the URL of the drill-down report of each eligible metric and automatically applied.
## Dashboard metrics and drill-down reports
| Metric | Description | Drill-down report | Documentation page | ID |

View File

@ -29,6 +29,19 @@ RSpec.describe 'Pipeline Schedules', :js, feature_category: :continuous_integrat
expect(page).to have_content(s_('PipelineSchedules|Edit pipeline schedule'))
end
context 'when the owner is nil' do
before do
pipeline_schedule.update!(owner_id: nil, description: "#{FFaker::Product.product_name} pipeline schedule")
visit_pipelines_schedules
end
it 'shows the pipeline' do
within_testid('pipeline-schedule-table-row') do
expect(page).to have_content(pipeline_schedule.description)
end
end
end
end
describe 'PATCH /projects/pipelines_schedules/:id/edit' do

View File

@ -9,7 +9,7 @@ RSpec.describe Types::Ci::PipelineType do
it 'contains attributes related to a pipeline' do
expected_fields = %w[
id iid sha before_sha complete status detailed_status config_source
id iid sha before_sha complete status detailed_status config_source name
duration queued_duration
coverage created_at updated_at started_at finished_at committed_at
stages user retryable cancelable jobs source_job job job_artifacts downstream

View File

@ -139,9 +139,7 @@ RSpec.describe 'sentry errors requests', feature_category: :error_tracking do
context 'when reactive cache returns data' do
before do
stub_setting_for(:list_sentry_issues,
issues: [sentry_error],
pagination: pagination)
stub_setting_for(:list_sentry_issues, issues: [sentry_error], pagination: pagination)
post_graphql(query, current_user: current_user)
end

View File

@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'Query.project(fullPath).issue(iid).designCollection.version(sha)',
feature_category: :design_management do
feature_category: :design_management do
include GraphqlHelpers
include DesignManagementTestHelpers

View File

@ -109,8 +109,10 @@ RSpec.describe 'Query.project.mergeRequests.pipelines', feature_category: :conti
end
def run_query(first = nil)
run_with_clean_state(query,
context: { current_user: author },
variables: { path: project.full_path, first: first })
run_with_clean_state(
query,
context: { current_user: author },
variables: { path: project.full_path, first: first }
)
end
end

View File

@ -321,9 +321,11 @@ RSpec.describe 'getting merge request information nested in a project', feature_
end
it 'does not error' do
post_graphql(query,
current_user: current_user,
variables: { path: project.full_path })
post_graphql(
query,
current_user: current_user,
variables: { path: project.full_path }
)
expect(graphql_data_at(:project, :mrs, :nodes, :notes, :pageInfo)).to contain_exactly a_hash_including(
'endCursor' => String,

View File

@ -445,9 +445,14 @@ RSpec.describe 'getting merge request listings nested in a project', feature_cat
before_all do
project.add_developer(current_user)
mrs = create_list(:merge_request, 10, :closed, :with_head_pipeline,
source_project: project,
author: current_user)
mrs = create_list(
:merge_request,
10,
:closed,
:with_head_pipeline,
source_project: project,
author: current_user
)
mrs.each do |mr|
mr.assignees << create(:user)
mr.assignees << current_user

View File

@ -111,11 +111,14 @@ RSpec.describe 'getting pipeline information nested in a project', feature_categ
context 'when a job has been retried' do
let_it_be(:retried) do
create(:ci_build, :retried,
name: build_job.name,
pipeline: pipeline,
stage_idx: 0,
stage: build_job.stage_name)
create(
:ci_build,
:retried,
name: build_job.name,
pipeline: pipeline,
stage_idx: 0,
stage: build_job.stage_name
)
end
let(:fields) do

View File

@ -106,9 +106,10 @@ RSpec.describe 'getting project members information', feature_category: :groups_
it 'returns an error for an invalid member relation' do
fetch_members(project: child_project, args: { relations: [:OBLIQUE] })
expect(graphql_errors.first)
.to include('path' => %w[query project projectMembers relations],
'message' => a_string_including('invalid value ([OBLIQUE])'))
expect(graphql_errors.first).to include(
'path' => %w[query project projectMembers relations],
'message' => a_string_including('invalid value ([OBLIQUE])')
)
end
context 'when project is owned by a member' do
@ -170,13 +171,19 @@ RSpec.describe 'getting project members information', feature_category: :groups_
it 'avoids N+1 queries, when requesting multiple MRs' do
control_query = with_signature(
[project_path, mr_a],
graphql_query_for(:project, { full_path: project_path },
query_graphql_field(:project_members, nil, interaction_query))
graphql_query_for(
:project,
{ full_path: project_path },
query_graphql_field(:project_members, nil, interaction_query)
)
)
query_two = with_signature(
[project_path, mr_a, mr_b],
graphql_query_for(:project, { full_path: project_path },
query_graphql_field(:project_members, nil, interaction_b_query))
graphql_query_for(
:project,
{ full_path: project_path },
query_graphql_field(:project_members, nil, interaction_b_query)
)
)
control_count = ActiveRecord::QueryRecorder.new do
@ -199,8 +206,11 @@ RSpec.describe 'getting project members information', feature_category: :groups_
query = with_signature(
[project_path, mr_a],
graphql_query_for(:project, { full_path: project_path },
query_graphql_field(:project_members, nil, interaction_query))
graphql_query_for(
:project,
{ full_path: project_path },
query_graphql_field(:project_members, nil, interaction_query)
)
)
control_count = ActiveRecord::QueryRecorder.new do

View File

@ -21,9 +21,11 @@ RSpec.describe 'rendering project pipeline statistics', feature_category: :conti
end
let(:query) do
graphql_query_for('project',
{ 'fullPath' => project.full_path },
query_graphql_field('pipelineAnalytics', {}, fields))
graphql_query_for(
'project',
{ 'fullPath' => project.full_path },
query_graphql_field('pipelineAnalytics', {}, fields)
)
end
before do

View File

@ -10,9 +10,11 @@ RSpec.describe 'rendering project statistics', feature_category: :shared do
let(:user) { create(:user) }
let(:query) do
graphql_query_for('project',
{ 'fullPath' => project.full_path },
"statistics { #{all_graphql_fields_for('ProjectStatistics')} }")
graphql_query_for(
'project',
{ 'fullPath' => project.full_path },
"statistics { #{all_graphql_fields_for('ProjectStatistics')} }"
)
end
before do

View File

@ -11,39 +11,42 @@ RSpec.describe 'query terraform states', feature_category: :infrastructure_as_co
let_it_be(:latest_version) { terraform_state.latest_version }
let(:query) do
graphql_query_for(:project, { fullPath: project.full_path },
%{
terraformStates {
count
nodes {
id
name
lockedAt
createdAt
updatedAt
latestVersion {
graphql_query_for(
:project,
{ fullPath: project.full_path },
%{
terraformStates {
count
nodes {
id
downloadPath
serial
name
lockedAt
createdAt
updatedAt
createdByUser {
latestVersion {
id
downloadPath
serial
createdAt
updatedAt
createdByUser {
id
}
job {
name
}
}
lockedByUser {
id
}
job {
name
}
}
lockedByUser {
id
}
}
}
})
)
end
let(:current_user) { project.creator }