Skip to content

Commit ed7568c

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent e94d662 commit ed7568c

File tree

90 files changed

+1248
-579
lines changed

Some content is hidden

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

90 files changed

+1248
-579
lines changed

.gitpod.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
image: registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:gitpod-workspace-image
2+
3+
tasks:
4+
5+
- name: GDK
6+
command: gp sync-await gdk-copied && cd /workspace/gitlab-development-kit && gdk help
7+
8+
- init: |
9+
echo "$(date) – Copying GDK" | tee -a /workspace/startup.log
10+
mv $HOME/.rvm-workspace /workspace/.rvm
11+
cp -r $HOME/gitlab-development-kit /workspace/
12+
(
13+
set -e
14+
cd /workspace/gitlab-development-kit
15+
[[ ! -L /workspace/gitlab-development-kit/gitlab ]] && ln -fs /workspace/gitlab /workspace/gitlab-development-kit/gitlab
16+
# make webpack static, prevents that GitLab tries to connect to localhost webpack from browser outside the workspace
17+
echo "webpack:" >> gdk.yml
18+
echo " static: true" >> gdk.yml
19+
# reconfigure GDK
20+
echo "$(date) – Reconfiguring GDK" | tee -a /workspace/startup.log
21+
gdk reconfigure
22+
# run DB migrations
23+
echo "$(date) – Running DB migrations" | tee -a /workspace/startup.log
24+
make gitlab-db-migrate
25+
cd -
26+
# stop GDK
27+
echo "$(date) – Stopping GDK" | tee -a /workspace/startup.log
28+
gdk stop
29+
echo "$(date) – GDK stopped" | tee -a /workspace/startup.log
30+
)
31+
command: |
32+
(
33+
set -e
34+
gp sync-done gdk-copied
35+
SECONDS=0
36+
cd /workspace/gitlab-development-kit
37+
# update GDK
38+
if [ "$GITLAB_UPDATE_GDK" == true ]; then
39+
echo "$(date) – Updating GDK" | tee -a /workspace/startup.log
40+
gdk update
41+
fi
42+
# start GDK
43+
echo "$(date) – Starting GDK" | tee -a /workspace/startup.log
44+
export RAILS_HOSTS=$(gp url 3000 | sed -e 's+^http[s]*://++')
45+
gdk start
46+
# Run DB migrations
47+
if [ "$GITLAB_RUN_DB_MIGRATIONS" == true ]; then
48+
make gitlab-db-migrate
49+
fi
50+
# Fix DB key
51+
if [ "$GITLAB_FIX_DB_KEY" = true ]; then
52+
echo "$(date) – Fixing DB key" | tee -a /workspace/startup.log
53+
cd gitlab
54+
# see https://gitlab.com/gitlab-org/gitlab-foss/-/issues/56403#note_132515069
55+
printf 'ApplicationSetting.last.update_column(:runners_registration_token_encrypted, nil)\nexit\n' | bundle exec rails c
56+
cd -
57+
fi
58+
# Waiting for GitLab ...
59+
gp await-port 3000
60+
printf "Waiting for GitLab at $(gp url 3000) ..."
61+
until $(curl -sNL $(gp url 3000) | grep -q "GitLab"); do printf '.'; sleep 5; done && echo ""
62+
# Give Gitpod a few more seconds to set up everything ...
63+
sleep 5
64+
printf "$(date) – GitLab is up (took ~%.1f minutes)\n" "$((10*$SECONDS/60))e-1" | tee -a /workspace/startup.log
65+
gp preview $(gp url 3000) || true
66+
)
67+
68+
ports:
69+
- port: 3000 # rails-web
70+
onOpen: ignore
71+
- port: 3010 # gitlab-pages
72+
onOpen: ignore
73+
- port: 3808 # webpack
74+
onOpen: ignore
75+
- port: 5000 # auto_devops
76+
onOpen: ignore
77+
- port: 5778 # jaeger
78+
onOpen: ignore
79+
- port: 9000 # object_store / minio
80+
onOpen: ignore
81+
82+
vscode:
83+
extensions:
84+
- [email protected]:QyGBeRyslOfdRgOPRGm6PQ==
85+
- [email protected]:beIqQUhLRuJ5Vao4B2Lyng==
86+
- [email protected]:twCwOYt3/Ttfb3+iwblPDA==
87+
- [email protected]:UofirBhedyhdx/jCnPeJDg==
88+
- [email protected]:1NRvj3UKNTNwmYjptmUmIw==
89+
- [email protected]:50q1byIi4M01G9qrTCCAYQ==

.theia/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"ruby.codeCompletion": "rcodetools",
3+
"ruby.format": "standard",
4+
"ruby.intellisense": "rubyLocate",
5+
"ruby.useBundler": true,
6+
"ruby.useLanguageServer": true,
7+
"ruby.lint": {
8+
"rubocop": true,
9+
"useBundler": true
10+
}
11+
}

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
05cd75fb57f06f29978e6cc0da3f7bc35d85859f
1+
3bdd23173595a931aac476ad0c07c702c30f4391

app/assets/javascripts/behaviors/markdown/gfm_auto_complete.js

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default function initGFMInput($els) {
1414
milestones: enableGFM,
1515
mergeRequests: enableGFM,
1616
labels: enableGFM,
17-
vulnerabilities: enableGFM,
1817
});
1918
});
2019
}

app/assets/javascripts/gfm_auto_complete.js

+5-29
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { escape, template } from 'lodash';
44
import SidebarMediator from '~/sidebar/sidebar_mediator';
55
import glRegexp from './lib/utils/regexp';
66
import AjaxCache from './lib/utils/ajax_cache';
7-
import axios from '~/lib/utils/axios_utils';
87
import { spriteIcon } from './lib/utils/common_utils';
98
import * as Emoji from '~/emoji';
109

@@ -53,15 +52,13 @@ export const defaultAutocompleteConfig = {
5352
milestones: true,
5453
labels: true,
5554
snippets: true,
56-
vulnerabilities: true,
5755
};
5856

5957
class GfmAutoComplete {
6058
constructor(dataSources = {}) {
6159
this.dataSources = dataSources;
6260
this.cachedData = {};
6361
this.isLoadingData = {};
64-
this.previousQuery = '';
6562
}
6663

6764
setup(input, enableMap = defaultAutocompleteConfig) {
@@ -557,7 +554,7 @@ class GfmAutoComplete {
557554
}
558555

559556
getDefaultCallbacks() {
560-
const self = this;
557+
const fetchData = this.fetchData.bind(this);
561558

562559
return {
563560
sorter(query, items, searchKey) {
@@ -570,15 +567,7 @@ class GfmAutoComplete {
570567
},
571568
filter(query, data, searchKey) {
572569
if (GfmAutoComplete.isLoading(data)) {
573-
self.fetchData(this.$inputor, this.at);
574-
return data;
575-
}
576-
if (
577-
GfmAutoComplete.typesWithBackendFiltering.includes(GfmAutoComplete.atTypeMap[this.at]) &&
578-
self.previousQuery !== query
579-
) {
580-
self.fetchData(this.$inputor, this.at, query);
581-
self.previousQuery = query;
570+
fetchData(this.$inputor, this.at);
582571
return data;
583572
}
584573
return $.fn.atwho.default.callbacks.filter(query, data, searchKey);
@@ -626,22 +615,13 @@ class GfmAutoComplete {
626615
};
627616
}
628617

629-
fetchData($input, at, search) {
618+
fetchData($input, at) {
630619
if (this.isLoadingData[at]) return;
631620

632621
this.isLoadingData[at] = true;
633622
const dataSource = this.dataSources[GfmAutoComplete.atTypeMap[at]];
634623

635-
if (GfmAutoComplete.typesWithBackendFiltering.includes(GfmAutoComplete.atTypeMap[at])) {
636-
axios
637-
.get(dataSource, { params: { search } })
638-
.then(({ data }) => {
639-
this.loadData($input, at, data);
640-
})
641-
.catch(() => {
642-
this.isLoadingData[at] = false;
643-
});
644-
} else if (this.cachedData[at]) {
624+
if (this.cachedData[at]) {
645625
this.loadData($input, at, this.cachedData[at]);
646626
} else if (GfmAutoComplete.atTypeMap[at] === 'emojis') {
647627
this.loadEmojiData($input, at).catch(() => {});
@@ -727,8 +707,7 @@ class GfmAutoComplete {
727707
// https://github.com/ichord/At.js
728708
const atSymbolsWithBar = Object.keys(controllers)
729709
.join('|')
730-
.replace(/[$]/, '\\$&')
731-
.replace(/[+]/, '\\+');
710+
.replace(/[$]/, '\\$&');
732711
const atSymbolsWithoutBar = Object.keys(controllers).join('');
733712
const targetSubtext = subtext.split(GfmAutoComplete.regexSubtext).pop();
734713
const resultantFlag = flag.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
@@ -759,12 +738,9 @@ GfmAutoComplete.atTypeMap = {
759738
'~': 'labels',
760739
'%': 'milestones',
761740
'/': 'commands',
762-
'+': 'vulnerabilities',
763741
$: 'snippets',
764742
};
765743

766-
GfmAutoComplete.typesWithBackendFiltering = ['vulnerabilities'];
767-
768744
function findEmoji(name) {
769745
return Emoji.searchEmoji(name, { match: 'contains', raw: true }).sort((a, b) => {
770746
if (a.index !== b.index) {

app/assets/javascripts/incidents/components/incidents_list.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default {
310310
category="primary"
311311
variant="success"
312312
:href="newIncidentPath"
313-
@click="redirecting = true"
313+
@click="navigateToCreateNewIncident"
314314
>
315315
{{ $options.i18n.createIncidentBtnLabel }}
316316
</gl-button>

app/assets/javascripts/incidents/constants.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ export const INCIDENT_STATUS_TABS = [
3434
},
3535
];
3636

37+
export const DEFAULT_PAGE_SIZE = 20;
38+
export const TH_CREATED_AT_TEST_ID = { 'data-testid': 'incident-management-created-at-sort' };
39+
export const TH_SEVERITY_TEST_ID = { 'data-testid': 'incident-management-severity-sort' };
40+
export const TH_INCIDENT_SLA_TEST_ID = { 'data-testid': 'incident-management-sla' };
41+
export const TH_PUBLISHED_TEST_ID = { 'data-testid': 'incident-management-published-sort' };
42+
export const INCIDENT_DETAILS_PATH = 'incident';
43+
3744
/**
3845
* Tracks snowplow event when user clicks create new incident
3946
*/
@@ -43,16 +50,17 @@ export const trackIncidentCreateNewOptions = {
4350
};
4451

4552
/**
46-
* Tracks snowplow event when user views incident list
53+
* Tracks snowplow event when user views incidents list
4754
*/
4855
export const trackIncidentListViewsOptions = {
4956
category: 'Incident Management',
5057
action: 'view_incidents_list',
5158
};
5259

53-
export const DEFAULT_PAGE_SIZE = 20;
54-
export const TH_CREATED_AT_TEST_ID = { 'data-testid': 'incident-management-created-at-sort' };
55-
export const TH_SEVERITY_TEST_ID = { 'data-testid': 'incident-management-severity-sort' };
56-
export const TH_INCIDENT_SLA_TEST_ID = { 'data-testid': 'incident-management-sla' };
57-
export const TH_PUBLISHED_TEST_ID = { 'data-testid': 'incident-management-published-sort' };
58-
export const INCIDENT_DETAILS_PATH = 'incident';
60+
/**
61+
* Tracks snowplow event when user views incident details
62+
*/
63+
export const trackIncidentDetailsViewsOptions = {
64+
category: 'Incident Management',
65+
action: 'view_incident_details',
66+
};

app/assets/javascripts/issue_show/components/incidents/incident_tabs.vue

+11
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import HighlightBar from './highlight_bar.vue';
55
import createFlash from '~/flash';
66
import { s__ } from '~/locale';
77
import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue';
8+
import Tracking from '~/tracking';
89
910
import getAlert from './graphql/queries/get_alert.graphql';
11+
import { trackIncidentDetailsViewsOptions } from '~/incidents/constants';
1012
1113
export default {
1214
components: {
@@ -46,6 +48,15 @@ export default {
4648
return this.$apollo.queries.alert.loading;
4749
},
4850
},
51+
mounted() {
52+
this.trackPageViews();
53+
},
54+
methods: {
55+
trackPageViews() {
56+
const { category, action } = trackIncidentDetailsViewsOptions;
57+
Tracking.event(category, action);
58+
},
59+
},
4960
};
5061
</script>
5162

app/assets/javascripts/releases/mount_show.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export default () => {
1313
modules: {
1414
detail: createDetailModule(el.dataset),
1515
},
16+
featureFlags: {
17+
graphqlIndividualReleasePage: Boolean(gon.features?.graphqlIndividualReleasePage),
18+
},
1619
});
1720

1821
return new Vue({

app/assets/javascripts/releases/stores/modules/detail/actions.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import api from '~/api';
33
import { deprecatedCreateFlash as createFlash } from '~/flash';
44
import { s__ } from '~/locale';
55
import { redirectTo } from '~/lib/utils/url_utility';
6-
import { releaseToApiJson, apiJsonToRelease } from '~/releases/util';
6+
import {
7+
releaseToApiJson,
8+
apiJsonToRelease,
9+
gqClient,
10+
convertOneReleaseGraphQLResponse,
11+
} from '~/releases/util';
12+
import oneReleaseQuery from '~/releases/queries/one_release.query.graphql';
713

814
export const initializeRelease = ({ commit, dispatch, getters }) => {
915
if (getters.isExistingRelease) {
@@ -18,9 +24,29 @@ export const initializeRelease = ({ commit, dispatch, getters }) => {
1824
return Promise.resolve();
1925
};
2026

21-
export const fetchRelease = ({ commit, state }) => {
27+
export const fetchRelease = ({ commit, state, rootState }) => {
2228
commit(types.REQUEST_RELEASE);
2329

30+
if (rootState.featureFlags?.graphqlIndividualReleasePage) {
31+
return gqClient
32+
.query({
33+
query: oneReleaseQuery,
34+
variables: {
35+
fullPath: state.projectPath,
36+
tagName: state.tagName,
37+
},
38+
})
39+
.then(response => {
40+
const { data: release } = convertOneReleaseGraphQLResponse(response);
41+
42+
commit(types.RECEIVE_RELEASE_SUCCESS, release);
43+
})
44+
.catch(error => {
45+
commit(types.RECEIVE_RELEASE_ERROR, error);
46+
createFlash(s__('Release|Something went wrong while getting the release details'));
47+
});
48+
}
49+
2450
return api
2551
.release(state.projectId, state.tagName)
2652
.then(({ data }) => {

app/assets/javascripts/releases/stores/modules/detail/state.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default ({
22
projectId,
3+
projectPath,
34
markdownDocsPath,
45
markdownPreviewPath,
56
updateReleaseApiDocsPath,
@@ -12,6 +13,7 @@ export default ({
1213
defaultBranch = null,
1314
}) => ({
1415
projectId,
16+
projectPath,
1517
markdownDocsPath,
1618
markdownPreviewPath,
1719
updateReleaseApiDocsPath,

app/assets/javascripts/shared/milestones/form.js

-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ export default (initGFM = true) => {
1616
milestones: initGFM,
1717
labels: initGFM,
1818
snippets: initGFM,
19-
vulnerabilities: initGFM,
2019
});
2120
};

0 commit comments

Comments
 (0)