Skip to content

Commit 77e516b

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 20d3e87 commit 77e516b

File tree

49 files changed

+8930
-183
lines changed

Some content is hidden

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

49 files changed

+8930
-183
lines changed

.rubocop_todo/layout/space_inside_parens.yml

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ Layout/SpaceInsideParens:
8080
- 'ee/spec/support/shared_examples/models/concerns/blob_replicator_strategy_shared_examples.rb'
8181
- 'ee/spec/support/shared_examples/services/geo/geo_request_service_shared_examples.rb'
8282
- 'ee/spec/workers/elastic/migration_worker_spec.rb'
83-
- 'ee/spec/workers/security/auto_fix_worker_spec.rb'
8483
- 'qa/qa/page/group/settings/group_deploy_tokens.rb'
8584
- 'qa/qa/specs/features/ee/browser_ui/10_govern/scan_result_policy_vulnerabilities_spec.rb'
8685
- 'qa/qa/tools/delete_subgroups.rb'

.rubocop_todo/rspec/any_instance_of.yml

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ RSpec/AnyInstanceOf:
5858
- 'ee/spec/workers/geo/registry_sync_worker_spec.rb'
5959
- 'ee/spec/workers/project_cache_worker_spec.rb'
6060
- 'ee/spec/workers/repository_import_worker_spec.rb'
61-
- 'ee/spec/workers/security/auto_fix_worker_spec.rb'
6261
- 'ee/spec/workers/vulnerability_exports/export_deletion_worker_spec.rb'
6362
- 'spec/controllers/admin/sessions_controller_spec.rb'
6463
- 'spec/controllers/application_controller_spec.rb'

.rubocop_todo/rspec/named_subject.yml

-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ RSpec/NamedSubject:
702702
- 'ee/spec/models/vulnerabilities/finding_spec.rb'
703703
- 'ee/spec/models/vulnerabilities/state_transition_spec.rb'
704704
- 'ee/spec/models/weight_note_spec.rb'
705-
- 'ee/spec/models/zoekt/indexed_namespace_spec.rb'
706705
- 'ee/spec/policies/epic_policy_spec.rb'
707706
- 'ee/spec/policies/group_policy_spec.rb'
708707
- 'ee/spec/policies/merge_request_policy_spec.rb'

.rubocop_todo/search/namespaced_class.yml

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Search/NamespacedClass:
3838
- 'ee/app/models/elastic/reindexing_task.rb'
3939
- 'ee/app/models/elasticsearch_indexed_namespace.rb'
4040
- 'ee/app/models/elasticsearch_indexed_project.rb'
41-
- 'ee/app/models/zoekt/indexed_namespace.rb'
4241
- 'ee/app/presenters/ee/search_service_presenter.rb'
4342
- 'ee/app/services/ee/search_service.rb'
4443
- 'ee/app/services/elastic/bookkeeping_shard_service.rb'

DEI.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The DEI.md file was originally created in the CHAOSS project. This comment provi
88
Please use the DEI.md Guide at https://github.com/badging/ProjectBadging/blob/main/Guide.DEI.md when creating your DEI.md file
99
-->
1010

11+
![CHAOSS DEI Bronze Badge](https://images.ctfassets.net/xz1dnu24egyd/5qxlqiIMLUYwuinHpFm67P/edc10e44c37235cef20c0f910a947669/dei-bronze-badge.svg)
12+
1113
## GitLab
1214

1315
The scope of this DEI.md file is intended to cover the entire organization of GitLab. Any specific differences for a particular GitLab project may be noted within this document.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<script>
2+
import {
3+
GlBadge,
4+
GlIcon,
5+
GlLink,
6+
GlSkeletonLoader,
7+
GlSprintf,
8+
GlTooltipDirective as GlTooltip,
9+
} from '@gitlab/ui';
10+
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
11+
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
12+
import { s__, __ } from '~/locale';
13+
import DeploymentStatusLink from '~/environments/environment_details/components/deployment_status_link.vue';
14+
import DeploymentCommit from '~/environments/components/commit.vue';
15+
import { FINISHED_STATUSES } from '../utils';
16+
17+
export default {
18+
components: {
19+
GlBadge,
20+
GlIcon,
21+
GlLink,
22+
GlSkeletonLoader,
23+
GlSprintf,
24+
ClipboardButton,
25+
TimeAgoTooltip,
26+
DeploymentStatusLink,
27+
DeploymentCommit,
28+
},
29+
directives: {
30+
GlTooltip,
31+
},
32+
props: {
33+
deployment: {
34+
required: true,
35+
type: Object,
36+
},
37+
environment: {
38+
required: true,
39+
type: Object,
40+
},
41+
loading: {
42+
required: false,
43+
default: false,
44+
type: Boolean,
45+
},
46+
},
47+
computed: {
48+
iid() {
49+
return this.deployment.iid;
50+
},
51+
status() {
52+
return this.deployment.status?.toLowerCase() ?? '';
53+
},
54+
job() {
55+
return this.deployment.job;
56+
},
57+
needsApproval() {
58+
return (
59+
!this.isFinished(this.deployment.status) &&
60+
this.deployment.approvalSummary?.status === 'PENDING_APPROVAL'
61+
);
62+
},
63+
environmentName() {
64+
return this.environment.name;
65+
},
66+
environmentPath() {
67+
return this.environment.path;
68+
},
69+
commit() {
70+
return this.deployment.commit || {};
71+
},
72+
commitPath() {
73+
return this.deployment.commit.webUrl || '';
74+
},
75+
shortSha() {
76+
return this.deployment.commit?.shortId;
77+
},
78+
createdAt() {
79+
return this.deployment.createdAt || '';
80+
},
81+
finishedAt() {
82+
return this.deployment.finishedAt || '';
83+
},
84+
triggerer() {
85+
return this.deployment.triggerer;
86+
},
87+
triggererUsername() {
88+
return this.triggerer?.username;
89+
},
90+
triggererUrl() {
91+
return this.triggerer?.webUrl;
92+
},
93+
timeagoText() {
94+
return this.isFinished(this.deployment.status)
95+
? this.$options.i18n.finishedTimeagoText
96+
: this.$options.i18n.startedTimeagoText;
97+
},
98+
timeagoTime() {
99+
return this.isFinished(this.deployment.status) ? this.finishedAt : this.createdAt;
100+
},
101+
},
102+
methods: {
103+
isFinished(status) {
104+
return FINISHED_STATUSES.includes(status);
105+
},
106+
},
107+
i18n: {
108+
copyButton: __('Copy commit SHA'),
109+
needsApproval: s__('Deployment|Needs Approval'),
110+
startedTimeagoText: s__('Deployment|Started %{timeago} by %{username}'),
111+
finishedTimeagoText: s__('Deployment|Finished %{timeago} by %{username}'),
112+
},
113+
};
114+
</script>
115+
<template>
116+
<div v-if="loading" class="gl-mt-4">
117+
<gl-skeleton-loader class="gl-mt-3" :height="20" viewbox="0 0 400 20">
118+
<rect width="26" height="8" rx="4" />
119+
<rect width="26" x="28" height="8" rx="4" />
120+
<rect width="36" x="56" height="8" rx="4" />
121+
<rect width="82" x="94" height="8" rx="4" />
122+
<rect width="176" y="10" height="8" rx="4" />
123+
</gl-skeleton-loader>
124+
</div>
125+
<div v-else>
126+
<div class="gl-display-flex gl-gap-3 gl-mb-3 gl-align-items-center">
127+
<deployment-status-link :status="status" :deployment-job="job" />
128+
<gl-badge v-if="needsApproval" variant="warning">
129+
{{ $options.i18n.needsApproval }}
130+
</gl-badge>
131+
<div class="gl-display-flex gl-align-items-center">
132+
<gl-icon name="environment" class="gl-mr-2" />
133+
<gl-link :href="environmentPath">{{ environmentName }}</gl-link>
134+
</div>
135+
<div v-if="shortSha" class="gl-font-monospace gl-display-flex gl-align-items-center">
136+
<gl-icon ref="deployment-commit-icon" name="commit" class="gl-mr-2" />
137+
<gl-link v-gl-tooltip :title="$options.i18n.commitSha" :href="commitPath">
138+
{{ shortSha }}
139+
</gl-link>
140+
<clipboard-button
141+
:text="shortSha"
142+
category="tertiary"
143+
:title="$options.i18n.copyButton"
144+
size="small"
145+
/>
146+
</div>
147+
<time-ago-tooltip
148+
v-if="timeagoTime"
149+
:time="timeagoTime"
150+
class="gl-display-flex gl-align-items-center"
151+
>
152+
<template #default="{ timeAgo }">
153+
<gl-icon name="calendar" class="gl-mr-2" />
154+
<span class="gl-mr-2 gl-white-space-nowrap">
155+
<gl-sprintf :message="timeagoText">
156+
<template #timeago>{{ timeAgo }}</template>
157+
<template #username>
158+
<gl-link :href="triggererUrl">@{{ triggererUsername }}</gl-link>
159+
</template>
160+
</gl-sprintf>
161+
</span>
162+
</template>
163+
</time-ago-tooltip>
164+
</div>
165+
<deployment-commit :commit="commit" />
166+
</div>
167+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<script>
2+
import { GlAlert, GlSprintf } from '@gitlab/ui';
3+
import { captureException } from '~/sentry/sentry_browser_wrapper';
4+
import { s__ } from '~/locale';
5+
import deploymentQuery from '../graphql/queries/deployment.query.graphql';
6+
import environmentQuery from '../graphql/queries/environment.query.graphql';
7+
import DeploymentHeader from './deployment_header.vue';
8+
9+
export default {
10+
components: {
11+
GlAlert,
12+
GlSprintf,
13+
DeploymentHeader,
14+
},
15+
inject: ['projectPath', 'deploymentIid', 'environmentName'],
16+
apollo: {
17+
deployment: {
18+
query: deploymentQuery,
19+
variables() {
20+
return { fullPath: this.projectPath, iid: this.deploymentIid };
21+
},
22+
update(data) {
23+
return data?.project?.deployment;
24+
},
25+
error(error) {
26+
captureException(error);
27+
this.errorMessage = this.$options.i18n.errorMessage;
28+
},
29+
},
30+
environment: {
31+
query: environmentQuery,
32+
variables() {
33+
return { fullPath: this.projectPath, name: this.environmentName };
34+
},
35+
update(data) {
36+
return data?.project?.environment;
37+
},
38+
error(error) {
39+
captureException(error);
40+
this.errorMessage = this.$options.i18n.errorMessage;
41+
},
42+
},
43+
},
44+
data() {
45+
return { deployment: {}, environment: {}, errorMessage: '' };
46+
},
47+
computed: {
48+
hasError() {
49+
return Boolean(this.errorMessage);
50+
},
51+
},
52+
i18n: {
53+
header: s__('Deployment|Deployment #%{iid}'),
54+
errorMessage: s__(
55+
'Deployment|There was an issue fetching the deployment, please try again later.',
56+
),
57+
},
58+
};
59+
</script>
60+
<template>
61+
<div>
62+
<h1 class="page-title gl-font-size-h-display">
63+
<gl-sprintf :message="$options.i18n.header">
64+
<template #iid>{{ deploymentIid }}</template>
65+
</gl-sprintf>
66+
</h1>
67+
<gl-alert v-if="hasError" variant="danger">{{ errorMessage }}</gl-alert>
68+
<deployment-header
69+
v-else
70+
:deployment="deployment"
71+
:environment="environment"
72+
:loading="$apollo.queries.deployment.loading"
73+
/>
74+
</div>
75+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fragment ApprovalSummary on Deployment {
2+
iid
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#import "~/graphql_shared/fragments/user.fragment.graphql"
2+
#import "~/environments/graphql/fragments/deployment_job.fragment.graphql"
3+
#import "ee_else_ce/deployments/graphql/fragments/approval_summary.fragment.graphql"
4+
5+
query fetchDeployment($fullPath: ID!, $iid: ID!) {
6+
project(fullPath: $fullPath) {
7+
id
8+
deployment(iid: $iid) {
9+
id
10+
...ApprovalSummary
11+
status
12+
ref
13+
tag
14+
job {
15+
...DeploymentJob
16+
deploymentPipeline: pipeline {
17+
id
18+
jobs(whenExecuted: ["manual"], retried: false) {
19+
nodes {
20+
...DeploymentJob
21+
scheduledAt
22+
}
23+
}
24+
}
25+
}
26+
commit {
27+
id
28+
shortId
29+
message
30+
webUrl
31+
authorGravatar
32+
authorName
33+
authorEmail
34+
author {
35+
...User
36+
}
37+
}
38+
triggerer {
39+
...User
40+
}
41+
createdAt
42+
finishedAt
43+
}
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
query fetchEnvironment($fullPath: ID!, $name: String!) {
2+
project(fullPath: $fullPath) {
3+
id
4+
environment(name: $name) {
5+
id
6+
name
7+
path
8+
}
9+
}
10+
}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import Vue from 'vue';
2+
import VueApollo from 'vue-apollo';
3+
import createDefaultClient from '~/lib/graphql';
4+
import ShowDeployment from './components/show_deployment.vue';
5+
6+
Vue.use(VueApollo);
7+
8+
export const initializeShowDeployment = (selector = 'js-deployment-details') => {
9+
const el = document.getElementById(selector);
10+
if (el) {
11+
const apolloProvider = new VueApollo({
12+
defaultClient: createDefaultClient(),
13+
});
14+
const { projectPath, deploymentIid, environmentName } = el.dataset;
15+
16+
return new Vue({
17+
el,
18+
apolloProvider,
19+
provide: {
20+
projectPath,
21+
deploymentIid,
22+
environmentName,
23+
},
24+
render(h) {
25+
return h(ShowDeployment);
26+
},
27+
});
28+
}
29+
30+
return null;
31+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const STATUSES = ['RUNNING', 'SUCCESS', 'FAILED', 'CANCELED', 'BLOCKED'];
2+
export const FINISHED_STATUSES = ['SUCCESS', 'FAILED', 'CANCELED'];
3+
export const UPCOMING_STATUSES = ['RUNNING', 'BLOCKED'];

app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default (
3333
type: 'string',
3434
param: '',
3535
symbol: '',
36-
icon: 'admin',
36+
icon: 'pencil-square',
3737
tag: __('Yes or No'),
3838
lowercaseValueOnSubmit: true,
3939
capitalizeTokenValue: true,
@@ -198,7 +198,7 @@ export default (
198198
type: 'string',
199199
param: '',
200200
symbol: '',
201-
icon: 'cloud-gear',
201+
icon: 'environment',
202202
tag: 'environment',
203203
};
204204

0 commit comments

Comments
 (0)