Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-02-02 09:16:48 +00:00
parent 6d3c75444a
commit 7d96316836
13 changed files with 118 additions and 30 deletions

View File

@ -61,11 +61,13 @@ export default {
</template>
<template #right-secondary>
<gl-sprintf :message="__('Created %{timestamp}')">
<template #timestamp>
<time-ago-tooltip :time="packageEntity.createdAt" />
</template>
</gl-sprintf>
<span>
<gl-sprintf :message="__('Created %{timestamp}')">
<template #timestamp>
<time-ago-tooltip :time="packageEntity.createdAt" />
</template>
</gl-sprintf>
</span>
</template>
</list-item>
</template>

View File

@ -152,11 +152,13 @@ module Ci
}
scope :owned_or_instance_wide, -> (project_id) do
project = project_id.respond_to?(:shared_runners) ? project_id : Project.find(project_id)
from_union(
[
belonging_to_project(project_id),
belonging_to_parent_group_of_project(project_id),
instance_type
project.shared_runners
],
remove_duplicates: false
)
@ -173,7 +175,7 @@ module Ci
from_union(
[
group_and_ancestor_runners,
instance_type
group.shared_runners
],
remove_duplicates: false
)

View File

@ -492,6 +492,10 @@ class Namespace < ApplicationRecord
end
end
def shared_runners
@shared_runners ||= shared_runners_enabled ? Ci::Runner.instance_type : Ci::Runner.none
end
def root?
!has_parent?
end

View File

@ -0,0 +1,15 @@
- name: "REST API endpoint to list group runners no longer accepts `project_type` value for `type` argument"
announcement_milestone: "14.8"
announcement_date: "2022-02-22"
removal_milestone: "15.0"
removal_date: "2022-05-22"
breaking_change: true
reporter: pedropombeiro
body: |
The `GET /groups/:id/runners?type=project_type` endpoint will be removed in GitLab 15.0. The endpoint always returned an empty collection.
stage: Verify
tiers: [Core, Premium, Ultimate]
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/351466
documentation_url: https://docs.gitlab.com/ee/api/runners.html
image_url: # (optional) This is a link to a thumbnail image depicting the feature
video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg

View File

@ -11191,7 +11191,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="groupiterationsin"></a>`in` | [`[IterationSearchableField!]`](#iterationsearchablefield) | Fields in which the fuzzy-search should be performed with the query given in the argument `search`. Defaults to `[title]`. |
| <a id="groupiterationsincludeancestors"></a>`includeAncestors` | [`Boolean`](#boolean) | Whether to include ancestor iterations. Defaults to true. |
| <a id="groupiterationsiterationcadenceids"></a>`iterationCadenceIds` | [`[IterationsCadenceID!]`](#iterationscadenceid) | Global iteration cadence IDs by which to look up the iterations. |
| <a id="groupiterationssearch"></a>`search` | [`String`](#string) | Query used for fuzzy-searching in the fields selected in the argument `in`. |
| <a id="groupiterationssearch"></a>`search` | [`String`](#string) | Query used for fuzzy-searching in the fields selected in the argument `in`. Returns all iterations if empty. |
| <a id="groupiterationssort"></a>`sort` | [`IterationSort`](#iterationsort) | List iterations by sort order. If unspecified, an arbitrary order (subject to change) is used. |
| <a id="groupiterationsstartdate"></a>`startDate` **{warning-solid}** | [`Time`](#time) | **Deprecated** in 13.5. Use timeframe.start. |
| <a id="groupiterationsstate"></a>`state` | [`IterationState`](#iterationstate) | Filter iterations by state. |
@ -13935,7 +13935,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="projectiterationsin"></a>`in` | [`[IterationSearchableField!]`](#iterationsearchablefield) | Fields in which the fuzzy-search should be performed with the query given in the argument `search`. Defaults to `[title]`. |
| <a id="projectiterationsincludeancestors"></a>`includeAncestors` | [`Boolean`](#boolean) | Whether to include ancestor iterations. Defaults to true. |
| <a id="projectiterationsiterationcadenceids"></a>`iterationCadenceIds` | [`[IterationsCadenceID!]`](#iterationscadenceid) | Global iteration cadence IDs by which to look up the iterations. |
| <a id="projectiterationssearch"></a>`search` | [`String`](#string) | Query used for fuzzy-searching in the fields selected in the argument `in`. |
| <a id="projectiterationssearch"></a>`search` | [`String`](#string) | Query used for fuzzy-searching in the fields selected in the argument `in`. Returns all iterations if empty. |
| <a id="projectiterationssort"></a>`sort` | [`IterationSort`](#iterationsort) | List iterations by sort order. If unspecified, an arbitrary order (subject to change) is used. |
| <a id="projectiterationsstartdate"></a>`startDate` **{warning-solid}** | [`Time`](#time) | **Deprecated** in 13.5. Use timeframe.start. |
| <a id="projectiterationsstate"></a>`state` | [`IterationState`](#iterationstate) | Filter iterations by state. |

View File

@ -448,7 +448,7 @@ Example response:
## List project's runners
List all runners available in the project, including from ancestor groups and any shared runners.
List all runners available in the project, including from ancestor groups and [any allowed shared runners](../ci/runners/runners_scope.md#enable-shared-runners).
```plaintext
GET /projects/:id/runners
@ -566,7 +566,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git
## List group's runners
List all runners available in the group as well as its ancestor groups, including any shared runners.
List all runners available in the group as well as its ancestor groups, including [any allowed shared runners](../ci/runners/runners_scope.md#enable-shared-runners).
```plaintext
GET /groups/:id/runners
@ -576,13 +576,13 @@ GET /groups/:id/runners/all?paused=true
GET /groups/:id/runners?tag_list=tag1,tag2
```
| Attribute | Type | Required | Description |
|------------|----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | integer | yes | The ID of the group owned by the authenticated user |
| `type` | string | no | The type of runners to show, one of: `instance_type`, `group_type`, `project_type` |
| `status` | string | no | The status of runners to show, one of: `online` and `offline`. `active` and `paused` are also possible values which were deprecated in GitLab 14.8 and will be removed in GitLab 15.0 |
| `paused` | boolean | no | Whether to include only runners that are accepting or ignoring new jobs |
| `tag_list` | string array | no | List of the runner's tags |
| Attribute | Type | Required | Description |
|------------|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | integer | yes | The ID of the group owned by the authenticated user |
| `type` | string | no | The type of runners to show, one of: `instance_type`, `group_type`, `project_type`. The `project_type` value is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/351466) and will be removed in GitLab 15.0 |
| `status` | string | no | The status of runners to show, one of: `online` and `offline`. `active` and `paused` are also possible values which were deprecated in GitLab 14.8 and will be removed in GitLab 15.0 |
| `paused` | boolean | no | Whether to include only runners that are accepting or ignoring new jobs |
| `tag_list` | string array | no | List of the runner's tags |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/9/runners"

View File

@ -39,7 +39,7 @@ Each metric is defined in a separate YAML file consisting of a number of fields:
| `product_group` | yes | The [group](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml) that owns the metric. |
| `product_category` | no | The [product category](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/categories.yml) for the metric. |
| `value_type` | yes | `string`; one of [`string`, `number`, `boolean`, `object`](https://json-schema.org/understanding-json-schema/reference/type.html). |
| `status` | yes | `string`; [status](#metric-statuses) of the metric, may be set to `active`, `deprecated`, `removed`, `broken`. |
| `status` | yes | `string`; [status](#metric-statuses) of the metric, may be set to `active`, `removed`, `broken`. |
| `time_frame` | yes | `string`; may be set to a value like `7d`, `28d`, `all`, `none`. |
| `data_source` | yes | `string`; may be set to a value like `database`, `redis`, `redis_hll`, `prometheus`, `system`. |
| `data_category` | yes | `string`; [categories](#data-category) of the metric, may be set to `operational`, `optional`, `subscription`, `standard`. The default value is `optional`.|
@ -60,7 +60,6 @@ Metric definitions can have one of the following statuses:
- `active`: Metric is used and reports data.
- `broken`: Metric reports broken data (for example, -1 fallback), or does not report data at all. A metric marked as `broken` must also have the `repair_issue_url` attribute.
- `deprecated`: Metric is deprecated and possibly planned to be removed.
- `removed`: Metric was removed, but it may appear in Service Ping payloads sent from instances running on older versions of GitLab.
### Metric value_type

View File

@ -777,6 +777,18 @@ When checking for active runners, specify `paused=false`.
**Planned removal milestone: 15.0 (2022-05-22)**
### REST API endpoint to list group runners no longer accepts `project_type` value for `type` argument
WARNING:
This feature will be changed or removed in 15.0
as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes).
Before updating GitLab, review the details carefully to determine if you need to make any
changes to your code, settings, or workflow.
The `GET /groups/:id/runners?type=project_type` endpoint will be removed in GitLab 15.0. The endpoint always returned an empty collection.
**Planned removal milestone: 15.0 (2022-05-22)**
### REST and GraphQL API Runner usage of `active` replaced by `paused`
WARNING:

View File

@ -31854,6 +31854,9 @@ msgstr ""
msgid "SecurityOrchestration|If you are using Auto DevOps, your %{monospacedStart}auto-deploy-values.yaml%{monospacedEnd} file will not be updated if you change a policy in this section. Auto DevOps users should make changes by following the %{linkStart}Container Network Policy documentation%{linkEnd}."
msgstr ""
msgid "SecurityOrchestration|Invalid policy type"
msgstr ""
msgid "SecurityOrchestration|Latest scan"
msgstr ""
@ -31872,6 +31875,12 @@ msgstr ""
msgid "SecurityOrchestration|Policies"
msgstr ""
msgid "SecurityOrchestration|Policy cannot be enabled for non-existing branches (%{branches})"
msgstr ""
msgid "SecurityOrchestration|Policy cannot be enabled without branch information"
msgstr ""
msgid "SecurityOrchestration|Policy description"
msgstr ""

View File

@ -72,12 +72,14 @@ exports[`VersionRow renders 1`] = `
<div
class="gl-display-flex gl-align-items-center gl-min-h-6"
>
Created
<time-ago-tooltip-stub
cssclass=""
time="2021-08-10T09:33:54Z"
tooltipplacement="top"
/>
<span>
Created
<time-ago-tooltip-stub
cssclass=""
time="2021-08-10T09:33:54Z"
tooltipplacement="top"
/>
</span>
</div>
</div>
</div>

View File

@ -265,10 +265,10 @@ RSpec.describe Ci::Runner do
it_behaves_like '.belonging_to_parent_group_of_project'
end
context 'with existing system wide, group and project runners' do
context 'with instance runners sharing enabled' do
# group specific
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:group) { create(:group, shared_runners_enabled: true) }
let_it_be(:project) { create(:project, group: group, shared_runners_enabled: true) }
let_it_be(:group_runner) { create(:ci_runner, :group, groups: [group]) }
# project specific
@ -299,6 +299,40 @@ RSpec.describe Ci::Runner do
end
end
context 'with instance runners sharing disabled' do
# group specific
let_it_be(:group) { create(:group, shared_runners_enabled: false) }
let_it_be(:project) { create(:project, group: group, shared_runners_enabled: false) }
let_it_be(:group_runner) { create(:ci_runner, :group, groups: [group]) }
# project specific
let_it_be(:project_runner) { create(:ci_runner, :project, projects: [project]) }
# globally shared
let_it_be(:shared_runner) { create(:ci_runner, :instance) }
describe '.owned_or_instance_wide' do
subject { described_class.owned_or_instance_wide(project.id) }
it 'returns a project specific and a group specific runner' do
is_expected.to contain_exactly(group_runner, project_runner)
end
end
describe '.group_or_instance_wide' do
subject { described_class.group_or_instance_wide(group) }
before do
# Ensure the project runner is instantiated
project_runner
end
it 'returns a group specific runner' do
is_expected.to contain_exactly(group_runner)
end
end
end
describe '#display_name' do
it 'returns the description if it has a value' do
runner = build(:ci_runner, description: 'Linux/Ruby-1.9.3-p448')

View File

@ -1048,6 +1048,7 @@ RSpec.describe API::Ci::Runners do
])
end
# TODO: Remove in %15.0 (https://gitlab.com/gitlab-org/gitlab/-/issues/351466)
it 'returns empty result when type does not match' do
get api("/groups/#{group.id}/runners?type=project_type", user)

View File

@ -7,6 +7,12 @@ RSpec.shared_examples 'it has loose foreign keys' do
let(:fully_qualified_table_name) { "#{connection.current_schema}.#{table_name}" }
let(:deleted_records) { LooseForeignKeys::DeletedRecord.where(fully_qualified_table_name: fully_qualified_table_name) }
around do |example|
LooseForeignKeys::DeletedRecord.using_connection(connection) do
example.run
end
end
it 'has at least one loose foreign key definition' do
definitions = Gitlab::Database::LooseForeignKeys.definitions_by_table[table_name]
expect(definitions.size).to be > 0
@ -69,7 +75,9 @@ RSpec.shared_examples 'cleanup by a loose foreign key' do
expect(find_model).to be_present
LooseForeignKeys::ProcessDeletedRecordsService.new(connection: model.connection).execute
LooseForeignKeys::DeletedRecord.using_connection(parent.connection) do
LooseForeignKeys::ProcessDeletedRecordsService.new(connection: parent.connection).execute
end
if foreign_key_definition.on_delete.eql?(:async_delete)
expect(find_model).not_to be_present