Commit 5d066c53 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 66204abc
......@@ -73,6 +73,9 @@ class IssueType < BaseObject
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue'
field :emails_disabled, GraphQL::BOOLEAN_TYPE, null: false,
method: :project_emails_disabled?,
description: 'Indicates if a project has email notifications disabled'
field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5,
description: 'Indicates the currently logged in user is subscribed to the issue'
field :time_estimate, GraphQL::INT_TYPE, null: false,
......
......@@ -335,7 +335,11 @@ def raw_signature_type
strong_memoize(:raw_signature_type) do
next unless @raw.instance_of?(Gitlab::Git::Commit)
@raw.raw_commit.signature_type if defined? @raw.raw_commit.signature_type
if raw_commit_from_rugged? && gpg_commit.signature_text.present?
:PGP
elsif defined? @raw.raw_commit.signature_type
@raw.raw_commit.signature_type
end
end
end
......@@ -347,7 +351,7 @@ def signature
strong_memoize(:signature) do
case signature_type
when :PGP
Gitlab::Gpg::Commit.new(self).signature
gpg_commit.signature
when :X509
Gitlab::X509::Commit.new(self).signature
else
......@@ -356,6 +360,14 @@ def signature
end
end
def raw_commit_from_rugged?
@raw.raw_commit.is_a?(Rugged::Commit)
end
def gpg_commit
@gpg_commit ||= Gitlab::Gpg::Commit.new(self)
end
def revert_branch_name
"revert-#{short_id}"
end
......
......@@ -305,6 +305,10 @@ def has_opened_alert?
latest_opened_most_severe_alert.present?
end
def has_running_deployments?
all_deployments.running.exists?
end
def metrics
prometheus_adapter.query(:environment, self) if has_metrics_and_can_query?
end
......
......@@ -10,6 +10,10 @@ def issue_path
def subscribed?
issue.subscribed?(current_user, issue.project)
end
def project_emails_disabled?
issue.project.emails_disabled?
end
end
IssuePresenter.prepend_if_ee('EE::IssuePresenter')
......@@ -4,6 +4,11 @@ class EnvironmentEntity < Grape::Entity
include RequestAwareEntity
expose :id
expose :global_id do |environment|
environment.to_global_id.to_s
end
expose :name
expose :state
expose :external_url
......
......@@ -40,7 +40,7 @@ def execute
apply_bfg_object_map!
# Remove older objects that are no longer referenced
GitGarbageCollectWorker.new.perform(project.id, :gc, "project_cleanup:gc:#{project.id}")
GitGarbageCollectWorker.new.perform(project.id, :prune, "project_cleanup:gc:#{project.id}")
# The cache may now be inaccurate, and holding onto it could prevent
# bugs assuming the presence of some object from manifesting for some
......
......@@ -27,15 +27,15 @@ def perform(project_id, task = :gc, lease_key = nil, lease_uuid = nil)
task = task.to_sym
if task == :gc
if gc?(task)
::Projects::GitDeduplicationService.new(project).execute
cleanup_orphan_lfs_file_references(project)
end
gitaly_call(task, project.repository.raw_repository)
gitaly_call(task, project)
# Refresh the branch cache in case garbage collection caused a ref lookup to fail
flush_ref_caches(project) if task == :gc
flush_ref_caches(project) if gc?(task)
update_repository_statistics(project) if task != :pack_refs
......@@ -48,6 +48,10 @@ def perform(project_id, task = :gc, lease_key = nil, lease_uuid = nil)
private
def gc?(task)
task == :gc || task == :prune
end
def try_obtain_lease(key)
::Gitlab::ExclusiveLease.new(key, timeout: LEASE_TIMEOUT).try_obtain
end
......@@ -64,8 +68,9 @@ def get_lease_uuid(key)
::Gitlab::ExclusiveLease.get_uuid(key)
end
## `repository` has to be a Gitlab::Git::Repository
def gitaly_call(task, repository)
def gitaly_call(task, project)
repository = project.repository.raw_repository
client = if task == :pack_refs
Gitlab::GitalyClient::RefService.new(repository)
else
......@@ -73,8 +78,8 @@ def gitaly_call(task, repository)
end
case task
when :gc
client.garbage_collect(bitmaps_enabled?)
when :prune, :gc
client.garbage_collect(bitmaps_enabled?, prune: task == :prune)
when :full_repack
client.repack_full(bitmaps_enabled?)
when :incremental_repack
......
---
title: Fix 404 error from Commit Signature API when using Rugged
merge_request: 46736
author:
type: fixed
---
title: Prune loose objects during git garbage collection
merge_request: 39592
author:
type: changed
---
title: Add emailsDisabled field for issue type
merge_request: 46947
author:
type: changed
---
title: Changes limit for lsif artifacts to 100MB
merge_request: 46980
author:
type: changed
# frozen_string_literal: true
class ChangeDefaultValueOfCiMaxArtifactSizeLsifOfPlanLimitsFrom20To100 < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
change_column_default :plan_limits, :ci_max_artifact_size_lsif, 100
execute('UPDATE plan_limits SET ci_max_artifact_size_lsif = 100 WHERE ci_max_artifact_size_lsif = 20')
end
end
def down
with_lock_retries do
change_column_default :plan_limits, :ci_max_artifact_size_lsif, 20
execute('UPDATE plan_limits SET ci_max_artifact_size_lsif = 20 WHERE ci_max_artifact_size_lsif = 100')
end
end
end
41cc59ebfeed647b2525191befa43c1faeb1c133a687a5c93124f4b4c745117a
\ No newline at end of file
......@@ -14631,7 +14631,7 @@ CREATE TABLE plan_limits (
offset_pagination_limit integer DEFAULT 50000 NOT NULL,
ci_instance_level_variables integer DEFAULT 25 NOT NULL,
storage_size_limit integer DEFAULT 0 NOT NULL,
ci_max_artifact_size_lsif integer DEFAULT 20 NOT NULL,
ci_max_artifact_size_lsif integer DEFAULT 100 NOT NULL,
ci_max_artifact_size_archive integer DEFAULT 0 NOT NULL,
ci_max_artifact_size_metadata integer DEFAULT 0 NOT NULL,
ci_max_artifact_size_trace integer DEFAULT 0 NOT NULL,
......
......@@ -10,4 +10,4 @@ link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#links
level: error
scope: raw
raw:
- '\[.+\]\((https?:){0}[\w\/\.-]+(\.html).*\)'
- '\[.+\]\((https?:){0}[\w\/\.-]+(\.html).*?\)'
---
# Error: gitlab.InternalLinkFormat
#
# Checks that internal link paths don't start with "./", which is not needed.
#
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
extends: existence
message: 'Link "%s" must not start with "./".'
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#links-to-internal-documentation
level: error
scope: raw
raw:
- '\[.+\]\(\.\/.+?\)'
......@@ -177,7 +177,7 @@ successfully, you must replicate their data using some other means.
| [CI job artifacts (other than Job Logs)](../../../ci/pipelines/job_artifacts.md) | **Yes** (10.4) | [No](https://gitlab.com/gitlab-org/gitlab/-/issues/8923) | Via Object Storage provider if supported. Native Geo support (Beta) . | Verified only manually using [Integrity Check Rake Task](../../raketasks/check.md) on both nodes and comparing the output between them |
| [Job logs](../../job_logs.md) | **Yes** (10.4) | [No](https://gitlab.com/gitlab-org/gitlab/-/issues/8923) | Via Object Storage provider if supported. Native Geo support (Beta). | Verified only on transfer or manually using [Integrity Check Rake Task](../../raketasks/check.md) on both nodes and comparing the output between them |
| [Object pools for forked project deduplication](../../../development/git_object_deduplication.md) | **Yes** | No | No | |
| [Container Registry](../../packages/container_registry.md) | **Yes** (12.3) | No | No | Disabled by default. See [instructions](./docker_registry.md) to enable. |
| [Container Registry](../../packages/container_registry.md) | **Yes** (12.3) | No | No | Disabled by default. See [instructions](docker_registry.md) to enable. |
| [Content in object storage (beta)](object_storage.md) | **Yes** (12.4) | [No](https://gitlab.com/gitlab-org/gitlab/-/issues/13845) | No | |
| [Project designs repository](../../../user/project/issues/design_management.md) | **Yes** (12.7) | [No](https://gitlab.com/gitlab-org/gitlab/-/issues/32467) | Via Object Storage provider if supported. Native Geo support (Beta). | |
| [NPM Registry](../../../user/packages/npm_registry/index.md) | **Yes** (13.2) | [No](https://gitlab.com/groups/gitlab-org/-/epics/1817) | Via Object Storage provider if supported. Native Geo support (Beta). | Behind feature flag `geo_package_file_replication`, enabled by default |
......
......@@ -25,7 +25,7 @@ To disable Geo, follow these steps:
## Remove all secondary Geo nodes
To disable Geo, you need to first remove all your secondary Geo nodes, which means replication will not happen
anymore on these nodes. You can follow our docs to [remove your secondary Geo nodes](./remove_geo_node.md).
anymore on these nodes. You can follow our docs to [remove your secondary Geo nodes](remove_geo_node.md).
If the current node that you want to keep using is a secondary node, you need to first promote it to primary.
You can use our steps on [how to promote a secondary node](../disaster_recovery/#step-3-promoting-a-secondary-node)
......
......@@ -347,7 +347,7 @@ setting is used:
| `ci_max_artifact_size_license_management` | 0 |
| `ci_max_artifact_size_license_scanning` | 0 |
| `ci_max_artifact_size_load_performance` | 0 |
| `ci_max_artifact_size_lsif` | 20 MB ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37226) in GitLab 13.3) |
| `ci_max_artifact_size_lsif` | 100 MB ([Introduced at 20 MB](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37226) in GitLab 13.3 and [raised to 100 MB](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46980) in GitLab 13.6.) |
| `ci_max_artifact_size_metadata` | 0 |
| `ci_max_artifact_size_metrics_referee` | 0 |
| `ci_max_artifact_size_metrics` | 0 |
......
......@@ -584,7 +584,7 @@ on how to achieve that.
## Use an external container registry with GitLab as an auth endpoint
If you use an external container registry, some features associated with the
container registry may be unavailable or have [inherent risks](./../../user/packages/container_registry/index.md#use-with-external-container-registries).
container registry may be unavailable or have [inherent risks](../../user/packages/container_registry/index.md#use-with-external-container-registries).
**Omnibus GitLab**
......
......@@ -858,7 +858,7 @@ Find this content in the [Container Registry troubleshooting docs](../packages/c
## Sidekiq
This content has been moved to the [Troubleshooting Sidekiq docs](./sidekiq.md).
This content has been moved to the [Troubleshooting Sidekiq docs](sidekiq.md).
## Redis
......
......@@ -22,7 +22,7 @@ were before.
This change is deployed behind a feature flag that is **enabled by default**.
If you experience any issues with upload,
[GitLab administrators with access to the GitLab Rails console](./feature_flags.md)
[GitLab administrators with access to the GitLab Rails console](feature_flags.md)
can opt to disable it.
To enable it:
......
......@@ -842,7 +842,8 @@ Example response if commit is GPG signed:
"gpg_key_primary_keyid": "8254AAB3FBD54AC9",
"gpg_key_user_name": "John Doe",
"gpg_key_user_email": "johndoe@example.com",
"gpg_key_subkey_id": null
"gpg_key_subkey_id": null,
"commit_source": "gitaly"
}
```
......@@ -865,7 +866,8 @@ Example response if commit is X.509 signed:
"subject_key_identifier": "AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB",
"crl_url": "http://example.com/pki.crl"
}
}
},
"commit_source": "gitaly"
}
```
......
......@@ -379,7 +379,7 @@ This API retrieves the list of merge requests shipped with a given deployment:
GET /projects/:id/deployments/:deployment_id/merge_requests
```
It supports the same parameters as the [Merge Requests API](./merge_requests.md#list-merge-requests) and will return a response using the same format:
It supports the same parameters as the [Merge Requests API](merge_requests.md#list-merge-requests) and will return a response using the same format:
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/42"
......
......@@ -6618,6 +6618,41 @@ Identifier of Environment
"""
scalar EnvironmentID
"""
Autogenerated input type of EnvironmentsCanaryIngressUpdate
"""
input EnvironmentsCanaryIngressUpdateInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
The global ID of the environment to update
"""
id: EnvironmentID!
"""
The weight of the Canary Ingress
"""
weight: Int!
}
"""
Autogenerated return type of EnvironmentsCanaryIngressUpdate
"""
type EnvironmentsCanaryIngressUpdatePayload {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
"""
Errors encountered during execution of the mutation.
"""
errors: [String!]!
}
"""
Represents an epic
"""
......@@ -7360,6 +7395,11 @@ type EpicIssue implements CurrentUserTodos & Noteable {
"""
dueDate: Time
"""
Indicates if a project has email notifications disabled
"""
emailsDisabled: Boolean!
"""
Epic to which this issue belongs
"""
......@@ -9879,6 +9919,11 @@ type Issue implements CurrentUserTodos & Noteable {
"""
dueDate: Time
"""
Indicates if a project has email notifications disabled
"""
emailsDisabled: Boolean!
"""
Epic to which this issue belongs
"""
......@@ -13208,6 +13253,7 @@ type Mutation {
"""
discussionToggleResolve(input: DiscussionToggleResolveInput!): DiscussionToggleResolvePayload
dismissVulnerability(input: DismissVulnerabilityInput!): DismissVulnerabilityPayload @deprecated(reason: "Use vulnerabilityDismiss. Deprecated in 13.5")
environmentsCanaryIngressUpdate(input: EnvironmentsCanaryIngressUpdateInput!): EnvironmentsCanaryIngressUpdatePayload
epicAddIssue(input: EpicAddIssueInput!): EpicAddIssuePayload
epicSetSubscription(input: EpicSetSubscriptionInput!): EpicSetSubscriptionPayload
epicTreeReorder(input: EpicTreeReorderInput!): EpicTreeReorderPayload
......
......@@ -18349,6 +18349,108 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "EnvironmentsCanaryIngressUpdateInput",
"description": "Autogenerated input type of EnvironmentsCanaryIngressUpdate",
"fields": null,
"inputFields": [
{
"name": "id",
"description": "The global ID of the environment to update",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "EnvironmentID",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "weight",
"description": "The weight of the Canary Ingress",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "EnvironmentsCanaryIngressUpdatePayload",
"description": "Autogenerated return type of EnvironmentsCanaryIngressUpdate",
"fields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "errors",
"description": "Errors encountered during execution of the mutation.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Epic",
......@@ -20316,6 +20418,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "emailsDisabled",
"description": "Indicates if a project has email notifications disabled",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "epic",
"description": "Epic to which this issue belongs",
......@@ -26955,6 +27075,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "emailsDisabled",
"description": "Indicates if a project has email notifications disabled",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "epic",
"description": "Epic to which this issue belongs",
......@@ -37454,6 +37592,33 @@
"isDeprecated": true,
"deprecationReason": "Use vulnerabilityDismiss. Deprecated in 13.5"
},
{
"name": "environmentsCanaryIngressUpdate",
"description": null,
"args": [
{
"name": "input",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "EnvironmentsCanaryIngressUpdateInput",