Skip to content

Commit 051aab6

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 07fffa9 commit 051aab6

File tree

71 files changed

+1303
-1311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1303
-1311
lines changed

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ Search/NamespacedClass:
11281128
Enabled: true
11291129
Exclude:
11301130
- 'config/**/*.rb'
1131+
- 'ee/config/**/*.rb'
11311132
- 'db/**/*.rb'
11321133
- 'ee/db/**/*.rb'
11331134
- 'ee/bin/**/*'

.rubocop_todo/gitlab/avoid_gitlab_instance_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Gitlab/AvoidGitlabInstanceChecks:
2727
- 'config/initializers/active_record_transaction_observer.rb'
2828
- 'config/initializers/active_record_transaction_patches.rb'
2929
- 'config/initializers/check_forced_decomposition.rb'
30-
- 'config/initializers/gitlab_suggested_reviewers_secret.rb'
3130
- 'config/initializers/rack_multipart_patch.rb'
3231
- 'config/initializers/validate_puma.rb'
3332
- 'config/initializers/warden.rb'
@@ -77,6 +76,7 @@ Gitlab/AvoidGitlabInstanceChecks:
7776
- 'ee/app/workers/gitlab_subscriptions/refresh_seats_worker.rb'
7877
- 'ee/app/workers/gitlab_subscriptions/schedule_refresh_seats_worker.rb'
7978
- 'ee/app/workers/update_all_mirrors_worker.rb'
79+
- 'ee/config/initializers/gitlab_suggested_reviewers_secret.rb'
8080
- 'ee/lib/api/code_suggestions.rb'
8181
- 'ee/lib/api/scim/instance_scim.rb'
8282
- 'ee/lib/ee/api/namespaces.rb'

.rubocop_todo/layout/line_length.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ Layout/LineLength:
573573
- 'config/initializers/devise_dynamic_password_length_validation.rb'
574574
- 'config/initializers/direct_upload_support.rb'
575575
- 'config/initializers/doorkeeper.rb'
576-
- 'config/initializers/elastic_client_setup.rb'
577576
- 'config/initializers/google_api_client.rb'
578577
- 'config/initializers/kaminari_active_record_relation_methods_with_limit.rb'
579578
- 'config/initializers/pages_storage_check.rb'
@@ -958,6 +957,7 @@ Layout/LineLength:
958957
- 'ee/app/workers/repository_update_mirror_worker.rb'
959958
- 'ee/app/workers/security/orchestration_policy_rule_schedule_namespace_worker.rb'
960959
- 'ee/app/workers/security/orchestration_policy_rule_schedule_worker.rb'
960+
- 'ee/config/initializers/elastic_client_setup.rb'
961961
- 'ee/config/routes/group.rb'
962962
- 'ee/config/routes/project.rb'
963963
- 'ee/db/fixtures/development/20_burndown.rb'

.rubocop_todo/lint/constant_definition_in_block.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Lint/ConstantDefinitionInBlock:
66
- 'app/workers/concerns/worker_context.rb'
77
- 'config/application.rb'
88
- 'config/initializers/direct_upload_support.rb'
9-
- 'config/initializers/elastic_client_setup.rb'
109
- 'ee/app/graphql/ee/types/work_items/widget_interface.rb'
1110
- 'ee/app/models/concerns/ee/issuable_link.rb'
1211
- 'ee/app/models/ee/application_setting.rb'
@@ -22,6 +21,7 @@ Lint/ConstantDefinitionInBlock:
2221
- 'ee/app/models/ee/user.rb'
2322
- 'ee/app/models/ee/vulnerability.rb'
2423
- 'ee/app/services/ee/notes/quick_actions_service.rb'
24+
- 'ee/config/initializers/elastic_client_setup.rb'
2525
- 'ee/lib/gitlab/subscription_portal/clients/rest.rb'
2626
- 'ee/lib/tasks/geo.rake'
2727
- 'ee/spec/db/schema_support.rb'

.rubocop_todo/style/if_unless_modifier.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ Style/IfUnlessModifier:
238238
- 'config/initializers/default_url_options.rb'
239239
- 'config/initializers/direct_upload_support.rb'
240240
- 'config/initializers/doorkeeper.rb'
241-
- 'config/initializers/geo.rb'
242241
- 'config/initializers/google_api_client.rb'
243242
- 'config/initializers/jira.rb'
244243
- 'config/initializers/kaminari_active_record_relation_methods_with_limit.rb'

GITLAB_KAS_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b595a368555ce8d92856d0bccbc3b73638cce63d
1+
544867d98264184574c73d9f23985dead631594c

Gemfile.checksum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@
746746
{"name":"unf_ext","version":"0.0.8.2","platform":"x64-mingw32","checksum":"f7e4c01774c91eb22e30d53dfc40ffbbb5a175f785c8f6f1be17ad96a0b29ed0"},
747747
{"name":"unf_ext","version":"0.0.8.2","platform":"x86-mingw32","checksum":"6d44c13c98924bebd15ebdd4ed196ead403a0770ac03304570873349fda2a208"},
748748
{"name":"unicode-display_width","version":"2.4.2","platform":"ruby","checksum":"6a10205d1a19ca790c4e53064ba93f09d9eb234bf6bd135d9deb6001c21428be"},
749-
{"name":"unicode-emoji","version":"3.6.0","platform":"ruby","checksum":"9d333b0bec74bbf0992b77ce59c809b762f0d1b4018ea454f524491fabc8e5ec"},
749+
{"name":"unicode-emoji","version":"3.7.0","platform":"ruby","checksum":"e72131357cffc199c2ecce64e2f9daa6a922944fd2f955aae0702708bda423ff"},
750750
{"name":"unicode-version","version":"1.4.0","platform":"ruby","checksum":"56409a354a042df2e9acd547f58f81c6ee24839560b47f4907b1c097b6677563"},
751751
{"name":"unicode_utils","version":"1.4.0","platform":"ruby","checksum":"b922d0cf2313b6b7136ada6645ce7154ffc86418ca07d53b058efe9eb72f2a40"},
752752
{"name":"uniform_notifier","version":"1.16.0","platform":"ruby","checksum":"99b39ee4a0864e3b49f375b5e5803eb26d35ed6eb1719c96407573a87bc4dbb5"},

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ GEM
18761876
unf_ext
18771877
unf_ext (0.0.8.2)
18781878
unicode-display_width (2.4.2)
1879-
unicode-emoji (3.6.0)
1879+
unicode-emoji (3.7.0)
18801880
unicode-version (~> 1.0)
18811881
unicode-version (1.4.0)
18821882
unicode_utils (1.4.0)

Gemfile.next.checksum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@
761761
{"name":"unf_ext","version":"0.0.8.2","platform":"x64-mingw32","checksum":"f7e4c01774c91eb22e30d53dfc40ffbbb5a175f785c8f6f1be17ad96a0b29ed0"},
762762
{"name":"unf_ext","version":"0.0.8.2","platform":"x86-mingw32","checksum":"6d44c13c98924bebd15ebdd4ed196ead403a0770ac03304570873349fda2a208"},
763763
{"name":"unicode-display_width","version":"2.4.2","platform":"ruby","checksum":"6a10205d1a19ca790c4e53064ba93f09d9eb234bf6bd135d9deb6001c21428be"},
764-
{"name":"unicode-emoji","version":"3.6.0","platform":"ruby","checksum":"9d333b0bec74bbf0992b77ce59c809b762f0d1b4018ea454f524491fabc8e5ec"},
764+
{"name":"unicode-emoji","version":"3.7.0","platform":"ruby","checksum":"e72131357cffc199c2ecce64e2f9daa6a922944fd2f955aae0702708bda423ff"},
765765
{"name":"unicode-version","version":"1.4.0","platform":"ruby","checksum":"56409a354a042df2e9acd547f58f81c6ee24839560b47f4907b1c097b6677563"},
766766
{"name":"unicode_utils","version":"1.4.0","platform":"ruby","checksum":"b922d0cf2313b6b7136ada6645ce7154ffc86418ca07d53b058efe9eb72f2a40"},
767767
{"name":"uniform_notifier","version":"1.16.0","platform":"ruby","checksum":"99b39ee4a0864e3b49f375b5e5803eb26d35ed6eb1719c96407573a87bc4dbb5"},

Gemfile.next.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ GEM
19031903
unf_ext
19041904
unf_ext (0.0.8.2)
19051905
unicode-display_width (2.4.2)
1906-
unicode-emoji (3.6.0)
1906+
unicode-emoji (3.7.0)
19071907
unicode-version (~> 1.0)
19081908
unicode-version (1.4.0)
19091909
unicode_utils (1.4.0)

app/assets/javascripts/ml/model_registry/apps/index_ml_models.vue

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
<script>
2-
import { GlButton, GlExperimentBadge } from '@gitlab/ui';
3-
import MetadataItem from '~/vue_shared/components/registry/metadata_item.vue';
2+
import { GlButton, GlExperimentBadge, GlIcon } from '@gitlab/ui';
43
import TitleArea from '~/vue_shared/components/registry/title_area.vue';
54
import { helpPagePath } from '~/helpers/help_page_helper';
65
import * as Sentry from '~/sentry/sentry_browser_wrapper';
76
import { s__ } from '~/locale';
87
import EmptyState from '../components/model_list_empty_state.vue';
98
import * as i18n from '../translations';
109
import { BASE_SORT_FIELDS } from '../constants';
11-
import ModelRow from '../components/model_row.vue';
1210
import ActionsDropdown from '../components/actions_dropdown.vue';
1311
import getModelsQuery from '../graphql/queries/get_models.query.graphql';
1412
import { makeLoadModelErrorMessage } from '../translations';
15-
import SearchableList from '../components/searchable_list.vue';
13+
import SearchableTable from '../components/searchable_table.vue';
1614
1715
export default {
1816
name: 'IndexMlModels',
1917
components: {
20-
ModelRow,
21-
MetadataItem,
18+
GlIcon,
2219
TitleArea,
2320
GlButton,
2421
GlExperimentBadge,
2522
EmptyState,
2623
ActionsDropdown,
27-
SearchableList,
24+
SearchableTable,
2825
},
2926
provide() {
3027
return {
@@ -144,7 +141,10 @@ export default {
144141
</div>
145142
</template>
146143
<template #metadata-models-count>
147-
<metadata-item icon="machine-learning" :text="$options.i18n.modelsCountLabel(count)" />
144+
<div class="detail-page-header-body gl-flex-wrap gl-gap-x-2" data-testid="metadata-item">
145+
<gl-icon name="machine-learning" />
146+
{{ $options.i18n.modelsCountLabel(count) }}
147+
</div>
148148
</template>
149149
<template #right-actions>
150150
<gl-button
@@ -158,13 +158,14 @@ export default {
158158
<actions-dropdown />
159159
</template>
160160
</title-area>
161-
<searchable-list
161+
<searchable-table
162162
show-search
163163
:page-info="pageInfo"
164-
:items="items"
164+
:models="items"
165165
:error-message="errorMessage"
166166
:is-loading="isLoading"
167167
:sortable-fields="$options.sortableFields"
168+
can-write-model-registry
168169
@fetch-page="fetchPage"
169170
>
170171
<template #empty-state>
@@ -175,10 +176,6 @@ export default {
175176
:primary-link="createModelPath"
176177
/>
177178
</template>
178-
179-
<template #item="{ item }">
180-
<model-row :model="item" />
181-
</template>
182-
</searchable-list>
179+
</searchable-table>
183180
</div>
184181
</template>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<script>
2+
import { GlAvatarLink, GlAvatar, GlTable, GlLink, GlTooltip } from '@gitlab/ui';
3+
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
4+
import { s__ } from '~/locale';
5+
6+
export default {
7+
name: 'ModelsTable',
8+
components: {
9+
GlAvatarLink,
10+
GlTable,
11+
TimeAgoTooltip,
12+
GlAvatar,
13+
GlLink,
14+
},
15+
directives: {
16+
GlTooltip,
17+
},
18+
props: {
19+
items: {
20+
type: Array,
21+
required: true,
22+
},
23+
},
24+
computed: {
25+
tableFields() {
26+
return [
27+
{ key: 'name', label: s__('ModelRegistry|Model name'), thClass: 'gl-w-1/4' },
28+
{ key: 'latestVersion', label: s__('ModelRegistry|Latest version'), thClass: 'gl-w-1/4' },
29+
{ key: 'author', label: s__('ModelRegistry|Author'), thClass: 'gl-w-1/4' },
30+
{ key: 'createdAt', label: s__('ModelRegistry|Created'), thClass: 'gl-w-1/4' },
31+
];
32+
},
33+
},
34+
methods: {
35+
versionLabel(item) {
36+
return item.versionCount === 1 ? s__('ModelRegistry|version') : s__('ModelRegistry|versions');
37+
},
38+
showLatestVersion(item) {
39+
return item.latestVersion && item.latestVersion._links;
40+
},
41+
},
42+
};
43+
</script>
44+
45+
<template>
46+
<gl-table class="fixed" :sticky-header="false" :items="items" :fields="tableFields" stacked="sm">
47+
<template #cell(name)="{ item }">
48+
<gl-link :href="item._links.showPath">
49+
{{ item.name }}
50+
</gl-link>
51+
</template>
52+
<template #cell(latestVersion)="{ item }">
53+
<gl-link v-if="showLatestVersion(item)" :href="item.latestVersion._links.showPath">
54+
{{ item.latestVersion.version }}
55+
</gl-link>
56+
<span v-if="item.latestVersion" class="gl-text-subtle"> · </span>
57+
<span class="gl-text-subtle">{{ item.versionCount }} {{ versionLabel(item) }}</span>
58+
</template>
59+
<template #cell(author)="{ item: { author } }">
60+
<gl-avatar-link
61+
v-if="author"
62+
:href="author.webUrl"
63+
:title="author.name"
64+
class="js-user-link gl-text-subtle"
65+
>
66+
<gl-avatar :src="author.avatarUrl" :size="16" :entity-name="author.name" class="mr-2" />
67+
{{ author.name }}
68+
</gl-avatar-link>
69+
</template>
70+
<template #cell(createdAt)="{ item: { createdAt } }">
71+
<time-ago-tooltip v-if="createdAt" :time="createdAt" />
72+
</template>
73+
</gl-table>
74+
</template>

app/assets/javascripts/ml/model_registry/components/searchable_table.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { GRAPHQL_PAGE_SIZE, LIST_KEY_CREATED_AT } from '~/ml/model_registry/cons
55
import { queryToObject, setUrlParams, updateHistory } from '~/lib/utils/url_utility';
66
import { FILTERED_SEARCH_TERM } from '~/vue_shared/components/filtered_search_bar/constants';
77
import LoadOrErrorOrShow from '~/ml/model_registry/components/load_or_error_or_show.vue';
8+
import ModelsTable from '~/ml/model_registry/components/models_table.vue';
89
import ModelVersionsTable from '~/ml/model_registry/components/model_versions_table.vue';
910
1011
export default {
@@ -13,6 +14,7 @@ export default {
1314
RegistrySearch,
1415
LoadOrErrorOrShow,
1516
GlKeysetPagination,
17+
ModelsTable,
1618
ModelVersionsTable,
1719
},
1820
directives: {
@@ -21,7 +23,13 @@ export default {
2123
props: {
2224
modelVersions: {
2325
type: Array,
24-
required: true,
26+
required: false,
27+
default: () => [],
28+
},
29+
models: {
30+
type: Array,
31+
required: false,
32+
default: () => [],
2533
},
2634
pageInfo: {
2735
type: Object,
@@ -70,10 +78,13 @@ export default {
7078
},
7179
computed: {
7280
isModelVersionsEmpty() {
73-
return this.modelVersions && this.modelVersions.length === 0;
81+
return this.modelVersions.length === 0;
82+
},
83+
isModelsEmpty() {
84+
return this.models.length === 0;
7485
},
7586
isListEmpty() {
76-
return this.isModelVersionsEmpty;
87+
return this.isModelVersionsEmpty && this.isModelsEmpty;
7788
},
7889
parsedQuery() {
7990
const name = this.filters
@@ -151,7 +162,8 @@ export default {
151162
/>
152163
<load-or-error-or-show :is-loading="isLoading" :error-message="errorMessage">
153164
<slot v-if="isListEmpty" name="empty-state"></slot>
154-
<model-versions-table v-else-if="modelVersions" :items="modelVersions" />
165+
<model-versions-table v-else-if="!isModelVersionsEmpty" :items="modelVersions" />
166+
<models-table v-else-if="!isModelsEmpty" :items="models" />
155167
<gl-keyset-pagination
156168
v-if="pageInfo.hasPreviousPage || pageInfo.hasNextPage"
157169
v-bind="pageInfo"

app/assets/javascripts/ml/model_registry/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const BASE_SORT_FIELDS = Object.freeze([
1212
},
1313
{
1414
orderBy: LIST_KEY_CREATED_AT,
15-
label: s__('MlExperimentTracking|Created at'),
15+
label: s__('MlExperimentTracking|Created'),
1616
},
1717
]);
1818

app/assets/javascripts/ml/model_registry/graphql/queries/get_models.query.graphql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ query getModels(
2727
name
2828
versionCount
2929
createdAt
30+
author {
31+
id
32+
name
33+
webUrl
34+
avatarUrl
35+
}
3036
latestVersion {
3137
id
3238
version

0 commit comments

Comments
 (0)