summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab/issue_templates/Security Developer Workflow.md4
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/actions.vue58
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/message_field.vue130
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue88
-rw-r--r--app/assets/javascripts/ide/components/repo_commit_section.vue30
-rw-r--r--app/assets/javascripts/ide/constants.js3
-rw-r--r--app/assets/javascripts/ide/stores/actions/project.js100
-rw-r--r--app/assets/stylesheets/pages/repo.scss76
-rw-r--r--app/controllers/application_controller.rb1
-rw-r--r--app/controllers/concerns/notes_actions.rb4
-rw-r--r--app/controllers/dashboard/todos_controller.rb2
-rw-r--r--app/controllers/groups/variables_controller.rb2
-rw-r--r--app/controllers/groups_controller.rb2
-rw-r--r--app/controllers/projects/merge_requests_controller.rb4
-rw-r--r--app/controllers/projects/variables_controller.rb2
-rw-r--r--app/controllers/projects_controller.rb2
-rw-r--r--app/controllers/users_controller.rb2
-rw-r--r--app/helpers/blob_helper.rb2
-rw-r--r--app/helpers/diff_helper.rb2
-rw-r--r--app/helpers/safe_params_helper.rb11
-rw-r--r--app/mailers/emails/issues.rb6
-rw-r--r--app/models/ci/build.rb8
-rw-r--r--app/models/commit_status.rb2
-rw-r--r--app/models/concerns/cache_markdown_field.rb30
-rw-r--r--app/models/issue.rb1
-rw-r--r--app/models/notification_recipient.rb12
-rw-r--r--app/models/notification_setting.rb3
-rw-r--r--app/models/project.rb2
-rw-r--r--app/services/ci/register_job_service.rb23
-rw-r--r--app/services/clusters/gcp/verify_provision_status_service.rb2
-rw-r--r--app/services/create_deployment_service.rb4
-rw-r--r--app/services/import_export_clean_up_service.rb2
-rw-r--r--app/services/notification_recipient_service.rb11
-rw-r--r--app/services/notification_service.rb14
-rw-r--r--app/services/projects/destroy_service.rb2
-rw-r--r--app/services/repository_archive_clean_up_service.rb2
-rw-r--r--app/services/system_note_service.rb2
-rw-r--r--app/services/test_hooks/base_service.rb2
-rw-r--r--app/views/dashboard/issues.atom.builder2
-rw-r--r--app/views/dashboard/issues.html.haml4
-rw-r--r--app/views/groups/issues.atom.builder2
-rw-r--r--app/views/groups/issues.html.haml2
-rw-r--r--app/views/layouts/mailer.text.erb2
-rw-r--r--app/views/layouts/notify.text.erb2
-rw-r--r--app/views/notify/issue_due_email.html.haml12
-rw-r--r--app/views/notify/issue_due_email.text.erb7
-rw-r--r--app/views/projects/blob/_viewer.html.haml2
-rw-r--r--app/views/projects/branches/_branch.html.haml2
-rw-r--r--app/views/projects/diffs/_collapsed.html.haml2
-rw-r--r--app/views/projects/issues/_nav_btns.html.haml2
-rw-r--r--app/views/projects/issues/index.atom.builder2
-rw-r--r--app/views/projects/issues/index.html.haml2
-rw-r--r--app/views/projects/merge_requests/creations/_new_compare.html.haml2
-rw-r--r--app/views/projects/merge_requests/creations/_new_submit.html.haml8
-rw-r--r--app/workers/all_queues.yml3
-rw-r--r--app/workers/concerns/mail_scheduler_queue.rb7
-rw-r--r--app/workers/issue_due_scheduler_worker.rb10
-rw-r--r--app/workers/mail_scheduler/issue_due_worker.rb14
-rw-r--r--app/workers/post_receive.rb2
-rw-r--r--app/workers/stuck_ci_jobs_worker.rb2
-rw-r--r--changelogs/unreleased/16957-issue-due-email.yml5
-rw-r--r--changelogs/unreleased/40402-time-estimate-system-notes-can-be-confusing.yml5
-rw-r--r--changelogs/unreleased/42543-hide-divergence-graph-on-branches-for-mobile.yml5
-rw-r--r--changelogs/unreleased/42889-avoid-return-inside-block.yml5
-rw-r--r--changelogs/unreleased/43617-mailsig.yml5
-rw-r--r--changelogs/unreleased/44981-http-io-trace-with-multi-byte-char.yml5
-rw-r--r--changelogs/unreleased/improve-jobs-queuing-time-metric.yml5
-rw-r--r--changelogs/unreleased/zj-ref-exists-opt-out.yml5
-rw-r--r--config/initializers/1_settings.rb4
-rw-r--r--config/sidekiq_queues.yml1
-rw-r--r--db/migrate/20180330121048_add_issue_due_to_notification_settings.rb9
-rw-r--r--db/schema.rb1
-rw-r--r--doc/README.md1
-rw-r--r--doc/administration/index.md2
-rw-r--r--doc/api/notification_settings.md4
-rw-r--r--doc/development/background_migrations.md15
-rw-r--r--doc/development/doc_styleguide.md33
-rw-r--r--doc/user/group/index.md11
-rw-r--r--doc/user/project/index.md6
-rw-r--r--doc/user/project/issues/due_dates.md4
-rw-r--r--doc/user/project/issues/issues_functionalities.md10
-rw-r--r--doc/user/project/labels.md3
-rw-r--r--doc/user/project/merge_requests/index.md12
-rw-r--r--doc/user/project/settings/index.md2
-rw-r--r--doc/user/project/web_ide/index.md7
-rw-r--r--doc/workflow/notifications.md14
-rw-r--r--lib/api/discussions.rb10
-rw-r--r--lib/api/group_variables.rb4
-rw-r--r--lib/api/internal.rb10
-rw-r--r--lib/api/issues.rb2
-rw-r--r--lib/api/job_artifacts.rb2
-rw-r--r--lib/api/jobs.rb4
-rw-r--r--lib/api/project_snippets.rb2
-rw-r--r--lib/api/projects.rb2
-rw-r--r--lib/api/runner.rb6
-rw-r--r--lib/api/snippets.rb8
-rw-r--r--lib/api/triggers.rb8
-rw-r--r--lib/api/v3/builds.rb8
-rw-r--r--lib/api/v3/projects.rb2
-rw-r--r--lib/api/v3/snippets.rb6
-rw-r--r--lib/api/v3/triggers.rb4
-rw-r--r--lib/api/variables.rb4
-rw-r--r--lib/declarative_policy/runner.rb2
-rw-r--r--lib/gitlab/auth.rb2
-rw-r--r--lib/gitlab/ci/trace.rb2
-rw-r--r--lib/gitlab/ci/trace/http_io.rb22
-rw-r--r--lib/gitlab/ci/trace/stream.rb6
-rw-r--r--lib/gitlab/daemon.rb4
-rw-r--r--lib/gitlab/gfm/uploads_rewriter.rb2
-rw-r--r--lib/gitlab/git/commit.rb2
-rw-r--r--lib/gitlab/git/diff.rb2
-rw-r--r--lib/gitlab/git/popen.rb4
-rw-r--r--lib/gitlab/git/repository.rb3
-rw-r--r--lib/gitlab/git/repository_mirroring.rb2
-rw-r--r--lib/gitlab/optimistic_locking.rb19
-rw-r--r--lib/gitlab/shell.rb2
-rw-r--r--lib/gitlab/sidekiq_middleware/shutdown.rb2
-rw-r--r--lib/tasks/gitlab/storage.rake4
-rw-r--r--qa/qa/factory/base.rb2
-rw-r--r--qa/qa/page/group/show.rb2
-rw-r--r--qa/qa/page/project/pipeline/show.rb4
-rw-r--r--qa/qa/scenario/template.rb2
-rw-r--r--rubocop/cop/avoid_break_from_strong_memoize.rb48
-rw-r--r--rubocop/cop/avoid_return_from_blocks.rb77
-rw-r--r--rubocop/cop/migration/safer_boolean_column.rb4
-rw-r--r--rubocop/rubocop.rb2
-rw-r--r--spec/factories/ci/builds.rb1
-rw-r--r--spec/fixtures/trace/sample_trace3480
-rw-r--r--spec/javascripts/ide/components/commit_sidebar/message_field_spec.js174
-rw-r--r--spec/javascripts/ide/components/commit_sidebar/radio_group_spec.js13
-rw-r--r--spec/lib/banzai/object_renderer_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/trace_spec.rb2
-rw-r--r--spec/lib/gitlab/shell_spec.rb2
-rw-r--r--spec/models/ci/build_spec.rb4
-rw-r--r--spec/models/commit_spec.rb5
-rw-r--r--spec/models/commit_status_spec.rb32
-rw-r--r--spec/models/concerns/cache_markdown_field_spec.rb183
-rw-r--r--spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb74
-rw-r--r--spec/rubocop/cop/avoid_return_from_blocks_spec.rb127
-rw-r--r--spec/services/ci/register_job_service_spec.rb105
-rw-r--r--spec/services/notification_service_spec.rb40
-rw-r--r--spec/services/system_note_service_spec.rb8
-rw-r--r--spec/support/http_io/http_io_helpers.rb3
-rw-r--r--spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb2
-rw-r--r--spec/workers/issue_due_scheduler_worker_spec.rb22
-rw-r--r--spec/workers/mail_scheduler/issue_due_worker_spec.rb21
146 files changed, 4482 insertions, 1046 deletions
diff --git a/.gitlab/issue_templates/Security Developer Workflow.md b/.gitlab/issue_templates/Security Developer Workflow.md
index ebf8ebd029a..8dd447ed121 100644
--- a/.gitlab/issue_templates/Security Developer Workflow.md
+++ b/.gitlab/issue_templates/Security Developer Workflow.md
@@ -36,6 +36,7 @@ Set the title to: `[Security] Description of the original issue`
- [ ] Find out the versions affected (the Git history of the files affected may help you with this) and add them to the [details section](#details)
- [ ] Fill in any upgrade notes that users may need to take into account in the [details section](#details)
- [ ] Add Yes/No and further details if needed to the migration and settings columns in the [details section](#details)
+- [ ] Add the nickname of the external user who found the issue (and/or HackerOne profile) to the Thanks row in the [details section](#details)
### Summary
#### Links
@@ -61,8 +62,9 @@ Set the title to: `[Security] Description of the original issue`
| Upgrade notes | | |
| GitLab Settings updated | Yes/No| |
| Migration required | Yes/No | |
+| Thanks | | |
-[security process for developers]: https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/process.md
+[security process for developers]: https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md
[RM list]: https://about.gitlab.com/release-managers/
/label ~security
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue
index 2cbd982af19..45321df191c 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue
@@ -1,41 +1,27 @@
<script>
- import { mapState } from 'vuex';
- import { sprintf, __ } from '~/locale';
- import * as consts from '../../stores/modules/commit/constants';
- import RadioGroup from './radio_group.vue';
+import { mapState } from 'vuex';
+import { sprintf, __ } from '~/locale';
+import * as consts from '../../stores/modules/commit/constants';
+import RadioGroup from './radio_group.vue';
- export default {
- components: {
- RadioGroup,
+export default {
+ components: {
+ RadioGroup,
+ },
+ computed: {
+ ...mapState(['currentBranchId']),
+ commitToCurrentBranchText() {
+ return sprintf(
+ __('Commit to %{branchName} branch'),
+ { branchName: `<strong class="monospace">${this.currentBranchId}</strong>` },
+ false,
+ );
},
- computed: {
- ...mapState([
- 'currentBranchId',
- ]),
- newMergeRequestHelpText() {
- return sprintf(
- __('Creates a new branch from %{branchName} and re-directs to create a new merge request'),
- { branchName: this.currentBranchId },
- );
- },
- commitToCurrentBranchText() {
- return sprintf(
- __('Commit to %{branchName} branch'),
- { branchName: `<strong>${this.currentBranchId}</strong>` },
- false,
- );
- },
- commitToNewBranchText() {
- return sprintf(
- __('Creates a new branch from %{branchName}'),
- { branchName: this.currentBranchId },
- );
- },
- },
- commitToCurrentBranch: consts.COMMIT_TO_CURRENT_BRANCH,
- commitToNewBranch: consts.COMMIT_TO_NEW_BRANCH,
- commitToNewBranchMR: consts.COMMIT_TO_NEW_BRANCH_MR,
- };
+ },
+ commitToCurrentBranch: consts.COMMIT_TO_CURRENT_BRANCH,
+ commitToNewBranch: consts.COMMIT_TO_NEW_BRANCH,
+ commitToNewBranchMR: consts.COMMIT_TO_NEW_BRANCH_MR,
+};
</script>
<template>
@@ -53,13 +39,11 @@
:value="$options.commitToNewBranch"
:label="__('Create a new branch')"
:show-input="true"
- :help-text="commitToNewBranchText"
/>
<radio-group
:value="$options.commitToNewBranchMR"
:label="__('Create a new branch and merge request')"
:show-input="true"
- :help-text="newMergeRequestHelpText"
/>
</div>
</template>
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue b/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue
new file mode 100644
index 00000000000..dcd934f76b7
--- /dev/null
+++ b/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue
@@ -0,0 +1,130 @@
+<script>
+import { __, sprintf } from '../../../locale';
+import Icon from '../../../vue_shared/components/icon.vue';
+import popover from '../../../vue_shared/directives/popover';
+import { MAX_TITLE_LENGTH, MAX_BODY_LENGTH } from '../../constants';
+
+export default {
+ directives: {
+ popover,
+ },
+ components: {
+ Icon,
+ },
+ props: {
+ text: {
+ type: String,
+ required: true,
+ },
+ },
+ data() {
+ return {
+ scrollTop: 0,
+ isFocused: false,
+ };
+ },
+ computed: {
+ allLines() {
+ return this.text.split('\n').map((line, i) => ({
+ text: line.substr(0, this.getLineLength(i)) || ' ',
+ highlightedText: line.substr(this.getLineLength(i)),
+ }));
+ },
+ },
+ methods: {
+ handleScroll() {
+ if (this.$refs.textarea) {
+ this.$nextTick(() => {
+ this.scrollTop = this.$refs.textarea.scrollTop;
+ });
+ }
+ },
+ getLineLength(i) {
+ return i === 0 ? MAX_TITLE_LENGTH : MAX_BODY_LENGTH;
+ },
+ onInput(e) {
+ this.$emit('input', e.target.value);
+ },
+ updateIsFocused(isFocused) {
+ this.isFocused = isFocused;
+ },
+ },
+ popoverOptions: {
+ trigger: 'hover',
+ placement: 'top',
+ content: sprintf(
+ __(`
+ The character highligher helps you keep the subject line to %{titleLength} characters
+ and wrap the body at %{bodyLength} so they are readable in git.
+ `),
+ { titleLength: MAX_TITLE_LENGTH, bodyLength: MAX_BODY_LENGTH },
+ ),
+ },
+};
+</script>
+
+<template>
+ <fieldset class="common-note-form ide-commit-message-field">
+ <div
+ class="md-area"
+ :class="{
+ 'is-focused': isFocused
+ }"
+ >
+ <div
+ v-once
+ class="md-header"
+ >
+ <ul class="nav-links">
+ <li>
+ {{ __('Commit Message') }}
+ <span
+ v-popover="$options.popoverOptions"
+ class="help-block prepend-left-10"
+ >
+ <icon
+ name="question"
+ />
+ </span>
+ </li>
+ </ul>
+ </div>
+ <div class="ide-commit-message-textarea-container">
+ <div class="ide-commit-message-highlights-container">
+ <div
+ class="note-textarea highlights monospace"
+ :style="{
+ transform: `translate3d(0, ${-scrollTop}px, 0)`
+ }"
+ >
+ <div
+ v-for="(line, index) in allLines"
+ :key="index"
+ >
+ <span
+ v-text="line.text"
+ >
+ </span><mark
+ v-show="line.highlightedText"
+ v-text="line.highlightedText"
+ >
+ </mark>
+ </div>
+ </div>
+ </div>
+ <textarea
+ class="note-textarea ide-commit-message-textarea"
+ name="commit-message"
+ :placeholder="__('Write a commit message...')"
+ :value="text"
+ @scroll="handleScroll"
+ @input="onInput"
+ @focus="updateIsFocused(true)"
+ @blur="updateIsFocused(false)"
+ ref="textarea"
+ >
+ </textarea>
+ </div>
+ </div>
+ </fieldset>
+</template>
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue b/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
index 4310d762c78..b660a2961cb 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
@@ -1,52 +1,40 @@
<script>
- import { mapActions, mapState, mapGetters } from 'vuex';
- import tooltip from '~/vue_shared/directives/tooltip';
+import { mapActions, mapState, mapGetters } from 'vuex';
+import tooltip from '~/vue_shared/directives/tooltip';
- export default {
- directives: {
- tooltip,
+export default {
+ directives: {
+ tooltip,
+ },
+ props: {
+ value: {
+ type: String,
+ required: true,
},
- props: {
- value: {
- type: String,
- required: true,
- },
- label: {
- type: String,
- required: false,
- default: null,
- },
- checked: {
- type: Boolean,
- required: false,
- default: false,
- },
- showInput: {
- type: Boolean,
- required: false,
- default: false,
- },
- helpText: {
- type: String,
- required: false,
- default: null,
- },
+ label: {
+ type: String,
+ required: false,
+ default: null,
},
- computed: {
- ...mapState('commit', [
- 'commitAction',
- ]),
- ...mapGetters('commit', [
- 'newBranchName',
- ]),
+ checked: {
+ type: Boolean,
+ required: false,
+ default: false,
},
- methods: {
- ...mapActions('commit', [
- 'updateCommitAction',
- 'updateBranchName',
- ]),
+ showInput: {
+ type: Boolean,
+ required: false,
+ default: false,
},
- };
+ },
+ computed: {
+ ...mapState('commit', ['commitAction']),
+ ...mapGetters('commit', ['newBranchName']),
+ },
+ methods: {
+ ...mapActions('commit', ['updateCommitAction', 'updateBranchName']),
+ },
+};
</script>
<template>
@@ -65,18 +53,6 @@
{{ label }}
</template>
<slot v-else></slot>
- <span
- v-if="helpText"
- v-tooltip
- class="help-block inline"
- :title="helpText"
- >
- <i
- class="fa fa-question-circle"
- aria-hidden="true"
- >
- </i>
- </span>
</span>
</label>
<div
@@ -85,7 +61,7 @@
>
<input
type="text"
- class="form-control"
+ class="form-control monospace"
:placeholder="newBranchName"
@input="updateBranchName($event.target.value)"
/>
diff --git a/app/assets/javascripts/ide/components/repo_commit_section.vue b/app/assets/javascripts/ide/components/repo_commit_section.vue
index 121babf1b2b..1e4adf1a373 100644
--- a/app/assets/javascripts/ide/components/repo_commit_section.vue
+++ b/app/assets/javascripts/ide/components/repo_commit_section.vue
@@ -5,6 +5,7 @@ import icon from '~/vue_shared/components/icon.vue';
import DeprecatedModal from '~/vue_shared/components/deprecated_modal.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import commitFilesList from './commit_sidebar/list.vue';
+import CommitMessageField from './commit_sidebar/message_field.vue';
import * as consts from '../stores/modules/commit/constants';
import Actions from './commit_sidebar/actions.vue';
@@ -15,6 +16,7 @@ export default {
commitFilesList,
Actions,
LoadingButton,
+ CommitMessageField,
},
directives: {
tooltip,
@@ -38,15 +40,9 @@ export default {
'changedFiles',
]),
...mapState('commit', ['commitMessage', 'submitCommitLoading']),
- ...mapGetters('commit', [
- 'commitButtonDisabled',
- 'discardDraftButtonDisabled',
- 'branchName',
- ]),
+ ...mapGetters('commit', ['commitButtonDisabled', 'discardDraftButtonDisabled', 'branchName']),
statusSvg() {
- return this.lastCommitMsg
- ? this.committedStateSvgPath
- : this.noChangesStateSvgPath;
+ return this.lastCommitMsg ? this.committedStateSvgPath : this.noChangesStateSvgPath;
},
},
methods: {
@@ -64,9 +60,7 @@ export default {
});
},
forceCreateNewBranch() {
- return this.updateCommitAction(consts.COMMIT_TO_NEW_BRANCH).then(() =>
- this.commitChanges(),
- );
+ return this.updateCommitAction(consts.COMMIT_TO_NEW_BRANCH).then(() => this.commitChanges());
},
},
};
@@ -105,16 +99,10 @@ export default {
@submit.prevent.stop="commitChanges"
v-if="!rightPanelCollapsed"
>
- <div class="multi-file-commit-fieldset">
- <textarea
- class="form-control multi-file-commit-message"
- name="commit-message"
- :value="commitMessage"
- :placeholder="__('Write a commit message...')"
- @input="updateCommitMessage($event.target.value)"
- >
- </textarea>
- </div>
+ <commit-message-field
+ :text="commitMessage"
+ @input="updateCommitMessage"
+ />
<div class="clearfix prepend-top-15">
<actions />
<loading-button
diff --git a/app/assets/javascripts/ide/constants.js b/app/assets/javascripts/ide/constants.js
new file mode 100644
index 00000000000..b60d042e0be
--- /dev/null
+++ b/app/assets/javascripts/ide/constants.js
@@ -0,0 +1,3 @@
+// Fuzzy file finder
+export const MAX_TITLE_LENGTH = 50;
+export const MAX_BODY_LENGTH = 72;
diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js
index b3882cb8d21..4eb23b2ee0f 100644
--- a/app/assets/javascripts/ide/stores/actions/project.js
+++ b/app/assets/javascripts/ide/stores/actions/project.js
@@ -5,45 +5,71 @@ import * as types from '../mutation_types';
export const getProjectData = (
{ commit, state, dispatch },
{ namespace, projectId, force = false } = {},
-) => new Promise((resolve, reject) => {
- if (!state.projects[`${namespace}/${projectId}`] || force) {
- commit(types.TOGGLE_LOADING, { entry: state });
- service.getProjectData(namespace, projectId)
- .then(res => res.data)
- .then((data) => {
+) =>
+ new Promise((resolve, reject) => {
+ if (!state.projects[`${namespace}/${projectId}`] || force) {
commit(types.TOGGLE_LOADING, { entry: state });
- commit(types.SET_PROJECT, { projectPath: `${namespace}/${projectId}`, project: data });
- if (!state.currentProjectId) commit(types.SET_CURRENT_PROJECT, `${namespace}/${projectId}`);
- resolve(data);
- })
- .catch(() => {
- flash('Error loading project data. Please try again.', 'alert', document, null, false, true);
- reject(new Error(`Project not loaded ${namespace}/${projectId}`));
- });
- } else {
- resolve(state.projects[`${namespace}/${projectId}`]);
- }
-});
+ service
+ .getProjectData(namespace, projectId)
+ .then(res => res.data)
+ .then(data => {
+ commit(types.TOGGLE_LOADING, { entry: state });
+ commit(types.SET_PROJECT, { projectPath: `${namespace}/${projectId}`, project: data });
+ if (!state.currentProjectId)
+ commit(types.SET_CURRENT_PROJECT, `${namespace}/${projectId}`);
+ resolve(data);
+ })
+ .catch(() => {
+ flash(
+ 'Error loading project data. Please try again.',
+ 'alert',
+ document,
+ null,
+ false,
+ true,
+ );
+ reject(new Error(`Project not loaded ${namespace}/${projectId}`));
+ });
+ } else {
+ resolve(state.projects[`${namespace}/${projectId}`]);
+ }
+ });
export const getBranchData = (
{ commit, state, dispatch },
{ projectId, branchId, force = false } = {},
-) => new Promise((resolve, reject) => {
- if ((typeof state.projects[`${projectId}`] === 'undefined' ||
- !state.projects[`${projectId}`].branches[branchId])
- || force) {
- service.getBranchData(`${projectId}`, branchId)
- .then(({ data }) => {
- const { id } = data.commit;
- commit(types.SET_BRANCH, { projectPath: `${projectId}`, branchName: branchId, branch: data });
- commit(types.SET_BRANCH_WORKING_REFERENCE, { projectId, branchId, reference: id });
- resolve(data);
- })
- .catch(() => {
- flash('Error loading branch data. Please try again.', 'alert', document, null, false, true);
- reject(new Error(`Branch not loaded - ${projectId}/${branchId}`));
- });
- } else {
- resolve(state.projects[`${projectId}`].branches[branchId]);
- }
-});
+) =>
+ new Promise((resolve, reject) => {
+ if (
+ typeof state.projects[`${projectId}`] === 'undefined' ||
+ !state.projects[`${projectId}`].branches[branchId] ||
+ force
+ ) {
+ service
+ .getBranchData(`${projectId}`, branchId)
+ .then(({ data }) => {
+ const { id } = data.commit;
+ commit(types.SET_BRANCH, {
+ projectPath: `${projectId}`,
+ branchName: branchId,
+ branch: data,
+ });
+ commit(types.SET_BRANCH_WORKING_REFERENCE, { projectId, branchId, reference: id });
+ commit(types.SET_CURRENT_BRANCH, branchId);
+ resolve(data);
+ })
+ .catch(() => {
+ flash(
+ 'Error loading branch data. Please try again.',
+ 'alert',
+ document,
+ null,
+ false,
+ true,
+ );
+ reject(new Error(`Branch not loaded - ${projectId}/${branchId}`));
+ });
+ } else {
+ resolve(state.projects[`${projectId}`].branches[branchId]);
+ }
+ });
diff --git a/app/assets/stylesheets/pages/repo.scss b/app/assets/stylesheets/pages/repo.scss
index 5015298e8ba..ae6cd3ab3f7 100644
--- a/app/assets/stylesheets/pages/repo.scss
+++ b/app/assets/stylesheets/pages/repo.scss
@@ -662,11 +662,6 @@
}
}
-.multi-file-commit-message.form-control {
- height: 160px;
- resize: none;
-}
-
.dirty-diff {
// !important need to override monaco inline style
width: 4px !important;
@@ -839,3 +834,74 @@
align-items: center;
font-weight: $gl-font-weight-bold;
}
+
+.ide-commit-message-field {
+ height: 200px;
+ background-color: $white-light;
+
+ .md-area {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ }
+
+ .nav-links {
+ height: 30px;
+ }
+
+ .help-block {
+ margin-top: 2px;
+ color: $blue-500;
+ cursor: pointer;
+ }
+}
+
+.ide-commit-message-textarea-container {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+
+ .note-textarea {
+ font-family: $monospace_font;
+ }
+}
+
+.ide-commit-message-highlights-container {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: -100px;
+ bottom: 0;
+ padding-right: 100px;
+ pointer-events: none;
+ z-index: 1;
+
+ .highlights {
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ color: transparent;
+ }
+
+ mark {
+ margin-left: -1px;
+ padding: 0 2px;
+ border-radius: $border-radius-small;
+ background-color: $orange-200;
+ color: transparent;
+ opacity: 0.6;
+ }
+}
+
+.ide-commit-message-textarea {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 2;
+ background: transparent;
+ resize: none;
+}
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 24651dd392c..0fdd4d2cb47 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
include Gitlab::GonHelper
include GitlabRoutingHelper
include PageLayoutHelper
+ include SafeParamsHelper
include SentryHelper
include WorkhorseHelper
include EnforcesTwoFactorAuthentication
diff --git a/app/controllers/concerns/notes_actions.rb b/app/controllers/concerns/notes_actions.rb
index ad4e936a3d4..0c34e49206a 100644
--- a/app/controllers/concerns/notes_actions.rb
+++ b/app/controllers/concerns/notes_actions.rb
@@ -217,7 +217,7 @@ module NotesActions
def note_project
strong_memoize(:note_project) do
- return nil unless project
+ next nil unless project
note_project_id = params[:note_project_id]
@@ -228,7 +228,7 @@ module NotesActions
project
end
- return access_denied! unless can?(current_user, :create_note, the_project)
+ next access_denied! unless can?(current_user, :create_note, the_project)
the_project
end
diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb
index e89eaf7edda..f9e8fe624e8 100644
--- a/app/controllers/dashboard/todos_controller.rb
+++ b/app/controllers/dashboard/todos_controller.rb
@@ -86,7 +86,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
out_of_range = todos.current_page > total_pages
if out_of_range
- redirect_to url_for(params.merge(page: total_pages, only_path: true))
+ redirect_to url_for(safe_params.merge(page: total_pages, only_path: true))
end
out_of_range
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb
index 6142e75b4c1..4d8a20de017 100644
--- a/app/controllers/groups/variables_controller.rb
+++ b/app/controllers/groups/variables_controller.rb
@@ -15,7 +15,7 @@ module Groups
def update
if @group.update(group_variables_params)
respond_to do |format|
- format.json { return render_group_variables }
+ format.json { render_group_variables }
end
else
respond_to do |format|
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 5ac4b8710e2..79fa5818359 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -189,6 +189,6 @@ class GroupsController < Groups::ApplicationController
params[:id] = group.to_param
- url_for(params)
+ url_for(safe_params)
end
end
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 54e7d81de6a..62b739918e6 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -60,13 +60,13 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
end
format.patch do
- return render_404 unless @merge_request.diff_refs
+ break render_404 unless @merge_request.diff_refs
send_git_patch @project.repository, @merge_request.diff_refs
end
format.diff do
- return render_404 unless @merge_request.diff_refs
+ break render_404 unless @merge_request.diff_refs
send_git_diff @project.repository, @merge_request.diff_refs
end
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index 517d0b026c2..bf09ea7e4d8 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -12,7 +12,7 @@ class Projects::VariablesController < Projects::ApplicationController
def update
if @project.update(variables_params)
respond_to do |format|
- format.json { return render_variables }
+ format.json { render_variables }
end
else
respond_to do |format|
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 37f14230196..a93b116c6fe 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -404,7 +404,7 @@ class ProjectsController < Projects::ApplicationController
params[:namespace_id] = project.namespace.to_param
params[:id] = project.to_param
- url_for(params)
+ url_for(safe_params)
end
def project_export_enabled
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 956df4a0a16..31f47a7aa7c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -146,6 +146,6 @@ class UsersController < ApplicationController
end
def build_canonical_path(user)
- url_for(params.merge(username: user.to_param))
+ url_for(safe_params.merge(username: user.to_param))
end
end
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 866b8773db6..fef29789832 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -259,7 +259,7 @@ module BlobHelper
options = []
if error == :collapsed
- options << link_to('load it anyway', url_for(params.merge(viewer: viewer.type, expanded: true, format: nil)))
+ options << link_to('load it anyway', url_for(safe_params.merge(viewer: viewer.type, expanded: true, format: nil)))
end
# If the error is `:server_side_but_stored_externally`, the simple viewer will show the same error,
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index b5ca39711bc..1bb82fd8150 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -180,7 +180,7 @@ module DiffHelper
private
def diff_btn(title, name, selected)
- params_copy = params.dup
+ params_copy = safe_params.dup
params_copy[:view] = name
# Always use HTML to handle case where JSON diff rendered this button
diff --git a/app/helpers/safe_params_helper.rb b/app/helpers/safe_params_helper.rb
new file mode 100644
index 00000000000..b568e8810cc
--- /dev/null
+++ b/app/helpers/safe_params_helper.rb
@@ -0,0 +1,11 @@
+module SafeParamsHelper
+ # Rails 5.0 requires to permit `params` if they're used in url helpers.
+ # Use this helper when generating links with `params.merge(...)`
+ def safe_params
+ if params.respond_to?(:permit!)
+ params.except(:host, :port, :protocol).permit!
+ else
+ params
+ end
+ end
+end
diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb
index b33131becd3..392cc0bee03 100644
--- a/app/mailers/emails/issues.rb
+++ b/app/mailers/emails/issues.rb
@@ -6,6 +6,12 @@ module Emails
mail_new_thread(@issue, issue_thread_options(@issue.author_id, recipient_id, reason))
end
+ def issue_due_email(recipient_id, issue_id, reason = nil)
+ setup_issue_mail(issue_id, recipient_id)
+
+ mail_new_thread(@issue, issue_thread_options(@issue.author_id, recipient_id, reason))
+ end
+
def new_mention_in_issue_email(recipient_id, issue_id, updated_by_user_id, reason = nil)
setup_issue_mail(issue_id, recipient_id)
mail_answer_thread(@issue, issue_thread_options(updated_by_user_id, recipient_id, reason))
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 4aa65bf4273..1c8d9ca4aa5 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -162,7 +162,7 @@ module Ci
build.validates_dependencies! unless Feature.enabled?('ci_disable_validates_dependencies')
end
- before_transition pending: :running do |build|
+ after_transition pending: :running do |build|
build.ensure_metadata.update_timeout_state
end
end
@@ -479,7 +479,7 @@ module Ci
def user_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
- return variables if user.blank?
+ break variables if user.blank?
variables.append(key: 'GITLAB_USER_ID', value: user.id.to_s)
variables.append(key: 'GITLAB_USER_EMAIL', value: user.email)
@@ -594,7 +594,7 @@ module Ci
def persisted_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
- return variables unless persisted?
+ break variables unless persisted?
variables
.append(key: 'CI_JOB_ID', value: id.to_s)
@@ -643,7 +643,7 @@ module Ci
def persisted_environment_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
- return variables unless persisted? && persisted_environment.present?
+ break variables unless persisted? && persisted_environment.present?
variables.concat(persisted_environment.predefined_variables)
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 3469d5d795c..b6276c2fb50 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -87,7 +87,7 @@ class CommitStatus < ActiveRecord::Base
transition [:created, :pending, :running, :manual] => :canceled
end
- before_transition created: [:pending, :running] do |commit_status|
+ before_transition [:created, :skipped, :manual] => :pending do |commit_status|
commit_status.queued_at = Time.now
end
diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb
index 4ae5dd8c677..db8cf322ef7 100644
--- a/app/models/concerns/cache_markdown_field.rb
+++ b/app/models/concerns/cache_markdown_field.rb
@@ -11,7 +11,9 @@ module CacheMarkdownField
extend ActiveSupport::Concern
# Increment this number every time the renderer changes its output
- CACHE_VERSION = 3
+ CACHE_REDCARPET_VERSION = 3
+ CACHE_COMMONMARK_VERSION_START = 10
+ CACHE_COMMONMARK_VERSION = 11
# changes to these attributes cause the cache to be invalidates
INVALIDATED_BY = %w[author project].freeze
@@ -49,12 +51,14 @@ module CacheMarkdownField
# Always include a project key, or Banzai complains
project = self.project if self.respond_to?(:project)
- group = self.group if self.respond_to?(:group)
+ group = self.group if self.respond_to?(:group)
context = cached_markdown_fields[field].merge(project: project, group: group)
# Banzai is less strict about authors, so don't always have an author key
context[:author] = self.author if self.respond_to?(:author)
+ context[:markdown_engine] = markdown_engine
+
context
end
@@ -69,7 +73,7 @@ module CacheMarkdownField
Banzai::Renderer.cacheless_render_field(self, markdown_field, options)
]
end.to_h
- updates['cached_markdown_version'] = CacheMarkdownField::CACHE_VERSION
+ updates['cached_markdown_version'] = latest_cached_markdown_version
updates.each {|html_field, data| write_attribute(html_field, data) }
end
@@ -90,7 +94,7 @@ module CacheMarkdownField
markdown_changed = attribute_changed?(markdown_field) || false
html_changed = attribute_changed?(html_field) || false
- CacheMarkdownField::CACHE_VERSION == cached_markdown_version &&
+ latest_cached_markdown_version == cached_markdown_version &&
(html_changed || markdown_changed == html_changed)
end
@@ -109,6 +113,24 @@ module CacheMarkdownField
__send__(cached_markdown_fields.html_field(markdown_field)) # rubocop:disable GitlabSecurity/PublicSend
end
+ def latest_cached_markdown_version
+ return CacheMarkdownField::CACHE_REDCARPET_VERSION unless cached_markdown_version
+
+ if cached_markdown_version < CacheMarkdownField::CACHE_COMMONMARK_VERSION_START
+ CacheMarkdownField::CACHE_REDCARPET_VERSION
+ else
+ CacheMarkdownField::CACHE_COMMONMARK_VERSION
+ end
+ end
+
+ def markdown_engine
+ if latest_cached_markdown_version < CacheMarkdownField::CACHE_COMMONMARK_VERSION_START
+ :redcarpet
+ else
+ :common_mark
+ end
+ end
+
included do
cattr_reader :cached_markdown_fields do
FieldData.new
diff --git a/app/models/issue.rb b/app/models/issue.rb
index c1ffe6512ea..702bfc77803 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -49,6 +49,7 @@ class Issue < ActiveRecord::Base
scope :without_due_date, -> { where(due_date: nil) }
scope :due_before, ->(date) { where('issues.due_date < ?', date) }
scope :due_between, ->(from_date, to_date) { where('issues.due_date >= ?', from_date).where('issues.due_date <= ?', to_date) }
+ scope :due_tomorrow, -> { where(due_date: Date.tomorrow) }
scope :order_due_date_asc, -> { reorder('issues.due_date IS NULL, issues.due_date ASC') }
scope :order_due_date_desc, -> { reorder('issues.due_date IS NULL, issues.due_date DESC') }
diff --git a/app/models/notification_recipient.rb b/app/models/notification_recipient.rb
index b3ffad00a07..2c3580bbdc6 100644
--- a/app/models/notification_recipient.rb
+++ b/app/models/notification_recipient.rb
@@ -83,14 +83,14 @@ class NotificationRecipient
def has_access?
DeclarativePolicy.subject_scope do
- return false unless user.can?(:receive_notifications)
- return true if @skip_read_ability
+ break false unless user.can?(:receive_notifications)
+ break true if @skip_read_ability
- return false if @target && !user.can?(:read_cross_project)
- return false if @project && !user.can?(:read_project, @project)
+ break false if @target && !user.can?(:read_cross_project)
+ break false if @project && !user.can?(:read_project, @project)
- return true unless read_ability
- return true unless DeclarativePolicy.has_policy?(@target)
+ break true unless read_ability
+ break true unless DeclarativePolicy.has_policy?(@target)
user.can?(read_ability, @target)
end
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index f6d9b0215fc..9195408551f 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -47,7 +47,8 @@ class NotificationSetting < ActiveRecord::Base
].freeze
EXCLUDED_WATCHER_EVENTS = [
- :push_to_merge_request
+ :push_to_merge_request,
+ :issue_due
].push(*EXCLUDED_PARTICIPATING_EVENTS).freeze
def self.find_or_create_for(source)
diff --git a/app/models/project.rb b/app/models/project.rb
index ffd78d3ab70..38139a9b137 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1637,7 +1637,7 @@ class Project < ActiveRecord::Base
def container_registry_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
- return variables unless Gitlab.config.registry.enabled
+ break variables unless Gitlab.config.registry.enabled
variables.append(key: 'CI_REGISTRY', value: Gitlab.config.registry.host_port)
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb
index e09b445636f..c289b44f885 100644
--- a/app/services/ci/register_job_service.rb
+++ b/app/services/ci/register_job_service.rb
@@ -4,6 +4,9 @@ module Ci
class RegisterJobService
attr_reader :runner
+ JOB_QUEUE_DURATION_SECONDS_BUCKETS = [1, 3, 10, 30].freeze
+ JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET = 5.freeze
+
Result = Struct.new(:build, :valid?)
def initialize(runner)
@@ -30,7 +33,7 @@ module Ci
end
end
- builds.find do |build|
+ builds.auto_include(false).find do |build|
next unless runner.can_pick?(build)
begin
@@ -41,7 +44,7 @@ module Ci
build.run!
register_success(build)
- return Result.new(build, true)
+ return Result.new(build, true) # rubocop:disable Cop/AvoidReturnFromBlocks
rescue Ci::Build::MissingDependenciesError
build.drop!(:missing_dependency_failure)
end
@@ -104,10 +107,22 @@ module Ci
end
def register_success(job)
- job_queue_duration_seconds.observe({ shared_runner: @runner.shared? }, Time.now - job.created_at)
+ labels = { shared_runner: runner.shared?,
+ jobs_running_for_project: jobs_running_for_project(job) }
+
+ job_queue_duration_seconds.observe(labels, Time.now - job.queued_at) unless job.queued_at.nil?
attempt_counter.increment
end
+ def jobs_running_for_project(job)
+ return '+Inf' unless runner.shared?
+
+ # excluding currently started job
+ running_jobs_count = job.project.builds.running.where(runner: Ci::Runner.shared)
+ .limit(JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET + 1).count - 1
+ running_jobs_count < JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET ? running_jobs_count : "#{JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET}+"
+ end
+
def failed_attempt_counter
@failed_attempt_counter ||= Gitlab::Metrics.counter(:job_register_attempts_failed_total, "Counts the times a runner tries to register a job")
end
@@ -117,7 +132,7 @@ module Ci
end
def job_queue_duration_seconds
- @job_queue_duration_seconds ||= Gitlab::Metrics.histogram(:job_queue_duration_seconds, 'Request handling execution time')
+ @job_queue_duration_seconds ||= Gitlab::Metrics.histogram(:job_queue_duration_seconds, 'Request handling execution time', {}, JOB_QUEUE_DURATION_SECONDS_BUCKETS)
end
end
end
diff --git a/app/services/clusters/gcp/verify_provision_status_service.rb b/app/services/clusters/gcp/verify_provision_status_service.rb
index f994aacd086..7cc4324677e 100644
--- a/app/services/clusters/gcp/verify_provision_status_service.rb
+++ b/app/services/clusters/gcp/verify_provision_status_service.rb
@@ -17,7 +17,7 @@ module Clusters
when 'DONE'
finalize_creation
else
- return provider.make_errored!("Unexpected operation status; #{operation.status} #{operation.status_message}")
+ provider.make_errored!("Unexpected operation status; #{operation.status} #{operation.status_message}")
end
end
end
diff --git a/app/services/create_deployment_service.rb b/app/services/create_deployment_service.rb
index 88dfb7a4a90..7e5a77fb056 100644
--- a/app/services/create_deployment_service.rb
+++ b/app/services/create_deployment_service.rb
@@ -19,8 +19,8 @@ class CreateDeploymentService
environment.fire_state_event(action)
- return unless environment.save
- return if environment.stopped?
+ break unless environment.save
+ break if environment.stopped?
deploy.tap(&:update_merge_request_metrics!)
end
diff --git a/app/services/import_export_clean_up_service.rb b/app/services/import_export_clean_up_service.rb
index 6442406d77e..74088b970c9 100644
--- a/app/services/import_export_clean_up_service.rb
+++ b/app/services/import_export_clean_up_service.rb
@@ -10,7 +10,7 @@ class ImportExportCleanUpService
def execute
Gitlab::Metrics.measure(:import_export_clean_up) do
- return unless File.directory?(path)
+ next unless File.directory?(path)
clean_up_export_files
end
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb
index b82d9c64296..83e59a649b6 100644
--- a/app/services/notification_recipient_service.rb
+++ b/app/services/notification_recipient_service.rb
@@ -203,10 +203,11 @@ module NotificationRecipientService
attr_reader :action
attr_reader :previous_assignee
attr_reader :skip_current_user
- def initialize(target, current_user, action:, previous_assignee: nil, skip_current_user: true)
+ def initialize(target, current_user, action:, custom_action: nil, previous_assignee: nil, skip_current_user: true)
@target = target
@current_user = current_user
@action = action
+ @custom_action = custom_action
@previous_assignee = previous_assignee
@skip_current_user = skip_current_user
end
@@ -236,7 +237,13 @@ module NotificationRecipientService
add_mentions(current_user, target: target)
# Add the assigned users, if any
- assignees = custom_action == :new_issue ? target.assignees : target.assignee
+ assignees = case custom_action
+ when :new_issue
+ target.assignees
+ else
+ target.assignee
+ end
+
# We use the `:participating` notification level in order to match existing legacy behavior as captured
# in existing specs (notification_service_spec.rb ~ line 507)
add_recipients(assignees, :participating, NotificationReason::ASSIGNED) if assignees
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index f94c76cf3ac..274161df946 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -373,6 +373,20 @@ class NotificationService
end
end
+ def issue_due(issue)
+ recipients = NotificationRecipientService.build_recipients(
+ issue,
+ issue.author,
+ action: 'due',
+ custom_action: :issue_due,
+ skip_current_user: false
+ )
+
+ recipients.each do |recipient|
+ mailer.send(:issue_due_email, recipient.user.id, issue.id, recipient.reason).deliver_later
+ end
+ end
+
protected
def new_resource_email(target, method)
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb
index aa14206db3b..44e869851ca 100644
--- a/app/services/projects/destroy_service.rb
+++ b/app/services/projects/destroy_service.rb
@@ -137,7 +137,7 @@ module Projects
return true unless Gitlab.config.registry.enabled
ContainerRepository.build_root_repository(project).tap do |repository|
- return repository.has_tags? ? repository.delete_tags! : true
+ break repository.has_tags? ? repository.delete_tags! : true
end
end
diff --git a/app/services/repository_archive_clean_up_service.rb b/app/services/repository_archive_clean_up_service.rb
index aa84d36a206..9a88459b511 100644
--- a/app/services/repository_archive_clean_up_service.rb
+++ b/app/services/repository_archive_clean_up_service.rb
@@ -10,7 +10,7 @@ class RepositoryArchiveCleanUpService
def execute
Gitlab::Metrics.measure(:repository_archive_clean_up) do
- return unless File.directory?(path)
+ next unless File.directory?(path)
clean_up_old_archives
clean_up_empty_directories
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 00bf5434b7f..958ef065012 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -159,7 +159,7 @@ module SystemNoteService
body = if noteable.time_estimate == 0
"removed time estimate"
else
- "changed time estimate to #{parsed_time}"
+ "changed time estimate to #{parsed_time},"
end
create_note(NoteSummary.new(noteable, project, author, body, action: 'time_tracking'))
diff --git a/app/services/test_hooks/base_service.rb b/app/services/test_hooks/base_service.rb
index e9aefb1fb75..aadc1ea644b 100644
--- a/app/services/test_hooks/base_service.rb
+++ b/app/services/test_hooks/base_service.rb
@@ -19,7 +19,7 @@ module TestHooks
error_message = catch(:validation_error) do
sample_data = self.__send__(trigger_data_method) # rubocop:disable GitlabSecurity/PublicSend
- return hook.execute(sample_data, trigger_key)
+ return hook.execute(sample_data, trigger_key) # rubocop:disable Cop/AvoidReturnFromBlocks
end
error(error_message)
diff --git a/app/views/dashboard/issues.atom.builder b/app/views/dashboard/issues.atom.builder
index 70ec6bc6257..d7b6fb9a4a1 100644
--- a/app/views/dashboard/issues.atom.builder
+++ b/app/views/dashboard/issues.atom.builder
@@ -1,5 +1,5 @@
xml.title "#{current_user.name} issues"
-xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
+xml.link href: url_for(safe_params), rel: "self", type: "application/atom+xml"
xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html"
xml.id issues_dashboard_url
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index bb472b4c900..4bf04dadf01 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -2,12 +2,12 @@
- page_title _("Issues")
- @breadcrumb_link = issues_dashboard_path(assignee_id: current_user.id)
= content_for :meta_tags do
- = auto_discovery_link_tag(:atom, params.merge(rss_url_options), title: "#{current_user.name} issues")
+ = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues")
.top-area
= render 'shared/issuable/nav', type: :issues, display_count: !@no_filters_set
.nav-controls
- = link_to params.merge(rss_url_options), class: 'btn has-tooltip', data: { container: 'body' }, title: 'Subscribe' do
+ = link_to safe_params.merge(rss_url_options), class: 'btn has-tooltip', data: { container: 'body' }, title: 'Subscribe' do
= icon('rss')
= render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", with_feature_enabled: 'issues', type: :issues
diff --git a/app/views/groups/issues.atom.builder b/app/views/groups/issues.atom.builder
index a239ea8caf0..2a385b661e5 100644
--- a/app/views/groups/issues.atom.builder
+++ b/app/views/groups/issues.atom.builder
@@ -1,5 +1,5 @@
xml.title "#{@group.name} issues"
-xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
+xml.link href: url_for(safe_params), rel: "self", type: "application/atom+xml"
xml.link href: issues_group_url, rel: "alternate", type: "text/html"
xml.id issues_group_url
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml
index 36df03302e8..bbfbea4ac7a 100644
--- a/app/views/groups/issues.html.haml
+++ b/app/views/groups/issues.html.haml
@@ -1,6 +1,6 @@
- page_title "Issues"
= content_for :meta_tags do
- = auto_discovery_link_tag(:atom, params.merge(rss_url_options), title: "#{@group.name} issues")
+ = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@group.name} issues")
- if group_issues_count(state: 'all').zero?
= render 'shared/empty_states/issues', project_select_button: true
diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb
index 198f30a1dc4..8e20c4a4b2a 100644
--- a/app/views/layouts/mailer.text.erb
+++ b/app/views/layouts/mailer.text.erb
@@ -1,4 +1,4 @@
<%= yield -%>
----
+-- <%# signature marker %>
You're receiving this email because of your account on <%= Gitlab.config.gitlab.host %>.
diff --git a/app/views/layouts/notify.text.erb b/app/views/layouts/notify.text.erb
index de48f548a1b..9dc490efa9a 100644
--- a/app/views/layouts/notify.text.erb
+++ b/app/views/layouts/notify.text.erb
@@ -1,6 +1,6 @@
<%= yield -%>
----
+-- <%# signature marker %>
<% if @target_url -%>
<% if @reply_by_email -%>
<%= "Reply to this email directly or view it on GitLab: #{@target_url}" -%>
diff --git a/app/views/notify/issue_due_email.html.haml b/app/views/notify/issue_due_email.html.haml
new file mode 100644
index 00000000000..e81144b8fcb
--- /dev/null
+++ b/app/views/notify/issue_due_email.html.haml
@@ -0,0 +1,12 @@
+%p.details
+ #{link_to @issue.author_name, user_url(@issue.author)}'s issue is due soon.
+
+- if @issue.assignees.any?
+ %p
+ Assignee: #{@issue.assignee_list}
+%p
+ This issue is due on: #{@issue.due_date.to_s(:medium)}
+
+- if @issue.description
+ %div
+ = markdown(@issue.description, pipeline: :email, author: @issue.author)
diff --git a/app/views/notify/issue_due_email.text.erb b/app/views/notify/issue_due_email.text.erb
new file mode 100644
index 00000000000..3c7a57a8a2e
--- /dev/null
+++ b/app/views/notify/issue_due_email.text.erb
@@ -0,0 +1,7 @@
+The following issue is due on <%= @issue.due_date %>:
+
+Issue <%= @issue.iid %>: <%= url_for(project_issue_url(@issue.project, @issue)) %>
+Author: <%= @issue.author_name %>
+Assignee: <%= @issue.assignee_list %>
+
+<%= @issue.description %>
diff --git a/app/views/projects/blob/_viewer.html.haml b/app/views/projects/blob/_viewer.html.haml
index 9c760c81527..b9663bbba15 100644
--- a/app/views/projects/blob/_viewer.html.haml
+++ b/app/views/projects/blob/_viewer.html.haml
@@ -4,7 +4,7 @@
- load_async = local_assigns.fetch(:load_async, viewer.load_async? && render_error.nil?)
- external_embed = local_assigns.fetch(:external_embed, false)
-- viewer_url = local_assigns.fetch(:viewer_url) { url_for(params.merge(viewer: viewer.type, format: :json)) } if load_async
+- viewer_url = local_assigns.fetch(:viewer_url) { url_for(safe_params.merge(viewer: viewer.type, format: :json)) } if load_async
.blob-viewer{ data: { type: viewer.type, rich_type: rich_type, url: viewer_url }, class: ('hidden' if hidden) }
- if render_error
= render 'projects/blob/render_error', viewer: viewer
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 8077a559a99..54767bdf757 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -29,7 +29,7 @@
= s_('Branches|Cant find HEAD commit for this branch')
- if branch.name != @repository.root_ref
- .divergence-graph{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: diverging_count_label(number_commits_behind),
+ .divergence-graph.hidden-xs{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: diverging_count_label(number_commits_behind),
default_branch: @repository.root_ref,
number_commits_ahead: diverging_count_label(number_commits_ahead) } }
.graph-side
diff --git a/app/views/projects/diffs/_collapsed.html.haml b/app/views/projects/diffs/_collapsed.html.haml
index 8772bd4705f..5762f4d86d7 100644
--- a/app/views/projects/diffs/_collapsed.html.haml
+++ b/app/views/projects/diffs/_collapsed.html.haml
@@ -1,5 +1,5 @@
- diff_file = viewer.diff_file
-- url = url_for(params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier))
+- url = url_for(safe_params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier))
.nothing-here-block.diff-collapsed{ data: { diff_for_path: url } }
This diff is collapsed.
%a.click-to-expand Click to expand it.
diff --git a/app/views/projects/issues/_nav_btns.html.haml b/app/views/projects/issues/_nav_btns.html.haml
index ba75a6b0e29..2cad6f47754 100644
--- a/app/views/projects/issues/_nav_btns.html.haml
+++ b/app/views/projects/issues/_nav_btns.html.haml
@@ -1,4 +1,4 @@
-= link_to params.merge(rss_url_options), class: 'btn btn-secondary append-right-10 has-tooltip', title: 'Subscribe' do
+= link_to safe_params.merge(rss_url_options), class: 'btn btn-secondary append-right-10 has-tooltip', title: 'Subscribe' do
= icon('rss')
- if @can_bulk_update
= button_tag "Edit issues", class: "btn btn-secondary append-right-10 js-bulk-update-toggle"
diff --git a/app/views/projects/issues/index.atom.builder b/app/views/projects/issues/index.atom.builder
index 4029926f373..6330245954e 100644
--- a/app/views/projects/issues/index.atom.builder
+++ b/app/views/projects/issues/index.atom.builder
@@ -1,5 +1,5 @@
xml.title "#{@project.name} issues"
-xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
+xml.link href: url_for(safe_params), rel: "self", type: "application/atom+xml"
xml.link href: project_issues_url(@project), rel: "alternate", type: "text/html"
xml.id project_issues_url(@project)
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml
index c427a9eedc2..1e7737aeb97 100644
--- a/app/views/projects/issues/index.html.haml
+++ b/app/views/projects/issues/index.html.haml
@@ -5,7 +5,7 @@
- new_issue_email = @project.new_issuable_address(current_user, 'issue')
= content_for :meta_tags do
- = auto_discovery_link_tag(:atom, params.merge(rss_url_options), title: "#{@project.name} issues")
+ = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@project.name} issues")
- if project_issues(@project).exists?
%div{ class: (container_class) }
diff --git a/app/views/projects/merge_requests/creations/_new_compare.html.haml b/app/views/projects/merge_requests/creations/_new_compare.html.haml
index 813f8a34f71..73454a91ed8 100644
--- a/app/views/projects/merge_requests/creations/_new_compare.html.haml
+++ b/app/views/projects/merge_requests/creations/_new_compare.html.haml
@@ -3,7 +3,7 @@
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], url: project_new_merge_request_path(@project), method: :get, html: { class: "merge-request-form form-inline js-requires-input" } do |f|
.d-none.alert.alert-danger.mr-compare-errors
- .merge-request-branches.js-merge-request-new-compare.row.col-md-12{ 'data-target-project-url': project_new_merge_request_update_branches_path(@source_project), 'data-source-branch-url': project_new_merge_request_branch_from_path(@source_project), 'data-target-branch-url': project_new_merge_request_branch_to_path(@source_project) }
+ .js-merge-request-new-compare.row.col-md-12{ 'data-target-project-url': project_new_merge_request_update_branches_path(@source_project), 'data-source-branch-url': project_new_merge_request_branch_from_path(@source_project), 'data-target-branch-url': project_new_merge_request_branch_to_path(@source_project) }
.col-md-6.pl-0
.card.card-new-merge-request
.card-header
diff --git a/app/views/projects/merge_requests/creations/_new_submit.html.haml b/app/views/projects/merge_requests/creations/_new_submit.html.haml
index 8f6adf56b3b..9d95f1c7b7f 100644
--- a/app/views/projects/merge_requests/creations/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/creations/_new_submit.html.haml
@@ -26,16 +26,16 @@
- else
%ul.merge-request-tabs.nav-links.no-top.no-bottom
%li.commits-tab.active
- = link_to url_for(params), data: {target: 'div#commits', action: 'new', toggle: 'tab'} do
+ = link_to url_for(safe_params), data: {target: 'div#commits', action: 'new', toggle: 'tab'} do
Commits
%span.badge.badge-pill= @commits.size
- if @pipelines.any?
%li.builds-tab
- = link_to url_for(params.merge(action: 'pipelines')), data: {target: 'div#pipelines', action: 'pipelines', toggle: 'tab'} do
+ = link_to url_for(safe_params.merge(action: 'pipelines')), data: {target: 'div#pipelines', action: 'pipelines', toggle: 'tab'} do
Pipelines
%span.badge.badge-pill= @pipelines.size
%li.diffs-tab
- = link_to url_for(params.merge(action: 'diffs')), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
+ = link_to url_for(safe_params.merge(action: 'diffs')), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
Changes
%span.badge.badge-pill= @merge_request.diff_size
@@ -46,7 +46,7 @@
-# This tab is always loaded via AJAX
- if @pipelines.any?
#pipelines.pipelines.tab-pane
- = render 'projects/merge_requests/pipelines', endpoint: url_for(params.merge(action: 'pipelines', format: :json)), disable_initialization: true
+ = render 'projects/merge_requests/pipelines', endpoint: url_for(safe_params.merge(action: 'pipelines', format: :json)), disable_initialization: true
.mr-loading-status
= spinner
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 9a11cdb121e..9aea3bad27b 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -18,6 +18,7 @@
- cronjob:stuck_import_jobs
- cronjob:stuck_merge_jobs
- cronjob:trending_projects
+- cronjob:issue_due_scheduler
- gcp_cluster:cluster_install_app
- gcp_cluster:cluster_provision
@@ -39,6 +40,8 @@
- github_importer:github_import_stage_import_pull_requests
- github_importer:github_import_stage_import_repository
+- mail_scheduler:mail_scheduler_issue_due
+
- object_storage_upload
- object_storage:object_storage_background_move
- object_storage:object_storage_migrate_uploads
diff --git a/app/workers/concerns/mail_scheduler_queue.rb b/app/workers/concerns/mail_scheduler_queue.rb
new file mode 100644
index 00000000000..9df55ad9522
--- /dev/null
+++ b/app/workers/concerns/mail_scheduler_queue.rb
@@ -0,0 +1,7 @@
+module MailSchedulerQueue
+ extend ActiveSupport::Concern
+
+ included do
+ queue_namespace :mail_scheduler
+ end
+end
diff --git a/app/workers/issue_due_scheduler_worker.rb b/app/workers/issue_due_scheduler_worker.rb
new file mode 100644
index 00000000000..16ab5d069e0
--- /dev/null
+++ b/app/workers/issue_due_scheduler_worker.rb
@@ -0,0 +1,10 @@
+class IssueDueSchedulerWorker
+ include ApplicationWorker
+ include CronjobQueue
+
+ def perform
+ project_ids = Issue.opened.due_tomorrow.group(:project_id).pluck(:project_id).map { |id| [id] }
+
+ MailScheduler::IssueDueWorker.bulk_perform_async(project_ids)
+ end
+end
diff --git a/app/workers/mail_scheduler/issue_due_worker.rb b/app/workers/mail_scheduler/issue_due_worker.rb
new file mode 100644
index 00000000000..b06079d68ca
--- /dev/null
+++ b/app/workers/mail_scheduler/issue_due_worker.rb
@@ -0,0 +1,14 @@
+module MailScheduler
+ class IssueDueWorker
+ include ApplicationWorker
+ include MailSchedulerQueue
+
+ def perform(project_id)
+ notification_service = NotificationService.new
+
+ Issue.opened.due_tomorrow.in_projects(project_id).preload(:project).find_each do |issue|
+ notification_service.issue_due(issue)
+ end
+ end
+ end
+end
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 3909dbf7d7f..f88b3fdbfb1 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -33,7 +33,7 @@ class PostReceive
unless @user
log("Triggered hook for non-existing user \"#{post_received.identifier}\"")
- return false
+ return false # rubocop:disable Cop/AvoidReturnFromBlocks
end
if Gitlab::Git.tag_ref?(ref)
diff --git a/app/workers/stuck_ci_jobs_worker.rb b/app/workers/stuck_ci_jobs_worker.rb
index fb26fa4c515..7ebf69bdc39 100644
--- a/app/workers/stuck_ci_jobs_worker.rb
+++ b/app/workers/stuck_ci_jobs_worker.rb
@@ -38,7 +38,7 @@ class StuckCiJobsWorker
def drop_stuck(status, timeout)
search(status, timeout) do |build|
- return unless build.stuck?
+ break unless build.stuck?
drop_build :stuck, build, status, timeout
end
diff --git a/changelogs/unreleased/16957-issue-due-email.yml b/changelogs/unreleased/16957-issue-due-email.yml
new file mode 100644
index 00000000000..83944ca4f73
--- /dev/null
+++ b/changelogs/unreleased/16957-issue-due-email.yml
@@ -0,0 +1,5 @@
+---
+title: Add cron job to email users on issue due date
+merge_request: 17985
+author: Stuart Nelson
+type: added
diff --git a/changelogs/unreleased/40402-time-estimate-system-notes-can-be-confusing.yml b/changelogs/unreleased/40402-time-estimate-system-notes-can-be-confusing.yml
new file mode 100644
index 00000000000..e47577f9058
--- /dev/null
+++ b/changelogs/unreleased/40402-time-estimate-system-notes-can-be-confusing.yml
@@ -0,0 +1,5 @@
+---
+title: Add a comma to the time estimate system notes
+merge_request: 18326
+author:
+type: changed
diff --git a/changelogs/unreleased/42543-hide-divergence-graph-on-branches-for-mobile.yml b/changelogs/unreleased/42543-hide-divergence-graph-on-branches-for-mobile.yml
new file mode 100644
index 00000000000..7452a264bfd
--- /dev/null
+++ b/changelogs/unreleased/42543-hide-divergence-graph-on-branches-for-mobile.yml
@@ -0,0 +1,5 @@
+---
+title: Remove ahead/behind graphs on project branches on mobile
+merge_request: 18415
+author: Takuya Noguchi
+type: other
diff --git a/changelogs/unreleased/42889-avoid-return-inside-block.yml b/changelogs/unreleased/42889-avoid-return-inside-block.yml
new file mode 100644
index 00000000000..e3e1341ddcc
--- /dev/null
+++ b/changelogs/unreleased/42889-avoid-return-inside-block.yml
@@ -0,0 +1,5 @@
+---
+title: Rubocop rule to avoid returning from a block
+merge_request: 18000
+author: Jacopo Beschi @jacopo-beschi
+type: added
diff --git a/changelogs/unreleased/43617-mailsig.yml b/changelogs/unreleased/43617-mailsig.yml
new file mode 100644
index 00000000000..2c7568e32ca
--- /dev/null
+++ b/changelogs/unreleased/43617-mailsig.yml
@@ -0,0 +1,5 @@
+---
+title: Use RFC 3676 mail signature delimiters
+merge_request: 17979
+author: Enrico Scholz
+type: changed
diff --git a/changelogs/unreleased/44981-http-io-trace-with-multi-byte-char.yml b/changelogs/unreleased/44981-http-io-trace-with-multi-byte-char.yml
new file mode 100644
index 00000000000..64a17990ebc
--- /dev/null
+++ b/changelogs/unreleased/44981-http-io-trace-with-multi-byte-char.yml
@@ -0,0 +1,5 @@
+---
+title: Fix `Trace::HttpIO` can not render multi-byte chars
+merge_request: 18417
+author:
+type: fixed
diff --git a/changelogs/unreleased/improve-jobs-queuing-time-metric.yml b/changelogs/unreleased/improve-jobs-queuing-time-metric.yml
new file mode 100644
index 00000000000..cee8b8523fd
--- /dev/null
+++ b/changelogs/unreleased/improve-jobs-queuing-time-metric.yml
@@ -0,0 +1,5 @@
+---
+title: Partition job_queue_duration_seconds with jobs_running_for_project
+merge_request: 17730
+author:
+type: changed
diff --git a/changelogs/unreleased/zj-ref-exists-opt-out.yml b/changelogs/unreleased/zj-ref-exists-opt-out.yml
new file mode 100644
index 00000000000..cdffecb0d0a
--- /dev/null
+++ b/changelogs/unreleased/zj-ref-exists-opt-out.yml
@@ -0,0 +1,5 @@
+---
+title: Check if a ref exists is done by Gitaly by default
+merge_request:
+author:
+type: performance
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index acf7754abe6..dc7999ac556 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -455,6 +455,10 @@ Settings.cron_jobs['pages_domain_verification_cron_worker'] ||= Settingslogic.ne
Settings.cron_jobs['pages_domain_verification_cron_worker']['cron'] ||= '*/15 * * * *'
Settings.cron_jobs['pages_domain_verification_cron_worker']['job_class'] = 'PagesDomainVerificationCronWorker'
+Settings.cron_jobs['issue_due_scheduler_worker'] ||= Settingslogic.new({})
+Settings.cron_jobs['issue_due_scheduler_worker']['cron'] ||= '50 00 * * *'
+Settings.cron_jobs['issue_due_scheduler_worker']['job_class'] = 'IssueDueSchedulerWorker'
+
#
# Sidekiq
#
diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml
index c811034b29d..47fbbed44cf 100644
--- a/config/sidekiq_queues.yml
+++ b/config/sidekiq_queues.yml
@@ -34,6 +34,7 @@
- [email_receiver, 2]
- [emails_on_push, 2]
- [mailers, 2]
+ - [mail_scheduler, 2]
- [invalid_gpg_signature_update, 2]
- [create_gpg_signature, 2]
- [rebase, 2]
diff --git a/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb b/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb
new file mode 100644
index 00000000000..c64a481fcf0
--- /dev/null
+++ b/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb
@@ -0,0 +1,9 @@
+class AddIssueDueToNotificationSettings < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ add_column :notification_settings, :issue_due, :boolean
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index fd75b176318..87f30f59d43 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1325,6 +1325,7 @@ ActiveRecord::Schema.define(version: 20180405142733) do
t.boolean "failed_pipeline"
t.boolean "success_pipeline"
t.boolean "push_to_merge_request"
+ t.boolean "issue_due"
end
add_index "notification_settings", ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type", using: :btree
diff --git a/doc/README.md b/doc/README.md
index 080341e4f4f..a841a4cfbf1 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -80,6 +80,7 @@ on projects and code.
- [Search through GitLab](user/search/index.md): Search for issues, merge requests, projects, groups, todos, and issues in Issue Boards.
- [Snippets](user/snippets.md): Snippets allow you to create little bits of code.
- [Wikis](user/project/wiki/index.md): Enhance your repository documentation with built-in wikis.
+- [Web IDE](user/project/web_ide/index.md)
#### Repositories
diff --git a/doc/administration/index.md b/doc/administration/index.md
index 0906821d6a3..b472ca5b4d8 100644
--- a/doc/administration/index.md
+++ b/doc/administration/index.md
@@ -1,4 +1,4 @@
-# Administrator documentation
+# Administrator documentation **[CORE ONLY]**
Learn how to administer your GitLab instance (Community Edition and
Enterprise Edition).
diff --git a/doc/api/notification_settings.md b/doc/api/notification_settings.md
index f05ae647577..682b90361bd 100644
--- a/doc/api/notification_settings.md
+++ b/doc/api/notification_settings.md
@@ -23,6 +23,7 @@ new_issue
reopen_issue
close_issue
reassign_issue
+issue_due
new_merge_request
push_to_merge_request
reopen_merge_request
@@ -75,6 +76,7 @@ curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab
| `reopen_issue` | boolean | no | Enable/disable this notification |
| `close_issue` | boolean | no | Enable/disable this notification |
| `reassign_issue` | boolean | no | Enable/disable this notification |
+| `issue_due` | boolean | no | Enable/disable this notification |
| `new_merge_request` | boolean | no | Enable/disable this notification |
| `push_to_merge_request` | boolean | no | Enable/disable this notification |
| `reopen_merge_request` | boolean | no | Enable/disable this notification |
@@ -142,6 +144,7 @@ curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab
| `reopen_issue` | boolean | no | Enable/disable this notification |
| `close_issue` | boolean | no | Enable/disable this notification |
| `reassign_issue` | boolean | no | Enable/disable this notification |
+| `issue_due` | boolean | no | Enable/disable this notification |
| `new_merge_request` | boolean | no | Enable/disable this notification |
| `push_to_merge_request` | boolean | no | Enable/disable this notification |
| `reopen_merge_request` | boolean | no | Enable/disable this notification |
@@ -166,6 +169,7 @@ Example responses:
"reopen_issue": false,
"close_issue": false,
"reassign_issue": false,
+ "issue_due": false,
"new_merge_request": false,
"push_to_merge_request": false,
"reopen_merge_request": false,
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md
index fc1b202b5eb..ce69694ab6a 100644
--- a/doc/development/background_migrations.md
+++ b/doc/development/background_migrations.md
@@ -133,11 +133,19 @@ roughly be as follows:
1. Release B:
1. Deploy code so that the application starts using the new column and stops
scheduling jobs for newly created data.
- 1. In a post-deployment migration you'll need to ensure no jobs remain. To do
- so you can use `Gitlab::BackgroundMigration.steal` to process any remaining
- jobs before continuing.
+ 1. In a post-deployment migration you'll need to ensure no jobs remain.
+ 1. Use `Gitlab::BackgroundMigration.steal` to process any remaining
+ jobs in Sidekiq.
+ 1. Reschedule the migration to be run directly (i.e. not through Sidekiq)
+ on any rows that weren't migrated by Sidekiq. This can happen if, for
+ instance, Sidekiq received a SIGKILL, or if a particular batch failed
+ enough times to be marked as dead.
1. Remove the old column.
+This may also require a bump to the [import/export version][import-export], if
+importing a project from a prior version of GitLab requires the data to be in
+the new format.
+
## Example
To explain all this, let's use the following example: the table `services` has a
@@ -296,3 +304,4 @@ for more details.
[migrations-readme]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec/migrations/README.md
[issue-rspec-hooks]: https://gitlab.com/gitlab-org/gitlab-ce/issues/35351
[reliable-sidekiq]: https://gitlab.com/gitlab-org/gitlab-ce/issues/36791
+[import-export]: ../user/project/settings/import_export.md
diff --git a/doc/development/doc_styleguide.md b/doc/development/doc_styleguide.md
index 41e3412c7ff..0550ea527cb 100644
--- a/doc/development/doc_styleguide.md
+++ b/doc/development/doc_styleguide.md
@@ -157,6 +157,39 @@ below.
Otherwise, leave this mention out.
+### Product badges
+
+When a feature is available in EE-only tiers, add the corresponding tier according to the
+feature availability:
+
+- For GitLab Starter and GitLab.com Bronze: `**[STARTER]**`
+- For GitLab Premium and GitLab.com Silver: `**[PREMIUM]**`
+- For GitLab Ultimate and GitLab.com Gold: `**[ULTIMATE]**`
+- For GitLab Core and GitLab.com Free: `**[CORE]**`
+
+To exclude GitLab.com tiers (when the feature is not available in GitLab.com), add the
+keyword "only":
+
+- For GitLab Starter: `**[STARTER ONLY]**`
+- For GitLab Premium: `**[PREMIUM ONLY]**`
+- For GitLab Ultimate: `**[ULTIMATE ONLY]**`
+- For GitLab Core: `**[CORE ONLY]**`
+
+The tier should be ideally added to headers, so that the full badge will be displayed.
+But it can be also mentioned from paragraphs, list items, and table cells. For these cases,
+the tier mention will be represented by an orange question mark.
+E.g., `**[STARTER]**` renders **[STARTER]**, `**[STARTER ONLY]**` renders **[STARTER ONLY]**.
+
+The absence of tiers' mentions mean that the feature is available in GitLab Core,
+GitLab.com Free, and higher tiers.
+
+#### How it works
+
+Introduced by [!244](https://gitlab.com/gitlab-com/gitlab-docs/merge_requests/244),
+the special markup `**[STARTER]**` will generate a `span` element to trigger the
+badges and tooltips (`<span class="badge-trigger starter">`). When the keyword
+"only" is added, the corresponding GitLab.com badge will not be displayed.
+
### GitLab Restart
There are many cases that a restart/reconfigure of GitLab is required. To
diff --git a/doc/user/group/index.md b/doc/user/group/index.md
index 88efddbfba8..88f4bb2ee04 100644
--- a/doc/user/group/index.md
+++ b/doc/user/group/index.md
@@ -245,10 +245,7 @@ To enable this feature, navigate to the group settings page. Select
![Checkbox for share with group lock](img/share_with_group_lock.png)
-#### Member Lock
-
-> Available in [GitLab Starter](https://about.gitlab.com/products/) and
-[GitLab.com Bronze](https://about.gitlab.com/gitlab-com/).
+#### Member Lock **[STARTER]**
With **Member Lock** it is possible to lock membership in project to the
level of members in group.
@@ -259,8 +256,8 @@ Learn more about [Member Lock](https://docs.gitlab.com/ee/user/group/index.html#
- **Projects**: view all projects within that group, add members to each project,
access each project's settings, and remove any project from the same screen.
-- **Webhooks**: configure [webhooks](../project/integrations/webhooks.md)
-and [push rules](https://docs.gitlab.com/ee/push_rules/push_rules.html#push-rules) to your group (Push Rules is available in [GitLab Starter](https://about.gitlab.com/products/).)
+- **Webhooks**: configure [webhooks](../project/integrations/webhooks.md) to your group.
+- **Push rules**: configure [push rules](https://docs.gitlab.com/ee/push_rules/push_rules.html#push-rules) to your group. **[STARTER]**
- **Audit Events**: view [Audit Events](https://docs.gitlab.com/ee/administration/audit_events.html#audit-events)
-for the group (GitLab admins only, available in [GitLab Starter][ee]).
+for the group. **[STARTER ONLY]**
- **Pipelines quota**: keep track of the [pipeline quota](../admin_area/settings/continuous_integration.md) for the group
diff --git a/doc/user/project/index.md b/doc/user/project/index.md
index a3d53fde399..557375a1da9 100644
--- a/doc/user/project/index.md
+++ b/doc/user/project/index.md
@@ -17,7 +17,7 @@ When you create a project in GitLab, you'll have access to a large number of
- [Issue tracker](issues/index.md): Discuss implementations with your team within issues
- [Issue Boards](issue_board.md): Organize and prioritize your workflow
- - [Multiple Issue Boards](https://docs.gitlab.com/ee/user/project/issue_board.html#multiple-issue-boards) (**Starter/Premium**): Allow your teams to create their own workflows (Issue Boards) for the same project
+ - [Multiple Issue Boards](https://docs.gitlab.com/ee/user/project/issue_board.html#multiple-issue-boards): Allow your teams to create their own workflows (Issue Boards) for the same project **[STARTER]**
- [Repositories](repository/index.md): Host your code in a fully
integrated platform
- [Branches](repository/branches/index.md): use Git branching strategies to
@@ -30,8 +30,8 @@ integrated platform
- [Deploy tokens](deploy_tokens/index.md): Manage project-based deploy tokens that allow permanent access to the repository and Container Registry.
- [Merge Requests](merge_requests/index.md): Apply your branching
strategy and get reviewed by your team
- - [Merge Request Approvals](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html) (**Starter/Premium**): Ask for approval before
- implementing a change
+ - [Merge Request Approvals](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html): Ask for approval before
+ implementing a change **[STARTER]**
- [Fix merge conflicts from the UI](merge_requests/resolve_conflicts.md):
Your Git diff tool right from GitLab's UI
- [Review Apps](../../ci/review_apps/index.md): Live preview the results
diff --git a/doc/user/project/issues/due_dates.md b/doc/user/project/issues/due_dates.md
index e0c405353ce..1bf8b776c2e 100644
--- a/doc/user/project/issues/due_dates.md
+++ b/doc/user/project/issues/due_dates.md
@@ -35,5 +35,9 @@ Due dates also appear in your [todos list](../../../workflow/todos.md).
![Issues with due dates in the todos](img/due_dates_todos.png)
+The day before an open issue is due, an email will be sent to all participants
+of the issue. Both the due date and the day before are calculated using the
+server's timezone.
+
[ce-3614]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3614
[permissions]: ../../permissions.md#project
diff --git a/doc/user/project/issues/issues_functionalities.md b/doc/user/project/issues/issues_functionalities.md
index f2ca6a6822e..6bcf7686a71 100644
--- a/doc/user/project/issues/issues_functionalities.md
+++ b/doc/user/project/issues/issues_functionalities.md
@@ -41,10 +41,7 @@ it's reassigned to someone else to take it from there.
if a user is not member of that project, it can only be
assigned to them if they created the issue themselves.
-##### 3.1. Multiple Assignees
-
-> Available in [GitLab Starter](https://about.gitlab.com/products/) and
-[GitLab.com Bronze](https://about.gitlab.com/gitlab-com/).
+##### 3.1. Multiple Assignees **[STARTER]**
Often multiple people likely work on the same issue together,
which can especially be difficult to track in large teams
@@ -89,10 +86,7 @@ but they are immediately available to all projects in the group.
> **Tip:**
if the label doesn't exist yet, when you click **Edit**, it opens a dropdown menu from which you can select **Create new label**.
-#### 8. Weight
-
-> Available in [GitLab Starter](https://about.gitlab.com/products/) and
-[GitLab.com Bronze](https://about.gitlab.com/gitlab-com/).
+#### 8. Weight **[STARTER]**
- Attribute a weight (in a 0 to 9 range) to that issue. Easy to complete
should weight 1 and very hard to complete should weight 9.
diff --git a/doc/user/project/labels.md b/doc/user/project/labels.md
index a89a1206170..914898ea2ea 100644
--- a/doc/user/project/labels.md
+++ b/doc/user/project/labels.md
@@ -9,8 +9,7 @@ Labels allow you to categorize issues or merge requests using descriptive titles
In GitLab, you can create project and group labels:
- **Project labels** can be assigned to issues or merge requests in that project only.
-- **Group labels** can be assigned to any issue or merge request of any project in that group or subgroup.
-- In the [future](https://gitlab.com/gitlab-org/gitlab-ce/issues/40915), you will be able to assign group labels to issues and merge reqeusts of projects in [subgroups](../group/subgroups/index.md).
+- **Group labels** can be assigned to any issue or merge request of any project in that group or any subgroups of the group.
## Creating labels
diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md
index 3640d236db4..a6c0fd49c45 100644
--- a/doc/user/project/merge_requests/index.md
+++ b/doc/user/project/merge_requests/index.md
@@ -32,10 +32,10 @@ With GitLab merge requests, you can:
With **[GitLab Enterprise Edition][ee]**, you can also:
-- View the deployment process across projects with [Multi-Project Pipeline Graphs](https://docs.gitlab.com/ee/ci/multi_project_pipeline_graphs.html#multi-project-pipeline-graphs) (available only in GitLab Premium)
-- Request [approvals](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html) from your managers (available in GitLab Starter)
-- [Squash and merge](https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html) for a cleaner commit history (available in GitLab Starter)
-- Analyze the impact of your changes with [Code Quality reports](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html) (available in GitLab Starter)
+- View the deployment process across projects with [Multi-Project Pipeline Graphs](https://docs.gitlab.com/ee/ci/multi_project_pipeline_graphs.html#multi-project-pipeline-graphs) **[PREMIUM]**
+- Request [approvals](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html) from your managers **[STARTER]**
+- [Squash and merge](https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html) for a cleaner commit history **[STARTER]**
+- Analyze the impact of your changes with [Code Quality reports](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html) **[STARTER]**
## Use cases
@@ -43,7 +43,7 @@ A. Consider you are a software developer working in a team:
1. You checkout a new branch, and submit your changes through a merge request
1. You gather feedback from your team
-1. You work on the implementation optimizing code with [Code Quality reports](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html) (available in GitLab Starter)
+1. You work on the implementation optimizing code with [Code Quality reports](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html) **[STARTER]**
1. You build and test your changes with GitLab CI/CD
1. You request the approval from your manager
1. Your manager pushes a commit with his final review, [approves the merge request](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html), and set it to [merge when pipeline succeeds](#merge-when-pipeline-succeeds) (Merge Request Approvals are available in GitLab Starter)
@@ -56,7 +56,7 @@ B. Consider you're a web developer writing a webpage for your company's:
1. You gather feedback from your reviewers
1. Your changes are previewed with [Review Apps](../../../ci/review_apps/index.md)
1. You request your web designers for their implementation
-1. You request the [approval](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html) from your manager (available in GitLab Starter)
+1. You request the [approval](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html) from your manager **[STARTER]**
1. Once approved, your merge request is [squashed and merged](https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html), and [deployed to staging with GitLab Pages](https://about.gitlab.com/2016/08/26/ci-deployment-and-environments/) (Squash and Merge is available in GitLab Starter)
1. Your production team [cherry picks](#cherry-pick-changes) the merge commit into production
diff --git a/doc/user/project/settings/index.md b/doc/user/project/settings/index.md
index a387c1e443e..c9d2f8dc32d 100644
--- a/doc/user/project/settings/index.md
+++ b/doc/user/project/settings/index.md
@@ -34,7 +34,7 @@ Set up your project's merge request settings:
- Set up the merge request method (merge commit, [fast-forward merge](../merge_requests/fast_forward_merge.html)).
- Merge request [description templates](../description_templates.md#description-templates).
-- Enable [merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html#merge-request-approvals), _available in [GitLab Starter](https://about.gitlab.com/products/)_.
+- Enable [merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html#merge-request-approvals). **[STARTER]**
- Enable [merge only of pipeline succeeds](../merge_requests/merge_when_pipeline_succeeds.md).
- Enable [merge only when all discussions are resolved](../../discussions/index.md#only-allow-merge-requests-to-be-merged-if-all-discussions-are-resolved).
diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md
index 4b0d2c65642..b7064b83c4e 100644
--- a/doc/user/project/web_ide/index.md
+++ b/doc/user/project/web_ide/index.md
@@ -1,7 +1,7 @@
# Web IDE
-> Introduced in [GitLab Ultimate][ee] 10.4.
-> Brought to [GitLab CE][ce] in 10.7.
+> [Introduced in](https://gitlab.com/gitlab-org/gitlab-ee/issues/4539) [GitLab Ultimate][ee] 10.4.
+> [Brought to GitLab Core](https://gitlab.com/gitlab-org/gitlab-ce/issues/44157) in 10.7.
The Web IDE makes it faster and easier to contribute changes to your projects
by providing an advanced editor with commit staging.
@@ -30,5 +30,4 @@ list.
An additional review mode is available when you open a merge request, which
shows you a preview of the merge request diff if you commit your changes.
-[ee]: https://about.gitlab.com/products/
-[ce]: https://about.gitlab.com/products/
+[ee]: https://about.gitlab.com/pricing/
diff --git a/doc/workflow/notifications.md b/doc/workflow/notifications.md
index c4095ee0f69..f1501c81b27 100644
--- a/doc/workflow/notifications.md
+++ b/doc/workflow/notifications.md
@@ -86,6 +86,7 @@ In most of the below cases, the notification will be sent to:
| Close issue | |
| Reassign issue | The above, plus the old assignee |
| Reopen issue | |
+| Due issue | Participants and Custom notification level with this event selected |
| New merge request | |
| Push to merge request | Participants and Custom notification level with this event selected |
| Reassign merge request | The above, plus the old assignee |
@@ -96,15 +97,14 @@ In most of the below cases, the notification will be sent to:
| Failed pipeline | The author of the pipeline |
| Successful pipeline | The author of the pipeline, if they have the custom notification setting for successful pipelines set |
-
In addition, if the title or description of an Issue or Merge Request is
changed, notifications will be sent to any **new** mentions by `@username` as
if they had been mentioned in the original text.
-You won't receive notifications for Issues, Merge Requests or Milestones
-created by yourself. You will only receive automatic notifications when
-somebody else comments or adds changes to the ones that you've created or
-mentions you.
+You won't receive notifications for Issues, Merge Requests or Milestones created
+by yourself (except when an issue is due). You will only receive automatic
+notifications when somebody else comments or adds changes to the ones that
+you've created or mentions you.
### Email Headers
@@ -122,7 +122,7 @@ Notification emails include headers that provide extra content about the notific
| X-GitLab-NotificationReason | The reason for being notified. "mentioned", "assigned", etc |
#### X-GitLab-NotificationReason
-This header holds the reason for the notification to have been sent out,
+This header holds the reason for the notification to have been sent out,
where reason can be `mentioned`, `assigned`, `own_activity`, etc.
Only one reason is sent out according to its priority:
- `own_activity`
@@ -130,7 +130,7 @@ Only one reason is sent out according to its priority:
- `mentioned`
The reason in this header will also be shown in the footer of the notification email. For example an email with the
-reason `assigned` will have this sentence in the footer:
+reason `assigned` will have this sentence in the footer:
`"You are receiving this email because you have been assigned an item on {configured GitLab hostname}"`
**Note: Only reasons listed above have been implemented so far**
diff --git a/lib/api/discussions.rb b/lib/api/discussions.rb
index 6abd575b6ad..7975f35ab1e 100644
--- a/lib/api/discussions.rb
+++ b/lib/api/discussions.rb
@@ -25,7 +25,7 @@ module API
get ":id/#{noteables_str}/:noteable_id/discussions" do
noteable = find_noteable(parent_type, noteables_str, params[:noteable_id])
- return not_found!("Discussions") unless can?(current_user, noteable_read_ability_name(noteable), noteable)
+ break not_found!("Discussions") unless can?(current_user, noteable_read_ability_name(noteable), noteable)
notes = noteable.notes
.inc_relations_for_view
@@ -50,7 +50,7 @@ module API
notes = readable_discussion_notes(noteable, params[:discussion_id])
if notes.empty? || !can?(current_user, noteable_read_ability_name(noteable), noteable)
- return not_found!("Discussion")
+ break not_found!("Discussion")
end
discussion = Discussion.build(notes, noteable)
@@ -98,7 +98,7 @@ module API
notes = readable_discussion_notes(noteable, params[:discussion_id])
if notes.empty? || !can?(current_user, noteable_read_ability_name(noteable), noteable)
- return not_found!("Notes")
+ break not_found!("Notes")
end
present notes, with: Entities::Note
@@ -117,8 +117,8 @@ module API
noteable = find_noteable(parent_type, noteables_str, params[:noteable_id])
notes = readable_discussion_notes(noteable, params[:discussion_id])
- return not_found!("Discussion") if notes.empty?
- return bad_request!("Discussion is an individual note.") unless notes.first.part_of_discussion?
+ break not_found!("Discussion") if notes.empty?
+ break bad_request!("Discussion is an individual note.") unless notes.first.part_of_discussion?
opts = {
note: params[:body],
diff --git a/lib/api/group_variables.rb b/lib/api/group_variables.rb
index 92800ce6450..55d5c7f1606 100644
--- a/lib/api/group_variables.rb
+++ b/lib/api/group_variables.rb
@@ -31,7 +31,7 @@ module API
key = params[:key]
variable = user_group.variables.find_by(key: key)
- return not_found!('GroupVariable') unless variable
+ break not_found!('GroupVariable') unless variable
present variable, with: Entities::Variable
end
@@ -67,7 +67,7 @@ module API
put ':id/variables/:key' do
variable = user_group.variables.find_by(key: params[:key])
- return not_found!('GroupVariable') unless variable
+ break not_found!('GroupVariable') unless variable
variable_params = declared_params(include_missing: false).except(:key)
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index fcbc248fc3b..6b72caea8fd 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -50,7 +50,7 @@ module API
access_checker.check(params[:action], params[:changes])
@project ||= access_checker.project
rescue Gitlab::GitAccess::UnauthorizedError, Gitlab::GitAccess::NotFoundError => e
- return { status: false, message: e.message }
+ break { status: false, message: e.message }
end
log_user_activity(actor)
@@ -142,21 +142,21 @@ module API
if key
key.update_last_used_at
else
- return { 'success' => false, 'message' => 'Could not find the given key' }
+ break { 'success' => false, 'message' => 'Could not find the given key' }
end
if key.is_a?(DeployKey)
- return { success: false, message: 'Deploy keys cannot be used to retrieve recovery codes' }
+ break { success: false, message: 'Deploy keys cannot be used to retrieve recovery codes' }
end
user = key.user
unless user
- return { success: false, message: 'Could not find a user for the given key' }
+ break { success: false, message: 'Could not find a user for the given key' }
end
unless user.two_factor_enabled?
- return { success: false, message: 'Two-factor authentication is not enabled for this user' }
+ break { success: false, message: 'Two-factor authentication is not enabled for this user' }
end
codes = nil
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 88e7f46c92c..12ff2a1398b 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -310,7 +310,7 @@ module API
issue = find_project_issue(params[:issue_iid])
- return not_found!('UserAgentDetail') unless issue.user_agent_detail
+ break not_found!('UserAgentDetail') unless issue.user_agent_detail
present issue.user_agent_detail, with: Entities::UserAgentDetail
end
diff --git a/lib/api/job_artifacts.rb b/lib/api/job_artifacts.rb
index b1adef49d46..32379d7c8ab 100644
--- a/lib/api/job_artifacts.rb
+++ b/lib/api/job_artifacts.rb
@@ -77,7 +77,7 @@ module API
build = find_build!(params[:job_id])
authorize!(:update_build, build)
- return not_found!(build) unless build.artifacts?
+ break not_found!(build) unless build.artifacts?
build.keep_artifacts!
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index 60911c8d733..54d1acbd412 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -120,7 +120,7 @@ module API
build = find_build!(params[:job_id])
authorize!(:update_build, build)
- return forbidden!('Job is not retryable') unless build.retryable?
+ break forbidden!('Job is not retryable') unless build.retryable?
build = Ci::Build.retry(build, current_user)
@@ -138,7 +138,7 @@ module API
build = find_build!(params[:job_id])
authorize!(:erase_build, build)
- return forbidden!('Job is not erasable!') unless build.erasable?
+ break forbidden!('Job is not erasable!') unless build.erasable?
build.erase(erased_by: current_user)
present build, with: Entities::Job
diff --git a/lib/api/project_snippets.rb b/lib/api/project_snippets.rb
index 39c03c40bab..1de5551fee9 100644
--- a/lib/api/project_snippets.rb
+++ b/lib/api/project_snippets.rb
@@ -145,7 +145,7 @@ module API
snippet = Snippet.find_by!(id: params[:snippet_id], project_id: params[:id])
- return not_found!('UserAgentDetail') unless snippet.user_agent_detail
+ break not_found!('UserAgentDetail') unless snippet.user_agent_detail
present snippet.user_agent_detail, with: Entities::UserAgentDetail
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 3ae6fbd1fa9..51b3b0459f3 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -402,7 +402,7 @@ module API
end
unless user_project.allowed_to_share_with_group?
- return render_api_error!("The project sharing with group is disabled", 400)
+ break render_api_error!("The project sharing with group is disabled", 400)
end
link = user_project.project_group_links.new(declared_params(include_missing: false))
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index 60aeb69e10a..4d4fbe50f9f 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -29,7 +29,7 @@ module API
project.runners.create(attributes)
end
- return forbidden! unless runner
+ break forbidden! unless runner
if runner.id
present runner, with: Entities::RunnerRegistrationDetails
@@ -83,7 +83,7 @@ module API
if current_runner.runner_queue_value_latest?(params[:last_update])
header 'X-GitLab-Last-Update', params[:last_update]
Gitlab::Metrics.add_event(:build_not_found_cached)
- return no_content!
+ break no_content!
end
new_update = current_runner.ensure_runner_queue_value
@@ -152,7 +152,7 @@ module API
stream_size = job.trace.append(request.body.read, content_range[0].to_i)
if stream_size < 0
- return error!('416 Range Not Satisfiable', 416, { 'Range' => "0-#{-stream_size}" })
+ break error!('416 Range Not Satisfiable', 416, { 'Range' => "0-#{-stream_size}" })
end
status 202
diff --git a/lib/api/snippets.rb b/lib/api/snippets.rb
index c736cc32021..b30305b4bc9 100644
--- a/lib/api/snippets.rb
+++ b/lib/api/snippets.rb
@@ -94,7 +94,7 @@ module API
end
put ':id' do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
- return not_found!('Snippet') unless snippet
+ break not_found!('Snippet') unless snippet
authorize! :update_personal_snippet, snippet
@@ -120,7 +120,7 @@ module API
end
delete ':id' do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
- return not_found!('Snippet') unless snippet
+ break not_found!('Snippet') unless snippet
authorize! :destroy_personal_snippet, snippet
@@ -135,7 +135,7 @@ module API
end
get ":id/raw" do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
- return not_found!('Snippet') unless snippet
+ break not_found!('Snippet') unless snippet
env['api.format'] = :txt
content_type 'text/plain'
@@ -153,7 +153,7 @@ module API
snippet = Snippet.find_by!(id: params[:id])
- return not_found!('UserAgentDetail') unless snippet.user_agent_detail
+ break not_found!('UserAgentDetail') unless snippet.user_agent_detail
present snippet.user_agent_detail, with: Entities::UserAgentDetail
end
diff --git a/lib/api/triggers.rb b/lib/api/triggers.rb
index b3709455bc3..b29e660c6e0 100644
--- a/lib/api/triggers.rb
+++ b/lib/api/triggers.rb
@@ -62,7 +62,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
present trigger, with: Entities::Trigger
end
@@ -99,7 +99,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
if trigger.update(declared_params(include_missing: false))
present trigger, with: Entities::Trigger
@@ -119,7 +119,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
if trigger.update(owner: current_user)
status :ok
@@ -140,7 +140,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
destroy_conditionally!(trigger)
end
diff --git a/lib/api/v3/builds.rb b/lib/api/v3/builds.rb
index 683b9c993cb..b49448e1e67 100644
--- a/lib/api/v3/builds.rb
+++ b/lib/api/v3/builds.rb
@@ -51,7 +51,7 @@ module API
get ':id/repository/commits/:sha/builds' do
authorize_read_builds!
- return not_found! unless user_project.commit(params[:sha])
+ break not_found! unless user_project.commit(params[:sha])
pipelines = user_project.pipelines.where(sha: params[:sha])
builds = user_project.builds.where(pipeline: pipelines).order('id DESC')
@@ -153,7 +153,7 @@ module API
build = get_build!(params[:build_id])
authorize!(:update_build, build)
- return forbidden!('Build is not retryable') unless build.retryable?
+ break forbidden!('Build is not retryable') unless build.retryable?
build = Ci::Build.retry(build, current_user)
@@ -171,7 +171,7 @@ module API
build = get_build!(params[:build_id])
authorize!(:erase_build, build)
- return forbidden!('Build is not erasable!') unless build.erasable?
+ break forbidden!('Build is not erasable!') unless build.erasable?
build.erase(erased_by: current_user)
present build, with: ::API::V3::Entities::Build
@@ -188,7 +188,7 @@ module API
build = get_build!(params[:build_id])
authorize!(:update_build, build)
- return not_found!(build) unless build.artifacts?
+ break not_found!(build) unless build.artifacts?
build.keep_artifacts!
diff --git a/lib/api/v3/projects.rb b/lib/api/v3/projects.rb
index a2df969d819..eb3dd113524 100644
--- a/lib/api/v3/projects.rb
+++ b/lib/api/v3/projects.rb
@@ -423,7 +423,7 @@ module API
end
unless user_project.allowed_to_share_with_group?
- return render_api_error!("The project sharing with group is disabled", 400)
+ break render_api_error!("The project sharing with group is disabled", 400)
end
link = user_project.project_group_links.new(declared_params(include_missing: false))
diff --git a/lib/api/v3/snippets.rb b/lib/api/v3/snippets.rb
index 85613c8ed84..1df8a20e74a 100644
--- a/lib/api/v3/snippets.rb
+++ b/lib/api/v3/snippets.rb
@@ -90,7 +90,7 @@ module API
end
put ':id' do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
- return not_found!('Snippet') unless snippet
+ break not_found!('Snippet') unless snippet
authorize! :update_personal_snippet, snippet
@@ -114,7 +114,7 @@ module API
end
delete ':id' do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
- return not_found!('Snippet') unless snippet
+ break not_found!('Snippet') unless snippet
authorize! :destroy_personal_snippet, snippet
snippet.destroy
@@ -129,7 +129,7 @@ module API
end
get ":id/raw" do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
- return not_found!('Snippet') unless snippet
+ break not_found!('Snippet') unless snippet
env['api.format'] = :txt
content_type 'text/plain'
diff --git a/lib/api/v3/triggers.rb b/lib/api/v3/triggers.rb
index 34f07dfb486..969bb2a05de 100644
--- a/lib/api/v3/triggers.rb
+++ b/lib/api/v3/triggers.rb
@@ -72,7 +72,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find_by(token: params[:token].to_s)
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
present trigger, with: ::API::V3::Entities::Trigger
end
@@ -100,7 +100,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find_by(token: params[:token].to_s)
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
trigger.destroy
diff --git a/lib/api/variables.rb b/lib/api/variables.rb
index d08876ae1b9..a34de9410e8 100644
--- a/lib/api/variables.rb
+++ b/lib/api/variables.rb
@@ -31,7 +31,7 @@ module API
key = params[:key]
variable = user_project.variables.find_by(key: key)
- return not_found!('Variable') unless variable
+ break not_found!('Variable') unless variable
present variable, with: Entities::Variable
end
@@ -67,7 +67,7 @@ module API
put ':id/variables/:key' do
variable = user_project.variables.find_by(key: params[:key])
- return not_found!('Variable') unless variable
+ break not_found!('Variable') unless variable
variable_params = declared_params(include_missing: false).except(:key)
diff --git a/lib/declarative_policy/runner.rb b/lib/declarative_policy/runner.rb
index 77c91817382..87f14b3b0d2 100644
--- a/lib/declarative_policy/runner.rb
+++ b/lib/declarative_policy/runner.rb
@@ -77,7 +77,7 @@ module DeclarativePolicy
@state = State.new
steps_by_score do |step, score|
- return if !debug && @state.prevented?
+ break if !debug && @state.prevented?
passed = nil
case step.action
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 2a44e11efb6..8e5a985edd7 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -51,7 +51,7 @@ module Gitlab
Gitlab::Auth::UniqueIpsLimiter.limit_user! do
user = User.by_login(login)
- return if user && !user.active?
+ break if user && !user.active?
authenticators = []
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb
index cedf4171ab1..47b67930c6d 100644
--- a/lib/gitlab/ci/trace.rb
+++ b/lib/gitlab/ci/trace.rb
@@ -45,7 +45,7 @@ module Gitlab
def append(data, offset)
write do |stream|
current_length = stream.size
- return -current_length unless current_length == offset
+ break -current_length unless current_length == offset
data = job.hide_secrets(data)
stream.append(data, offset)
diff --git a/lib/gitlab/ci/trace/http_io.rb b/lib/gitlab/ci/trace/http_io.rb
index ac4308f4e2c..cff924e27ef 100644
--- a/lib/gitlab/ci/trace/http_io.rb
+++ b/lib/gitlab/ci/trace/http_io.rb
@@ -75,18 +75,28 @@ module Gitlab
end
end
- def read(length = nil)
+ def read(length = nil, outbuf = "")
out = ""
- until eof? || (length && out.length >= length)
+ length ||= size - tell
+
+ until length <= 0 || eof?
data = get_chunk
break if data.empty?
- out << data
- @tell += data.bytesize
+ chunk_bytes = [BUFFER_SIZE - chunk_offset, length].min
+ chunk_data = data.byteslice(0, chunk_bytes)
+
+ out << chunk_data
+ @tell += chunk_data.bytesize
+ length -= chunk_data.bytesize
end
- out = out[0, length] if length && out.length > length
+ # If outbuf is passed, we put the output into the buffer. This supports IO.copy_stream functionality
+ if outbuf
+ outbuf.slice!(0, outbuf.bytesize)
+ outbuf << out
+ end
out
end
@@ -158,7 +168,7 @@ module Gitlab
# Provider: GCS
# - When the file size is larger than requested Content-range, the Content-range is included in responces with Net::HTTPPartialContent 206
# - When the file size is smaller than requested Content-range, the Content-range is included in responces with Net::HTTPOK 200
- @chunk_range ||= (chunk_start...(chunk_start + @chunk.length))
+ @chunk_range ||= (chunk_start...(chunk_start + @chunk.bytesize))
end
@chunk[chunk_offset..BUFFER_SIZE]
diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb
index 54894a46077..187ad8b833a 100644
--- a/lib/gitlab/ci/trace/stream.rb
+++ b/lib/gitlab/ci/trace/stream.rb
@@ -10,7 +10,9 @@ module Gitlab
delegate :close, :tell, :seek, :size, :url, :truncate, to: :stream, allow_nil: true
- delegate :valid?, to: :stream, as: :present?, allow_nil: true
+ delegate :valid?, to: :stream, allow_nil: true
+
+ alias_method :present?, :valid?
def initialize
@stream = yield
@@ -85,7 +87,7 @@ module Gitlab
match = matches.flatten.last
coverage = match.gsub(/\d+(\.\d+)?/).first
- return coverage if coverage.present?
+ return coverage if coverage.present? # rubocop:disable Cop/AvoidReturnFromBlocks
end
nil
diff --git a/lib/gitlab/daemon.rb b/lib/gitlab/daemon.rb
index 633de9f9776..bd14c7eece3 100644
--- a/lib/gitlab/daemon.rb
+++ b/lib/gitlab/daemon.rb
@@ -30,7 +30,7 @@ module Gitlab
return unless enabled?
@mutex.synchronize do
- return thread if thread?
+ break thread if thread?
@thread = Thread.new { start_working }
end
@@ -38,7 +38,7 @@ module Gitlab
def stop
@mutex.synchronize do
- return unless thread?
+ break unless thread?
stop_working
diff --git a/lib/gitlab/gfm/uploads_rewriter.rb b/lib/gitlab/gfm/uploads_rewriter.rb
index 1b74f735679..b6eeb5d9a2b 100644
--- a/lib/gitlab/gfm/uploads_rewriter.rb
+++ b/lib/gitlab/gfm/uploads_rewriter.rb
@@ -21,7 +21,7 @@ module Gitlab
@text.gsub(@pattern) do |markdown|
file = find_file(@source_project, $~[:secret], $~[:file])
- return markdown unless file.try(:exists?)
+ break markdown unless file.try(:exists?)
new_uploader = FileUploader.new(target_project)
with_link_in_tmp_dir(file.file) do |open_tmp_file|
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb
index 0fb82441bf8..fabcd46c8e9 100644
--- a/lib/gitlab/git/commit.rb
+++ b/lib/gitlab/git/commit.rb
@@ -486,6 +486,8 @@ module Gitlab
end
def tree_entry(path)
+ return unless path.present?
+
@repository.gitaly_migrate(:commit_tree_entry) do |is_migrated|
if is_migrated
gitaly_tree_entry(path)
diff --git a/lib/gitlab/git/diff.rb b/lib/gitlab/git/diff.rb
index a203587aec1..b58296375ef 100644
--- a/lib/gitlab/git/diff.rb
+++ b/lib/gitlab/git/diff.rb
@@ -249,7 +249,7 @@ module Gitlab
if size >= SIZE_LIMIT
too_large!
- return true
+ return true # rubocop:disable Cop/AvoidReturnFromBlocks
end
end
end
diff --git a/lib/gitlab/git/popen.rb b/lib/gitlab/git/popen.rb
index c1767046ff0..f9f24ecc48d 100644
--- a/lib/gitlab/git/popen.rb
+++ b/lib/gitlab/git/popen.rb
@@ -25,7 +25,9 @@ module Gitlab
stdin.close
if lazy_block
- return [lazy_block.call(stdout.lazy), 0]
+ cmd_output = lazy_block.call(stdout.lazy)
+ cmd_status = 0
+ break
else
cmd_output << stdout.read
end
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 294475be9c6..3124c426f97 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -300,7 +300,8 @@ module Gitlab
#
# Ref names must start with `refs/`.
def ref_exists?(ref_name)
- gitaly_migrate(:ref_exists) do |is_enabled|
+ gitaly_migrate(:ref_exists,
+ status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled
gitaly_ref_exists?(ref_name)
else
diff --git a/lib/gitlab/git/repository_mirroring.rb b/lib/gitlab/git/repository_mirroring.rb
index dc424a433fb..8a01f92e2af 100644
--- a/lib/gitlab/git/repository_mirroring.rb
+++ b/lib/gitlab/git/repository_mirroring.rb
@@ -26,7 +26,7 @@ module Gitlab
# When the remote repo does not have tags.
if target.nil? || path.nil?
Rails.logger.info "Empty or invalid list of tags for remote: #{remote}. Output: #{output}"
- return []
+ break []
end
name = path.split('/', 3).last
diff --git a/lib/gitlab/optimistic_locking.rb b/lib/gitlab/optimistic_locking.rb
index 1d9a5d1a20a..d09bce642b0 100644
--- a/lib/gitlab/optimistic_locking.rb
+++ b/lib/gitlab/optimistic_locking.rb
@@ -3,18 +3,15 @@ module Gitlab
module_function
def retry_lock(subject, retries = 100, &block)
- loop do
- begin
- ActiveRecord::Base.transaction do
- return yield(subject)
- end
- rescue ActiveRecord::StaleObjectError
- retries -= 1
- raise unless retries >= 0
-
- subject.reload
- end
+ ActiveRecord::Base.transaction do
+ yield(subject)
end
+ rescue ActiveRecord::StaleObjectError
+ retries -= 1
+ raise unless retries >= 0
+
+ subject.reload
+ retry
end
alias_method :retry_optimistic_lock, :retry_lock
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb
index 67407b651a5..ac4ac537a8a 100644
--- a/lib/gitlab/shell.rb
+++ b/lib/gitlab/shell.rb
@@ -340,7 +340,7 @@ module Gitlab
if enabled
gitaly_namespace_client(storage).rename(old_name, new_name)
else
- return false if exists?(storage, new_name) || !exists?(storage, old_name)
+ break false if exists?(storage, new_name) || !exists?(storage, old_name)
FileUtils.mv(full_path(storage, old_name), full_path(storage, new_name))
end
diff --git a/lib/gitlab/sidekiq_middleware/shutdown.rb b/lib/gitlab/sidekiq_middleware/shutdown.rb
index c2b8d6de66e..b232ac4da33 100644
--- a/lib/gitlab/sidekiq_middleware/shutdown.rb
+++ b/lib/gitlab/sidekiq_middleware/shutdown.rb
@@ -25,7 +25,7 @@ module Gitlab
# can be only one shutdown thread in the process.
def self.create_shutdown_thread
mu_synchronize do
- return unless @shutdown_thread.nil?
+ break unless @shutdown_thread.nil?
@shutdown_thread = Thread.new { yield }
end
diff --git a/lib/tasks/gitlab/storage.rake b/lib/tasks/gitlab/storage.rake
index 8ac73bc8ff2..6e8bd9078c8 100644
--- a/lib/tasks/gitlab/storage.rake
+++ b/lib/tasks/gitlab/storage.rake
@@ -111,7 +111,7 @@ namespace :gitlab do
puts " - #{project.full_path} (id: #{project.id})".color(:red)
- return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator
+ return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator, Cop/AvoidReturnFromBlocks
end
end
end
@@ -132,7 +132,7 @@ namespace :gitlab do
puts " - #{upload.path} (id: #{upload.id})".color(:red)
- return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator
+ return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator, Cop/AvoidReturnFromBlocks
end
end
end
diff --git a/qa/qa/factory/base.rb b/qa/qa/factory/base.rb
index afaa96b4541..7a532ce534b 100644
--- a/qa/qa/factory/base.rb
+++ b/qa/qa/factory/base.rb
@@ -22,7 +22,7 @@ module QA
factory.fabricate!(*args)
- return Factory::Product.populate!(factory)
+ break Factory::Product.populate!(factory)
end
end
diff --git a/qa/qa/page/group/show.rb b/qa/qa/page/group/show.rb
index d215518d316..89125bd2e59 100644
--- a/qa/qa/page/group/show.rb
+++ b/qa/qa/page/group/show.rb
@@ -29,7 +29,7 @@ module QA
filter_by_name(name)
wait(reload: false) do
- return false if page.has_content?('Sorry, no groups or projects matched your search')
+ break false if page.has_content?('Sorry, no groups or projects matched your search')
page.has_link?(name)
end
diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb
index b183552d46c..ec61c47b3bb 100644
--- a/qa/qa/page/project/pipeline/show.rb
+++ b/qa/qa/page/project/pipeline/show.rb
@@ -20,14 +20,14 @@ module QA::Page
def running?
within('.ci-header-container') do
- return page.has_content?('running')
+ page.has_content?('running')
end
end
def has_build?(name, status: :success)
within('.pipeline-graph') do
within('.ci-job-component', text: name) do
- return has_selector?(".ci-status-icon-#{status}")
+ has_selector?(".ci-status-icon-#{status}")
end
end
end
diff --git a/qa/qa/scenario/template.rb b/qa/qa/scenario/template.rb
index 341998af160..d21a9d52997 100644
--- a/qa/qa/scenario/template.rb
+++ b/qa/qa/scenario/template.rb
@@ -4,7 +4,7 @@ module QA
def self.perform(*args)
new.tap do |scenario|
yield scenario if block_given?
- return scenario.perform(*args)
+ break scenario.perform(*args)
end
end
diff --git a/rubocop/cop/avoid_break_from_strong_memoize.rb b/rubocop/cop/avoid_break_from_strong_memoize.rb
new file mode 100644
index 00000000000..9b436118db3
--- /dev/null
+++ b/rubocop/cop/avoid_break_from_strong_memoize.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+module RuboCop
+ module Cop
+ # Checks for break inside strong_memoize blocks.
+ # For more information see: https://gitlab.com/gitlab-org/gitlab-ce/issues/42889
+ #
+ # @example
+ # # bad
+ # strong_memoize(:result) do
+ # break if something
+ #
+ # do_an_heavy_calculation
+ # end
+ #
+ # # good
+ # strong_memoize(:result) do
+ # next if something
+ #
+ # do_an_heavy_calculation
+ # end
+ #
+ class AvoidBreakFromStrongMemoize < RuboCop::Cop::Cop
+ MSG = 'Do not use break inside strong_memoize, use next instead.'
+
+ def on_block(node)
+ block_body = node.body
+
+ return unless block_body
+ return unless node.method_name == :strong_memoize
+
+ block_body.each_node(:break) do |break_node|
+ next if container_block_for(break_node) != node
+
+ add_offense(break_node)
+ end
+ end
+
+ private
+
+ def container_block_for(current_node)
+ current_node = current_node.parent until current_node.type == :block && current_node.method_name == :strong_memoize
+
+ current_node
+ end
+ end
+ end
+end
diff --git a/rubocop/cop/avoid_return_from_blocks.rb b/rubocop/cop/avoid_return_from_blocks.rb
new file mode 100644
index 00000000000..40b2aed019f
--- /dev/null
+++ b/rubocop/cop/avoid_return_from_blocks.rb
@@ -0,0 +1,77 @@
+# frozen_string_literal: true
+
+module RuboCop
+ module Cop
+ # Checks for return inside blocks.
+ # For more information see: https://gitlab.com/gitlab-org/gitlab-ce/issues/42889
+ #
+ # @example
+ # # bad
+ # call do
+ # return if something
+ #
+ # do_something_else
+ # end
+ #
+ # # good
+ # call do
+ # break if something
+ #
+ # do_something_else
+ # end
+ #
+ class AvoidReturnFromBlocks < RuboCop::Cop::Cop
+ MSG = 'Do not return from a block, use next or break instead.'
+ DEF_METHODS = %i[define_method lambda].freeze
+ WHITELISTED_METHODS = %i[each each_filename times loop].freeze
+
+ def on_block(node)
+ block_body = node.body
+
+ return unless block_body
+ return unless top_block?(node)
+
+ block_body.each_node(:return) do |return_node|
+ next if parent_blocks(node, return_node).all?(&method(:whitelisted?))
+
+ add_offense(return_node)
+ end
+ end
+
+ private
+
+ def top_block?(node)
+ current_node = node
+ top_block = nil
+
+ while current_node && current_node.type != :def
+ top_block = current_node if current_node.type == :block
+ current_node = current_node.parent
+ end
+
+ top_block == node
+ end
+
+ def parent_blocks(node, current_node)
+ blocks = []
+
+ until node == current_node || def?(current_node)
+ blocks << current_node if current_node.type == :block
+ current_node = current_node.parent
+ end
+
+ blocks << node if node == current_node && !def?(node)
+ blocks
+ end
+
+ def def?(node)
+ node.type == :def || node.type == :defs ||
+ (node.type == :block && DEF_METHODS.include?(node.method_name))
+ end
+
+ def whitelisted?(block_node)
+ WHITELISTED_METHODS.include?(block_node.method_name)
+ end
+ end
+ end
+end
diff --git a/rubocop/cop/migration/safer_boolean_column.rb b/rubocop/cop/migration/safer_boolean_column.rb
index dc5c55df6fb..a7d922c752f 100644
--- a/rubocop/cop/migration/safer_boolean_column.rb
+++ b/rubocop/cop/migration/safer_boolean_column.rb
@@ -61,7 +61,7 @@ module RuboCop
return true unless opts
each_hash_node_pair(opts) do |key, value|
- return value == 'nil' if key == :default
+ break value == 'nil' if key == :default
end
end
@@ -69,7 +69,7 @@ module RuboCop
return true unless opts
each_hash_node_pair(opts) do |key, value|
- return value != 'false' if key == :null
+ break value != 'false' if key == :null
end
end
diff --git a/rubocop/rubocop.rb b/rubocop/rubocop.rb
index c2254332e7d..96061672749 100644
--- a/rubocop/rubocop.rb
+++ b/rubocop/rubocop.rb
@@ -4,6 +4,8 @@ require_relative 'cop/gitlab/httparty'
require_relative 'cop/gitlab/module_with_instance_variables'
require_relative 'cop/gitlab/predicate_memoization'
require_relative 'cop/include_sidekiq_worker'
+require_relative 'cop/avoid_return_from_blocks'
+require_relative 'cop/avoid_break_from_strong_memoize'
require_relative 'cop/line_break_around_conditional_block'
require_relative 'cop/migration/add_column'
require_relative 'cop/migration/add_concurrent_foreign_key'
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index e1fafa71d5c..33de637ff7d 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -62,6 +62,7 @@ FactoryBot.define do
end
trait :pending do
+ queued_at 'Di 29. Okt 09:50:59 CET 2013'
status 'pending'
end
diff --git a/spec/fixtures/trace/sample_trace b/spec/fixtures/trace/sample_trace
index 55fcb9d2756..c65cf05d5ca 100644
--- a/spec/fixtures/trace/sample_trace
+++ b/spec/fixtures/trace/sample_trace
@@ -1,24 +1,24 @@
-Running with gitlab-runner 10.4.0 (857480b6)
- on docker-auto-scale-com (9a6801bd)
-Using Docker executor with image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.6-golang-1.9-git-2.14-chrome-63.0-node-8.x-yarn-1.2-postgresql-9.6 ...
-Starting service postgres:9.2 ...
-Pulling docker image postgres:9.2 ...
-Using docker image postgres:9.2 ID=sha256:18cdbca56093c841d28e629eb8acd4224afe0aa4c57c839351fc181888b8a470 for postgres service...
+Running with gitlab-runner 10.6.0 (a3543a27)
+ on docker-auto-scale-com 30d62d59
+Using Docker executor with image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.6-golang-1.9-git-2.16-chrome-63.0-node-8.x-yarn-1.2-postgresql-9.6 ...
+Starting service mysql:latest ...
+Pulling docker image mysql:latest ...
+Using docker image sha256:5195076672a7e30525705a18f7d352c920bbd07a5ae72b30e374081fe660a011 for mysql:latest ...
Starting service redis:alpine ...
Pulling docker image redis:alpine ...
-Using docker image redis:alpine ID=sha256:cb1ec54b370d4a91dff57d00f91fd880dc710160a58440adaa133e0f84ae999d for redis service...
+Using docker image sha256:98bd7cfc43b8ef0ff130465e3d5427c0771002c2f35a6a9b62cb2d04602bed0a for redis:alpine ...
Waiting for services to be up and running...
-Using docker image sha256:3006a02a5a6f0a116358a13bbc46ee46fb2471175efd5b7f9b1c22345ec2a8e9 for predefined container...
-Pulling docker image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.6-golang-1.9-git-2.14-chrome-63.0-node-8.x-yarn-1.2-postgresql-9.6 ...
-Using docker image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.6-golang-1.9-git-2.14-chrome-63.0-node-8.x-yarn-1.2-postgresql-9.6 ID=sha256:1f59be408f12738509ffe4177d65e9de6391f32461de83d9d45f58517b30af99 for build container...
-section_start:1517486886:prepare_script
-Running on runner-9a6801bd-project-13083-concurrent-0 via runner-9a6801bd-gsrm-1517484168-a8449153...
-section_end:1517486887:prepare_script
-section_start:1517486887:get_sources
-Fetching changes for 42624-gitaly-bundle-isolation-not-working-in-ci with git depth set to 20...
+Pulling docker image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.6-golang-1.9-git-2.16-chrome-63.0-node-8.x-yarn-1.2-postgresql-9.6 ...
+Using docker image sha256:1b06077bb03d9d42d801b53f45701bb6a7e862ca02e1e75f30ca7fcf1270eb02 for dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.6-golang-1.9-git-2.16-chrome-63.0-node-8.x-yarn-1.2-postgresql-9.6 ...
+section_start:1522927103:prepare_script
+Running on runner-30d62d59-project-13083-concurrent-0 via runner-30d62d59-prm-1522922015-ddc29478...
+section_end:1522927104:prepare_script
+section_start:1522927104:get_sources
+Fetching changes for master with git depth set to 20...
Removing .gitlab_shell_secret
Removing .gitlab_workhorse_secret
Removing .yarn-cache/
+Removing builds/2018_04/
Removing config/database.yml
Removing config/gitlab.yml
Removing config/redis.cache.yml
@@ -26,1160 +26,3420 @@ Removing config/redis.queues.yml
Removing config/redis.shared_state.yml
Removing config/resque.yml
Removing config/secrets.yml
-Removing coverage/
-Removing knapsack/
Removing log/api_json.log
Removing log/application.log
Removing log/gitaly-test.log
-Removing log/githost.log
Removing log/grpc.log
Removing log/test_json.log
-Removing node_modules/
-Removing public/assets/
-Removing rspec_flaky/
-Removing shared/tmp/
Removing tmp/tests/
Removing vendor/ruby/
-HEAD is now at 4cea24f Converted todos.js to axios
+HEAD is now at b7cbff3d Add `direct_upload` setting for artifacts
From https://gitlab.com/gitlab-org/gitlab-ce
- * [new branch] 42624-gitaly-bundle-isolation-not-working-in-ci -> origin/42624-gitaly-bundle-isolation-not-working-in-ci
-Checking out f42a5e24 as 42624-gitaly-bundle-isolation-not-working-in-ci...
+ 2dbcb9cb..641bb13b master -> origin/master
+Checking out 21488c74 as master...
Skipping Git submodules setup
-section_end:1517486896:get_sources
-section_start:1517486896:restore_cache
+section_end:1522927113:get_sources
+section_start:1522927113:restore_cache
Checking cache for ruby-2.3.6-with-yarn...
Downloading cache.zip from http://runners-cache-5-internal.gitlab.com:444/runner/project/13083/ruby-2.3.6-with-yarn
Successfully extracted cache
-section_end:1517486919:restore_cache
-section_start:1517486919:download_artifacts
-Downloading artifacts for retrieve-tests-metadata (50551658)...
-Downloading artifacts from coordinator... ok  id=50551658 responseStatus=200 OK token=HhF7y_1X
-Downloading artifacts for compile-assets (50551659)...
-Downloading artifacts from coordinator... ok  id=50551659 responseStatus=200 OK token=wTz6JrCP
-Downloading artifacts for setup-test-env (50551660)...
-Downloading artifacts from coordinator... ok  id=50551660 responseStatus=200 OK token=DTGgeVF5
+section_end:1522927128:restore_cache
+section_start:1522927128:download_artifacts
+Downloading artifacts for retrieve-tests-metadata (61303215)...
+Downloading artifacts from coordinator... ok  id=61303215 responseStatus=200 OK token=AdWPNg2R
+Downloading artifacts for compile-assets (61303216)...
+Downloading artifacts from coordinator... ok  id=61303216 responseStatus=200 OK token=iy2yYbq8
+Downloading artifacts for setup-test-env (61303217)...
+Downloading artifacts from coordinator... ok  id=61303217 responseStatus=200 OK token=ur1g79-4
WARNING: tmp/tests/gitlab-shell/.gitlab_shell_secret: chmod tmp/tests/gitlab-shell/.gitlab_shell_secret: no such file or directory (suppressing repeats)
-section_end:1517486934:download_artifacts
-section_start:1517486934:build_script
+section_end:1522927141:download_artifacts
+section_start:1522927141:build_script
$ bundle --version
Bundler version 1.16.1
+$ date
+Thu Apr 5 11:19:01 UTC 2018
$ source scripts/utils.sh
+$ date
+Thu Apr 5 11:19:01 UTC 2018
$ source scripts/prepare_build.sh
The Gemfile's dependencies are satisfied
-Successfully installed knapsack-1.15.0
+Successfully installed knapsack-1.16.0
1 gem installed
-NOTICE: database "gitlabhq_test" does not exist, skipping
-DROP DATABASE
-CREATE DATABASE
-CREATE ROLE
-GRANT
-- enable_extension("plpgsql")
- -> 0.0156s
+ -> 0.0010s
-- enable_extension("pg_trgm")
- -> 0.0156s
+ -> 0.0000s
-- create_table("abuse_reports", {:force=>:cascade})
- -> 0.0119s
+ -> 0.0401s
-- create_table("appearances", {:force=>:cascade})
- -> 0.0065s
+ -> 0.1035s
-- create_table("application_settings", {:force=>:cascade})
- -> 0.0382s
+ -> 0.0871s
-- create_table("audit_events", {:force=>:cascade})
- -> 0.0056s
+ -> 0.0539s
-- add_index("audit_events", ["entity_id", "entity_type"], {:name=>"index_audit_events_on_entity_id_and_entity_type", :using=>:btree})
- -> 0.0040s
+ -> 0.0647s
-- create_table("award_emoji", {:force=>:cascade})
- -> 0.0058s
+ -> 0.0134s
-- add_index("award_emoji", ["awardable_type", "awardable_id"], {:name=>"index_award_emoji_on_awardable_type_and_awardable_id", :using=>:btree})
- -> 0.0068s
+ -> 0.0074s
-- add_index("award_emoji", ["user_id", "name"], {:name=>"index_award_emoji_on_user_id_and_name", :using=>:btree})
- -> 0.0043s
+ -> 0.0072s
+-- create_table("badges", {:force=>:cascade})
+ -> 0.0122s
+-- add_index("badges", ["group_id"], {:name=>"index_badges_on_group_id", :using=>:btree})
+ -> 0.0086s
+-- add_index("badges", ["project_id"], {:name=>"index_badges_on_project_id", :using=>:btree})
+ -> 0.0069s
-- create_table("boards", {:force=>:cascade})
- -> 0.0049s
+ -> 0.0075s
+-- add_index("boards", ["group_id"], {:name=>"index_boards_on_group_id", :using=>:btree})
+ -> 0.0050s
-- add_index("boards", ["project_id"], {:name=>"index_boards_on_project_id", :using=>:btree})
- -> 0.0056s
+ -> 0.0051s
-- create_table("broadcast_messages", {:force=>:cascade})
- -> 0.0056s
+ -> 0.0082s
-- add_index("broadcast_messages", ["starts_at", "ends_at", "id"], {:name=>"index_broadcast_messages_on_starts_at_and_ends_at_and_id", :using=>:btree})
- -> 0.0041s
+ -> 0.0063s
-- create_table("chat_names", {:force=>:cascade})
- -> 0.0056s
+ -> 0.0084s
-- add_index("chat_names", ["service_id", "team_id", "chat_id"], {:name=>"index_chat_names_on_service_id_and_team_id_and_chat_id", :unique=>true, :using=>:btree})
- -> 0.0039s
+ -> 0.0088s
-- add_index("chat_names", ["user_id", "service_id"], {:name=>"index_chat_names_on_user_id_and_service_id", :unique=>true, :using=>:btree})
- -> 0.0036s
+ -> 0.0077s
-- create_table("chat_teams", {:force=>:cascade})
- -> 0.0068s
+ -> 0.0120s
-- add_index("chat_teams", ["namespace_id"], {:name=>"index_chat_teams_on_namespace_id", :unique=>true, :using=>:btree})
- -> 0.0098s
+ -> 0.0135s
-- create_table("ci_build_trace_section_names", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0125s
-- add_index("ci_build_trace_section_names", ["project_id", "name"], {:name=>"index_ci_build_trace_section_names_on_project_id_and_name", :unique=>true, :using=>:btree})
- -> 0.0035s
+ -> 0.0087s
-- create_table("ci_build_trace_sections", {:force=>:cascade})
- -> 0.0040s
+ -> 0.0094s
-- add_index("ci_build_trace_sections", ["build_id", "section_name_id"], {:name=>"index_ci_build_trace_sections_on_build_id_and_section_name_id", :unique=>true, :using=>:btree})
- -> 0.0035s
+ -> 0.0916s
-- add_index("ci_build_trace_sections", ["project_id"], {:name=>"index_ci_build_trace_sections_on_project_id", :using=>:btree})
- -> 0.0033s
+ -> 0.0089s
+-- add_index("ci_build_trace_sections", ["section_name_id"], {:name=>"index_ci_build_trace_sections_on_section_name_id", :using=>:btree})
+ -> 0.0132s
-- create_table("ci_builds", {:force=>:cascade})
- -> 0.0062s
+ -> 0.0140s
+-- add_index("ci_builds", ["artifacts_expire_at"], {:name=>"index_ci_builds_on_artifacts_expire_at", :where=>"(artifacts_file <> ''::text)", :using=>:btree})
+ -> 0.0325s
-- add_index("ci_builds", ["auto_canceled_by_id"], {:name=>"index_ci_builds_on_auto_canceled_by_id", :using=>:btree})
- -> 0.0035s
+ -> 0.0081s
-- add_index("ci_builds", ["commit_id", "stage_idx", "created_at"], {:name=>"index_ci_builds_on_commit_id_and_stage_idx_and_created_at", :using=>:btree})
- -> 0.0032s
+ -> 0.0114s
-- add_index("ci_builds", ["commit_id", "status", "type"], {:name=>"index_ci_builds_on_commit_id_and_status_and_type", :using=>:btree})
- -> 0.0032s
+ -> 0.0119s
-- add_index("ci_builds", ["commit_id", "type", "name", "ref"], {:name=>"index_ci_builds_on_commit_id_and_type_and_name_and_ref", :using=>:btree})
- -> 0.0035s
+ -> 0.0116s
-- add_index("ci_builds", ["commit_id", "type", "ref"], {:name=>"index_ci_builds_on_commit_id_and_type_and_ref", :using=>:btree})
- -> 0.0042s
+ -> 0.0144s
-- add_index("ci_builds", ["project_id", "id"], {:name=>"index_ci_builds_on_project_id_and_id", :using=>:btree})
- -> 0.0031s
+ -> 0.0136s
-- add_index("ci_builds", ["protected"], {:name=>"index_ci_builds_on_protected", :using=>:btree})
- -> 0.0031s
+ -> 0.0113s
-- add_index("ci_builds", ["runner_id"], {:name=>"index_ci_builds_on_runner_id", :using=>:btree})
- -> 0.0033s
+ -> 0.0082s
-- add_index("ci_builds", ["stage_id"], {:name=>"index_ci_builds_on_stage_id", :using=>:btree})
- -> 0.0035s
+ -> 0.0086s
-- add_index("ci_builds", ["status", "type", "runner_id"], {:name=>"index_ci_builds_on_status_and_type_and_runner_id", :using=>:btree})
- -> 0.0031s
+ -> 0.0091s
-- add_index("ci_builds", ["status"], {:name=>"index_ci_builds_on_status", :using=>:btree})
- -> 0.0032s
+ -> 0.0081s
-- add_index("ci_builds", ["token"], {:name=>"index_ci_builds_on_token", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0103s
-- add_index("ci_builds", ["updated_at"], {:name=>"index_ci_builds_on_updated_at", :using=>:btree})
- -> 0.0047s
+ -> 0.0149s
-- add_index("ci_builds", ["user_id"], {:name=>"index_ci_builds_on_user_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0156s
+-- create_table("ci_builds_metadata", {:force=>:cascade})
+ -> 0.0134s
+-- add_index("ci_builds_metadata", ["build_id"], {:name=>"index_ci_builds_metadata_on_build_id", :unique=>true, :using=>:btree})
+ -> 0.0067s
+-- add_index("ci_builds_metadata", ["project_id"], {:name=>"index_ci_builds_metadata_on_project_id", :using=>:btree})
+ -> 0.0061s
-- create_table("ci_group_variables", {:force=>:cascade})
- -> 0.0055s
+ -> 0.0088s
-- add_index("ci_group_variables", ["group_id", "key"], {:name=>"index_ci_group_variables_on_group_id_and_key", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0073s
-- create_table("ci_job_artifacts", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0089s
+-- add_index("ci_job_artifacts", ["expire_at", "job_id"], {:name=>"index_ci_job_artifacts_on_expire_at_and_job_id", :using=>:btree})
+ -> 0.0061s
-- add_index("ci_job_artifacts", ["job_id", "file_type"], {:name=>"index_ci_job_artifacts_on_job_id_and_file_type", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0077s
-- add_index("ci_job_artifacts", ["project_id"], {:name=>"index_ci_job_artifacts_on_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0071s
-- create_table("ci_pipeline_schedule_variables", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0512s
-- add_index("ci_pipeline_schedule_variables", ["pipeline_schedule_id", "key"], {:name=>"index_ci_pipeline_schedule_variables_on_schedule_id_and_key", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0144s
-- create_table("ci_pipeline_schedules", {:force=>:cascade})
- -> 0.0047s
+ -> 0.0603s
-- add_index("ci_pipeline_schedules", ["next_run_at", "active"], {:name=>"index_ci_pipeline_schedules_on_next_run_at_and_active", :using=>:btree})
- -> 0.0029s
+ -> 0.0247s
-- add_index("ci_pipeline_schedules", ["project_id"], {:name=>"index_ci_pipeline_schedules_on_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0082s
-- create_table("ci_pipeline_variables", {:force=>:cascade})
- -> 0.0045s
+ -> 0.0112s
-- add_index("ci_pipeline_variables", ["pipeline_id", "key"], {:name=>"index_ci_pipeline_variables_on_pipeline_id_and_key", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0075s
-- create_table("ci_pipelines", {:force=>:cascade})
- -> 0.0057s
+ -> 0.0111s
-- add_index("ci_pipelines", ["auto_canceled_by_id"], {:name=>"index_ci_pipelines_on_auto_canceled_by_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0074s
-- add_index("ci_pipelines", ["pipeline_schedule_id"], {:name=>"index_ci_pipelines_on_pipeline_schedule_id", :using=>:btree})
- -> 0.0031s
+ -> 0.0086s
-- add_index("ci_pipelines", ["project_id", "ref", "status", "id"], {:name=>"index_ci_pipelines_on_project_id_and_ref_and_status_and_id", :using=>:btree})
- -> 0.0032s
+ -> 0.0104s
-- add_index("ci_pipelines", ["project_id", "sha"], {:name=>"index_ci_pipelines_on_project_id_and_sha", :using=>:btree})
- -> 0.0032s
+ -> 0.0107s
-- add_index("ci_pipelines", ["project_id"], {:name=>"index_ci_pipelines_on_project_id", :using=>:btree})
- -> 0.0035s
+ -> 0.0084s
-- add_index("ci_pipelines", ["status"], {:name=>"index_ci_pipelines_on_status", :using=>:btree})
- -> 0.0032s
+ -> 0.0065s
-- add_index("ci_pipelines", ["user_id"], {:name=>"index_ci_pipelines_on_user_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0071s
-- create_table("ci_runner_projects", {:force=>:cascade})
- -> 0.0035s
+ -> 0.0077s
-- add_index("ci_runner_projects", ["project_id"], {:name=>"index_ci_runner_projects_on_project_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0072s
-- add_index("ci_runner_projects", ["runner_id"], {:name=>"index_ci_runner_projects_on_runner_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0064s
-- create_table("ci_runners", {:force=>:cascade})
- -> 0.0059s
+ -> 0.0090s
-- add_index("ci_runners", ["contacted_at"], {:name=>"index_ci_runners_on_contacted_at", :using=>:btree})
- -> 0.0030s
+ -> 0.0078s
-- add_index("ci_runners", ["is_shared"], {:name=>"index_ci_runners_on_is_shared", :using=>:btree})
- -> 0.0030s
+ -> 0.0054s
-- add_index("ci_runners", ["locked"], {:name=>"index_ci_runners_on_locked", :using=>:btree})
- -> 0.0030s
+ -> 0.0052s
-- add_index("ci_runners", ["token"], {:name=>"index_ci_runners_on_token", :using=>:btree})
- -> 0.0029s
+ -> 0.0057s
-- create_table("ci_stages", {:force=>:cascade})
- -> 0.0046s
--- add_index("ci_stages", ["pipeline_id", "name"], {:name=>"index_ci_stages_on_pipeline_id_and_name", :using=>:btree})
- -> 0.0031s
+ -> 0.0059s
+-- add_index("ci_stages", ["pipeline_id", "name"], {:name=>"index_ci_stages_on_pipeline_id_and_name", :unique=>true, :using=>:btree})
+ -> 0.0054s
-- add_index("ci_stages", ["pipeline_id"], {:name=>"index_ci_stages_on_pipeline_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0045s
-- add_index("ci_stages", ["project_id"], {:name=>"index_ci_stages_on_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0053s
-- create_table("ci_trigger_requests", {:force=>:cascade})
- -> 0.0058s
+ -> 0.0079s
-- add_index("ci_trigger_requests", ["commit_id"], {:name=>"index_ci_trigger_requests_on_commit_id", :using=>:btree})
- -> 0.0031s
+ -> 0.0059s
-- create_table("ci_triggers", {:force=>:cascade})
- -> 0.0043s
+ -> 0.0100s
-- add_index("ci_triggers", ["project_id"], {:name=>"index_ci_triggers_on_project_id", :using=>:btree})
- -> 0.0033s
--- create_table("ci_variables", {:force=>:cascade})
-> 0.0059s
+-- create_table("ci_variables", {:force=>:cascade})
+ -> 0.0110s
-- add_index("ci_variables", ["project_id", "key", "environment_scope"], {:name=>"index_ci_variables_on_project_id_and_key_and_environment_scope", :unique=>true, :using=>:btree})
- -> 0.0031s
+ -> 0.0066s
-- create_table("cluster_platforms_kubernetes", {:force=>:cascade})
- -> 0.0053s
+ -> 0.0082s
-- add_index("cluster_platforms_kubernetes", ["cluster_id"], {:name=>"index_cluster_platforms_kubernetes_on_cluster_id", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0047s
-- create_table("cluster_projects", {:force=>:cascade})
- -> 0.0032s
+ -> 0.0079s
-- add_index("cluster_projects", ["cluster_id"], {:name=>"index_cluster_projects_on_cluster_id", :using=>:btree})
- -> 0.0035s
+ -> 0.0045s
-- add_index("cluster_projects", ["project_id"], {:name=>"index_cluster_projects_on_project_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0044s
-- create_table("cluster_providers_gcp", {:force=>:cascade})
- -> 0.0051s
+ -> 0.0247s
-- add_index("cluster_providers_gcp", ["cluster_id"], {:name=>"index_cluster_providers_gcp_on_cluster_id", :unique=>true, :using=>:btree})
- -> 0.0034s
+ -> 0.0088s
-- create_table("clusters", {:force=>:cascade})
- -> 0.0052s
+ -> 0.0767s
-- add_index("clusters", ["enabled"], {:name=>"index_clusters_on_enabled", :using=>:btree})
- -> 0.0031s
+ -> 0.0162s
-- add_index("clusters", ["user_id"], {:name=>"index_clusters_on_user_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0216s
-- create_table("clusters_applications_helm", {:force=>:cascade})
- -> 0.0045s
+ -> 0.0379s
-- create_table("clusters_applications_ingress", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0409s
-- create_table("clusters_applications_prometheus", {:force=>:cascade})
- -> 0.0047s
+ -> 0.0178s
+-- create_table("clusters_applications_runners", {:force=>:cascade})
+ -> 0.0471s
+-- add_index("clusters_applications_runners", ["cluster_id"], {:name=>"index_clusters_applications_runners_on_cluster_id", :unique=>true, :using=>:btree})
+ -> 0.0487s
+-- add_index("clusters_applications_runners", ["runner_id"], {:name=>"index_clusters_applications_runners_on_runner_id", :using=>:btree})
+ -> 0.0094s
-- create_table("container_repositories", {:force=>:cascade})
- -> 0.0050s
+ -> 0.0142s
-- add_index("container_repositories", ["project_id", "name"], {:name=>"index_container_repositories_on_project_id_and_name", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0080s
-- add_index("container_repositories", ["project_id"], {:name=>"index_container_repositories_on_project_id", :using=>:btree})
- -> 0.0032s
+ -> 0.0070s
-- create_table("conversational_development_index_metrics", {:force=>:cascade})
- -> 0.0076s
+ -> 0.0204s
-- create_table("deploy_keys_projects", {:force=>:cascade})
- -> 0.0037s
+ -> 0.0154s
-- add_index("deploy_keys_projects", ["project_id"], {:name=>"index_deploy_keys_projects_on_project_id", :using=>:btree})
- -> 0.0032s
+ -> 0.0471s
-- create_table("deployments", {:force=>:cascade})
- -> 0.0049s
+ -> 0.0191s
-- add_index("deployments", ["created_at"], {:name=>"index_deployments_on_created_at", :using=>:btree})
- -> 0.0034s
+ -> 0.0552s
-- add_index("deployments", ["environment_id", "id"], {:name=>"index_deployments_on_environment_id_and_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0294s
-- add_index("deployments", ["environment_id", "iid", "project_id"], {:name=>"index_deployments_on_environment_id_and_iid_and_project_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0408s
-- add_index("deployments", ["project_id", "iid"], {:name=>"index_deployments_on_project_id_and_iid", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0094s
-- create_table("emails", {:force=>:cascade})
- -> 0.0046s
+ -> 0.0127s
-- add_index("emails", ["confirmation_token"], {:name=>"index_emails_on_confirmation_token", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0082s
-- add_index("emails", ["email"], {:name=>"index_emails_on_email", :unique=>true, :using=>:btree})
- -> 0.0035s
+ -> 0.0110s
-- add_index("emails", ["user_id"], {:name=>"index_emails_on_user_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0079s
-- create_table("environments", {:force=>:cascade})
- -> 0.0052s
+ -> 0.0106s
-- add_index("environments", ["project_id", "name"], {:name=>"index_environments_on_project_id_and_name", :unique=>true, :using=>:btree})
- -> 0.0031s
+ -> 0.0086s
-- add_index("environments", ["project_id", "slug"], {:name=>"index_environments_on_project_id_and_slug", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0076s
-- create_table("events", {:force=>:cascade})
- -> 0.0046s
+ -> 0.0122s
-- add_index("events", ["action"], {:name=>"index_events_on_action", :using=>:btree})
- -> 0.0032s
--- add_index("events", ["author_id"], {:name=>"index_events_on_author_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0068s
+-- add_index("events", ["author_id", "project_id"], {:name=>"index_events_on_author_id_and_project_id", :using=>:btree})
+ -> 0.0081s
-- add_index("events", ["project_id", "id"], {:name=>"index_events_on_project_id_and_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0064s
-- add_index("events", ["target_type", "target_id"], {:name=>"index_events_on_target_type_and_target_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0087s
-- create_table("feature_gates", {:force=>:cascade})
- -> 0.0046s
+ -> 0.0105s
-- add_index("feature_gates", ["feature_key", "key", "value"], {:name=>"index_feature_gates_on_feature_key_and_key_and_value", :unique=>true, :using=>:btree})
- -> 0.0031s
+ -> 0.0080s
-- create_table("features", {:force=>:cascade})
- -> 0.0041s
+ -> 0.0086s
-- add_index("features", ["key"], {:name=>"index_features_on_key", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0058s
-- create_table("fork_network_members", {:force=>:cascade})
- -> 0.0033s
+ -> 0.0081s
-- add_index("fork_network_members", ["fork_network_id"], {:name=>"index_fork_network_members_on_fork_network_id", :using=>:btree})
- -> 0.0033s
+ -> 0.0056s
-- add_index("fork_network_members", ["project_id"], {:name=>"index_fork_network_members_on_project_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0053s
-- create_table("fork_networks", {:force=>:cascade})
- -> 0.0049s
+ -> 0.0081s
-- add_index("fork_networks", ["root_project_id"], {:name=>"index_fork_networks_on_root_project_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0051s
-- create_table("forked_project_links", {:force=>:cascade})
- -> 0.0032s
+ -> 0.0070s
-- add_index("forked_project_links", ["forked_to_project_id"], {:name=>"index_forked_project_links_on_forked_to_project_id", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0061s
-- create_table("gcp_clusters", {:force=>:cascade})
- -> 0.0074s
+ -> 0.0090s
-- add_index("gcp_clusters", ["project_id"], {:name=>"index_gcp_clusters_on_project_id", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0073s
-- create_table("gpg_key_subkeys", {:force=>:cascade})
- -> 0.0042s
+ -> 0.0092s
-- add_index("gpg_key_subkeys", ["fingerprint"], {:name=>"index_gpg_key_subkeys_on_fingerprint", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0063s
-- add_index("gpg_key_subkeys", ["gpg_key_id"], {:name=>"index_gpg_key_subkeys_on_gpg_key_id", :using=>:btree})
- -> 0.0032s
+ -> 0.0603s
-- add_index("gpg_key_subkeys", ["keyid"], {:name=>"index_gpg_key_subkeys_on_keyid", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0705s
-- create_table("gpg_keys", {:force=>:cascade})
- -> 0.0042s
+ -> 0.0235s
-- add_index("gpg_keys", ["fingerprint"], {:name=>"index_gpg_keys_on_fingerprint", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0220s
-- add_index("gpg_keys", ["primary_keyid"], {:name=>"index_gpg_keys_on_primary_keyid", :unique=>true, :using=>:btree})
- -> 0.0026s
+ -> 0.0329s
-- add_index("gpg_keys", ["user_id"], {:name=>"index_gpg_keys_on_user_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0087s
-- create_table("gpg_signatures", {:force=>:cascade})
- -> 0.0054s
+ -> 0.0126s
-- add_index("gpg_signatures", ["commit_sha"], {:name=>"index_gpg_signatures_on_commit_sha", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0105s
-- add_index("gpg_signatures", ["gpg_key_id"], {:name=>"index_gpg_signatures_on_gpg_key_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0094s
-- add_index("gpg_signatures", ["gpg_key_primary_keyid"], {:name=>"index_gpg_signatures_on_gpg_key_primary_keyid", :using=>:btree})
- -> 0.0029s
+ -> 0.0100s
-- add_index("gpg_signatures", ["gpg_key_subkey_id"], {:name=>"index_gpg_signatures_on_gpg_key_subkey_id", :using=>:btree})
- -> 0.0032s
+ -> 0.0079s
-- add_index("gpg_signatures", ["project_id"], {:name=>"index_gpg_signatures_on_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0081s
-- create_table("group_custom_attributes", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0092s
-- add_index("group_custom_attributes", ["group_id", "key"], {:name=>"index_group_custom_attributes_on_group_id_and_key", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0086s
-- add_index("group_custom_attributes", ["key", "value"], {:name=>"index_group_custom_attributes_on_key_and_value", :using=>:btree})
- -> 0.0028s
+ -> 0.0071s
-- create_table("identities", {:force=>:cascade})
- -> 0.0043s
+ -> 0.0114s
-- add_index("identities", ["user_id"], {:name=>"index_identities_on_user_id", :using=>:btree})
- -> 0.0034s
+ -> 0.0064s
+-- create_table("internal_ids", {:id=>:bigserial, :force=>:cascade})
+ -> 0.0097s
+-- add_index("internal_ids", ["usage", "project_id"], {:name=>"index_internal_ids_on_usage_and_project_id", :unique=>true, :using=>:btree})
+ -> 0.0073s
-- create_table("issue_assignees", {:id=>false, :force=>:cascade})
- -> 0.0013s
+ -> 0.0127s
-- add_index("issue_assignees", ["issue_id", "user_id"], {:name=>"index_issue_assignees_on_issue_id_and_user_id", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0110s
-- add_index("issue_assignees", ["user_id"], {:name=>"index_issue_assignees_on_user_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0079s
-- create_table("issue_metrics", {:force=>:cascade})
- -> 0.0032s
+ -> 0.0098s
-- add_index("issue_metrics", ["issue_id"], {:name=>"index_issue_metrics", :using=>:btree})
- -> 0.0029s
+ -> 0.0053s
-- create_table("issues", {:force=>:cascade})
- -> 0.0051s
+ -> 0.0090s
-- add_index("issues", ["author_id"], {:name=>"index_issues_on_author_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0056s
-- add_index("issues", ["confidential"], {:name=>"index_issues_on_confidential", :using=>:btree})
- -> 0.0029s
+ -> 0.0055s
-- add_index("issues", ["description"], {:name=>"index_issues_on_description_trigram", :using=>:gin, :opclasses=>{"description"=>"gin_trgm_ops"}})
- -> 0.0022s
+ -> 0.0006s
-- add_index("issues", ["milestone_id"], {:name=>"index_issues_on_milestone_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0061s
-- add_index("issues", ["moved_to_id"], {:name=>"index_issues_on_moved_to_id", :where=>"(moved_to_id IS NOT NULL)", :using=>:btree})
- -> 0.0030s
+ -> 0.0051s
-- add_index("issues", ["project_id", "created_at", "id", "state"], {:name=>"index_issues_on_project_id_and_created_at_and_id_and_state", :using=>:btree})
- -> 0.0039s
+ -> 0.0069s
-- add_index("issues", ["project_id", "due_date", "id", "state"], {:name=>"idx_issues_on_project_id_and_due_date_and_id_and_state_partial", :where=>"(due_date IS NOT NULL)", :using=>:btree})
- -> 0.0031s
+ -> 0.0073s
-- add_index("issues", ["project_id", "iid"], {:name=>"index_issues_on_project_id_and_iid", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0060s
-- add_index("issues", ["project_id", "updated_at", "id", "state"], {:name=>"index_issues_on_project_id_and_updated_at_and_id_and_state", :using=>:btree})
- -> 0.0035s
+ -> 0.0094s
-- add_index("issues", ["relative_position"], {:name=>"index_issues_on_relative_position", :using=>:btree})
- -> 0.0030s
+ -> 0.0070s
-- add_index("issues", ["state"], {:name=>"index_issues_on_state", :using=>:btree})
- -> 0.0027s
+ -> 0.0078s
-- add_index("issues", ["title"], {:name=>"index_issues_on_title_trigram", :using=>:gin, :opclasses=>{"title"=>"gin_trgm_ops"}})
- -> 0.0021s
+ -> 0.0007s
-- add_index("issues", ["updated_at"], {:name=>"index_issues_on_updated_at", :using=>:btree})
- -> 0.0030s
+ -> 0.0068s
-- add_index("issues", ["updated_by_id"], {:name=>"index_issues_on_updated_by_id", :where=>"(updated_by_id IS NOT NULL)", :using=>:btree})
- -> 0.0028s
+ -> 0.0066s
-- create_table("keys", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0087s
-- add_index("keys", ["fingerprint"], {:name=>"index_keys_on_fingerprint", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0066s
-- add_index("keys", ["user_id"], {:name=>"index_keys_on_user_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0063s
-- create_table("label_links", {:force=>:cascade})
- -> 0.0041s
+ -> 0.0073s
-- add_index("label_links", ["label_id"], {:name=>"index_label_links_on_label_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0050s
-- add_index("label_links", ["target_id", "target_type"], {:name=>"index_label_links_on_target_id_and_target_type", :using=>:btree})
- -> 0.0028s
+ -> 0.0062s
-- create_table("label_priorities", {:force=>:cascade})
- -> 0.0031s
+ -> 0.0073s
-- add_index("label_priorities", ["priority"], {:name=>"index_label_priorities_on_priority", :using=>:btree})
- -> 0.0028s
+ -> 0.0058s
-- add_index("label_priorities", ["project_id", "label_id"], {:name=>"index_label_priorities_on_project_id_and_label_id", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0056s
-- create_table("labels", {:force=>:cascade})
- -> 0.0046s
+ -> 0.0087s
-- add_index("labels", ["group_id", "project_id", "title"], {:name=>"index_labels_on_group_id_and_project_id_and_title", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0074s
-- add_index("labels", ["project_id"], {:name=>"index_labels_on_project_id", :using=>:btree})
- -> 0.0032s
+ -> 0.0061s
-- add_index("labels", ["template"], {:name=>"index_labels_on_template", :where=>"template", :using=>:btree})
- -> 0.0027s
+ -> 0.0060s
-- add_index("labels", ["title"], {:name=>"index_labels_on_title", :using=>:btree})
- -> 0.0030s
+ -> 0.0076s
-- add_index("labels", ["type", "project_id"], {:name=>"index_labels_on_type_and_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0061s
+-- create_table("lfs_file_locks", {:force=>:cascade})
+ -> 0.0078s
+-- add_index("lfs_file_locks", ["project_id", "path"], {:name=>"index_lfs_file_locks_on_project_id_and_path", :unique=>true, :using=>:btree})
+ -> 0.0067s
+-- add_index("lfs_file_locks", ["user_id"], {:name=>"index_lfs_file_locks_on_user_id", :using=>:btree})
+ -> 0.0060s
-- create_table("lfs_objects", {:force=>:cascade})
- -> 0.0040s
+ -> 0.0109s
-- add_index("lfs_objects", ["oid"], {:name=>"index_lfs_objects_on_oid", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0059s
-- create_table("lfs_objects_projects", {:force=>:cascade})
- -> 0.0035s
+ -> 0.0091s
-- add_index("lfs_objects_projects", ["project_id"], {:name=>"index_lfs_objects_projects_on_project_id", :using=>:btree})
- -> 0.0025s
+ -> 0.0060s
-- create_table("lists", {:force=>:cascade})
- -> 0.0033s
+ -> 0.0115s
-- add_index("lists", ["board_id", "label_id"], {:name=>"index_lists_on_board_id_and_label_id", :unique=>true, :using=>:btree})
- -> 0.0026s
+ -> 0.0055s
-- add_index("lists", ["label_id"], {:name=>"index_lists_on_label_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0055s
-- create_table("members", {:force=>:cascade})
- -> 0.0046s
+ -> 0.0140s
-- add_index("members", ["access_level"], {:name=>"index_members_on_access_level", :using=>:btree})
- -> 0.0028s
+ -> 0.0067s
-- add_index("members", ["invite_token"], {:name=>"index_members_on_invite_token", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0069s
-- add_index("members", ["requested_at"], {:name=>"index_members_on_requested_at", :using=>:btree})
- -> 0.0025s
+ -> 0.0057s
-- add_index("members", ["source_id", "source_type"], {:name=>"index_members_on_source_id_and_source_type", :using=>:btree})
- -> 0.0027s
+ -> 0.0057s
-- add_index("members", ["user_id"], {:name=>"index_members_on_user_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0073s
-- create_table("merge_request_diff_commits", {:id=>false, :force=>:cascade})
- -> 0.0027s
+ -> 0.0087s
-- add_index("merge_request_diff_commits", ["merge_request_diff_id", "relative_order"], {:name=>"index_merge_request_diff_commits_on_mr_diff_id_and_order", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0151s
-- add_index("merge_request_diff_commits", ["sha"], {:name=>"index_merge_request_diff_commits_on_sha", :using=>:btree})
- -> 0.0029s
+ -> 0.0057s
-- create_table("merge_request_diff_files", {:id=>false, :force=>:cascade})
- -> 0.0027s
+ -> 0.0094s
-- add_index("merge_request_diff_files", ["merge_request_diff_id", "relative_order"], {:name=>"index_merge_request_diff_files_on_mr_diff_id_and_order", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0138s
-- create_table("merge_request_diffs", {:force=>:cascade})
- -> 0.0042s
+ -> 0.0077s
-- add_index("merge_request_diffs", ["merge_request_id", "id"], {:name=>"index_merge_request_diffs_on_merge_request_id_and_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0060s
-- create_table("merge_request_metrics", {:force=>:cascade})
- -> 0.0034s
+ -> 0.0098s
-- add_index("merge_request_metrics", ["first_deployed_to_production_at"], {:name=>"index_merge_request_metrics_on_first_deployed_to_production_at", :using=>:btree})
- -> 0.0028s
+ -> 0.0060s
-- add_index("merge_request_metrics", ["merge_request_id"], {:name=>"index_merge_request_metrics", :using=>:btree})
- -> 0.0025s
+ -> 0.0050s
-- add_index("merge_request_metrics", ["pipeline_id"], {:name=>"index_merge_request_metrics_on_pipeline_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0045s
-- create_table("merge_requests", {:force=>:cascade})
-> 0.0066s
-- add_index("merge_requests", ["assignee_id"], {:name=>"index_merge_requests_on_assignee_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0072s
-- add_index("merge_requests", ["author_id"], {:name=>"index_merge_requests_on_author_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0050s
-- add_index("merge_requests", ["created_at"], {:name=>"index_merge_requests_on_created_at", :using=>:btree})
- -> 0.0026s
+ -> 0.0053s
-- add_index("merge_requests", ["description"], {:name=>"index_merge_requests_on_description_trigram", :using=>:gin, :opclasses=>{"description"=>"gin_trgm_ops"}})
- -> 0.0020s
+ -> 0.0008s
-- add_index("merge_requests", ["head_pipeline_id"], {:name=>"index_merge_requests_on_head_pipeline_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0053s
-- add_index("merge_requests", ["latest_merge_request_diff_id"], {:name=>"index_merge_requests_on_latest_merge_request_diff_id", :using=>:btree})
- -> 0.0025s
+ -> 0.0048s
-- add_index("merge_requests", ["merge_user_id"], {:name=>"index_merge_requests_on_merge_user_id", :where=>"(merge_user_id IS NOT NULL)", :using=>:btree})
- -> 0.0029s
+ -> 0.0051s
-- add_index("merge_requests", ["milestone_id"], {:name=>"index_merge_requests_on_milestone_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0055s
-- add_index("merge_requests", ["source_branch"], {:name=>"index_merge_requests_on_source_branch", :using=>:btree})
- -> 0.0026s
+ -> 0.0055s
-- add_index("merge_requests", ["source_project_id", "source_branch"], {:name=>"index_merge_requests_on_source_project_and_branch_state_opened", :where=>"((state)::text = 'opened'::text)", :using=>:btree})
- -> 0.0029s
+ -> 0.0061s
-- add_index("merge_requests", ["source_project_id", "source_branch"], {:name=>"index_merge_requests_on_source_project_id_and_source_branch", :using=>:btree})
- -> 0.0031s
+ -> 0.0068s
-- add_index("merge_requests", ["target_branch"], {:name=>"index_merge_requests_on_target_branch", :using=>:btree})
- -> 0.0028s
+ -> 0.0054s
-- add_index("merge_requests", ["target_project_id", "iid"], {:name=>"index_merge_requests_on_target_project_id_and_iid", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0061s
-- add_index("merge_requests", ["target_project_id", "merge_commit_sha", "id"], {:name=>"index_merge_requests_on_tp_id_and_merge_commit_sha_and_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0077s
-- add_index("merge_requests", ["title"], {:name=>"index_merge_requests_on_title", :using=>:btree})
- -> 0.0026s
+ -> 0.0105s
-- add_index("merge_requests", ["title"], {:name=>"index_merge_requests_on_title_trigram", :using=>:gin, :opclasses=>{"title"=>"gin_trgm_ops"}})
- -> 0.0020s
+ -> 0.0008s
-- add_index("merge_requests", ["updated_by_id"], {:name=>"index_merge_requests_on_updated_by_id", :where=>"(updated_by_id IS NOT NULL)", :using=>:btree})
- -> 0.0029s
+ -> 0.0074s
-- create_table("merge_requests_closing_issues", {:force=>:cascade})
- -> 0.0031s
+ -> 0.0125s
-- add_index("merge_requests_closing_issues", ["issue_id"], {:name=>"index_merge_requests_closing_issues_on_issue_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0064s
-- add_index("merge_requests_closing_issues", ["merge_request_id"], {:name=>"index_merge_requests_closing_issues_on_merge_request_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0061s
-- create_table("milestones", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0064s
-- add_index("milestones", ["description"], {:name=>"index_milestones_on_description_trigram", :using=>:gin, :opclasses=>{"description"=>"gin_trgm_ops"}})
- -> 0.0022s
+ -> 0.0007s
-- add_index("milestones", ["due_date"], {:name=>"index_milestones_on_due_date", :using=>:btree})
- -> 0.0033s
+ -> 0.0053s
-- add_index("milestones", ["group_id"], {:name=>"index_milestones_on_group_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0068s
-- add_index("milestones", ["project_id", "iid"], {:name=>"index_milestones_on_project_id_and_iid", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0057s
-- add_index("milestones", ["title"], {:name=>"index_milestones_on_title", :using=>:btree})
- -> 0.0026s
+ -> 0.0051s
-- add_index("milestones", ["title"], {:name=>"index_milestones_on_title_trigram", :using=>:gin, :opclasses=>{"title"=>"gin_trgm_ops"}})
- -> 0.0021s
+ -> 0.0006s
-- create_table("namespaces", {:force=>:cascade})
- -> 0.0068s
+ -> 0.0083s
-- add_index("namespaces", ["created_at"], {:name=>"index_namespaces_on_created_at", :using=>:btree})
- -> 0.0030s
+ -> 0.0061s
-- add_index("namespaces", ["name", "parent_id"], {:name=>"index_namespaces_on_name_and_parent_id", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0062s
-- add_index("namespaces", ["name"], {:name=>"index_namespaces_on_name_trigram", :using=>:gin, :opclasses=>{"name"=>"gin_trgm_ops"}})
- -> 0.0020s
+ -> 0.0006s
-- add_index("namespaces", ["owner_id"], {:name=>"index_namespaces_on_owner_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0061s
-- add_index("namespaces", ["parent_id", "id"], {:name=>"index_namespaces_on_parent_id_and_id", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0072s
-- add_index("namespaces", ["path"], {:name=>"index_namespaces_on_path", :using=>:btree})
- -> 0.0031s
+ -> 0.0056s
-- add_index("namespaces", ["path"], {:name=>"index_namespaces_on_path_trigram", :using=>:gin, :opclasses=>{"path"=>"gin_trgm_ops"}})
- -> 0.0019s
+ -> 0.0006s
-- add_index("namespaces", ["require_two_factor_authentication"], {:name=>"index_namespaces_on_require_two_factor_authentication", :using=>:btree})
- -> 0.0029s
+ -> 0.0061s
-- add_index("namespaces", ["type"], {:name=>"index_namespaces_on_type", :using=>:btree})
- -> 0.0032s
--- create_table("notes", {:force=>:cascade})
-> 0.0055s
+-- create_table("notes", {:force=>:cascade})
+ -> 0.0092s
-- add_index("notes", ["author_id"], {:name=>"index_notes_on_author_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0072s
-- add_index("notes", ["commit_id"], {:name=>"index_notes_on_commit_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0057s
-- add_index("notes", ["created_at"], {:name=>"index_notes_on_created_at", :using=>:btree})
- -> 0.0029s
+ -> 0.0065s
-- add_index("notes", ["discussion_id"], {:name=>"index_notes_on_discussion_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0064s
-- add_index("notes", ["line_code"], {:name=>"index_notes_on_line_code", :using=>:btree})
- -> 0.0029s
+ -> 0.0078s
-- add_index("notes", ["note"], {:name=>"index_notes_on_note_trigram", :using=>:gin, :opclasses=>{"note"=>"gin_trgm_ops"}})
- -> 0.0024s
+ -> 0.0006s
-- add_index("notes", ["noteable_id", "noteable_type"], {:name=>"index_notes_on_noteable_id_and_noteable_type", :using=>:btree})
- -> 0.0029s
+ -> 0.0102s
-- add_index("notes", ["noteable_type"], {:name=>"index_notes_on_noteable_type", :using=>:btree})
- -> 0.0030s
+ -> 0.0092s
-- add_index("notes", ["project_id", "noteable_type"], {:name=>"index_notes_on_project_id_and_noteable_type", :using=>:btree})
- -> 0.0027s
+ -> 0.0082s
-- add_index("notes", ["updated_at"], {:name=>"index_notes_on_updated_at", :using=>:btree})
- -> 0.0026s
+ -> 0.0062s
-- create_table("notification_settings", {:force=>:cascade})
- -> 0.0053s
+ -> 0.0088s
-- add_index("notification_settings", ["source_id", "source_type"], {:name=>"index_notification_settings_on_source_id_and_source_type", :using=>:btree})
- -> 0.0028s
+ -> 0.0405s
-- add_index("notification_settings", ["user_id", "source_id", "source_type"], {:name=>"index_notifications_on_user_id_and_source_id_and_source_type", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0677s
-- add_index("notification_settings", ["user_id"], {:name=>"index_notification_settings_on_user_id", :using=>:btree})
- -> 0.0031s
+ -> 0.1199s
-- create_table("oauth_access_grants", {:force=>:cascade})
- -> 0.0042s
+ -> 0.0140s
-- add_index("oauth_access_grants", ["token"], {:name=>"index_oauth_access_grants_on_token", :unique=>true, :using=>:btree})
- -> 0.0031s
+ -> 0.0076s
-- create_table("oauth_access_tokens", {:force=>:cascade})
- -> 0.0051s
+ -> 0.0167s
-- add_index("oauth_access_tokens", ["refresh_token"], {:name=>"index_oauth_access_tokens_on_refresh_token", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0098s
-- add_index("oauth_access_tokens", ["resource_owner_id"], {:name=>"index_oauth_access_tokens_on_resource_owner_id", :using=>:btree})
- -> 0.0025s
+ -> 0.0074s
-- add_index("oauth_access_tokens", ["token"], {:name=>"index_oauth_access_tokens_on_token", :unique=>true, :using=>:btree})
- -> 0.0026s
+ -> 0.0078s
-- create_table("oauth_applications", {:force=>:cascade})
- -> 0.0049s
+ -> 0.0112s
-- add_index("oauth_applications", ["owner_id", "owner_type"], {:name=>"index_oauth_applications_on_owner_id_and_owner_type", :using=>:btree})
- -> 0.0030s
+ -> 0.0079s
-- add_index("oauth_applications", ["uid"], {:name=>"index_oauth_applications_on_uid", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0114s
-- create_table("oauth_openid_requests", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0102s
-- create_table("pages_domains", {:force=>:cascade})
- -> 0.0052s
+ -> 0.0102s
-- add_index("pages_domains", ["domain"], {:name=>"index_pages_domains_on_domain", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0067s
+-- add_index("pages_domains", ["project_id", "enabled_until"], {:name=>"index_pages_domains_on_project_id_and_enabled_until", :using=>:btree})
+ -> 0.0114s
-- add_index("pages_domains", ["project_id"], {:name=>"index_pages_domains_on_project_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0066s
+-- add_index("pages_domains", ["verified_at", "enabled_until"], {:name=>"index_pages_domains_on_verified_at_and_enabled_until", :using=>:btree})
+ -> 0.0073s
+-- add_index("pages_domains", ["verified_at"], {:name=>"index_pages_domains_on_verified_at", :using=>:btree})
+ -> 0.0063s
-- create_table("personal_access_tokens", {:force=>:cascade})
- -> 0.0056s
+ -> 0.0084s
-- add_index("personal_access_tokens", ["token"], {:name=>"index_personal_access_tokens_on_token", :unique=>true, :using=>:btree})
- -> 0.0032s
+ -> 0.0075s
-- add_index("personal_access_tokens", ["user_id"], {:name=>"index_personal_access_tokens_on_user_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0066s
-- create_table("project_authorizations", {:id=>false, :force=>:cascade})
- -> 0.0018s
+ -> 0.0087s
-- add_index("project_authorizations", ["project_id"], {:name=>"index_project_authorizations_on_project_id", :using=>:btree})
- -> 0.0033s
+ -> 0.0056s
-- add_index("project_authorizations", ["user_id", "project_id", "access_level"], {:name=>"index_project_authorizations_on_user_id_project_id_access_level", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0075s
-- create_table("project_auto_devops", {:force=>:cascade})
- -> 0.0043s
+ -> 0.0079s
-- add_index("project_auto_devops", ["project_id"], {:name=>"index_project_auto_devops_on_project_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0067s
-- create_table("project_custom_attributes", {:force=>:cascade})
- -> 0.0047s
+ -> 0.0071s
-- add_index("project_custom_attributes", ["key", "value"], {:name=>"index_project_custom_attributes_on_key_and_value", :using=>:btree})
- -> 0.0030s
+ -> 0.0060s
-- add_index("project_custom_attributes", ["project_id", "key"], {:name=>"index_project_custom_attributes_on_project_id_and_key", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0069s
-- create_table("project_features", {:force=>:cascade})
- -> 0.0038s
+ -> 0.0100s
-- add_index("project_features", ["project_id"], {:name=>"index_project_features_on_project_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0069s
-- create_table("project_group_links", {:force=>:cascade})
- -> 0.0036s
+ -> 0.0117s
-- add_index("project_group_links", ["group_id"], {:name=>"index_project_group_links_on_group_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0121s
-- add_index("project_group_links", ["project_id"], {:name=>"index_project_group_links_on_project_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0076s
-- create_table("project_import_data", {:force=>:cascade})
- -> 0.0049s
+ -> 0.0084s
-- add_index("project_import_data", ["project_id"], {:name=>"index_project_import_data_on_project_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0058s
-- create_table("project_statistics", {:force=>:cascade})
- -> 0.0046s
+ -> 0.0075s
-- add_index("project_statistics", ["namespace_id"], {:name=>"index_project_statistics_on_namespace_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0054s
-- add_index("project_statistics", ["project_id"], {:name=>"index_project_statistics_on_project_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0054s
-- create_table("projects", {:force=>:cascade})
- -> 0.0090s
+ -> 0.0077s
-- add_index("projects", ["ci_id"], {:name=>"index_projects_on_ci_id", :using=>:btree})
- -> 0.0033s
+ -> 0.0070s
-- add_index("projects", ["created_at"], {:name=>"index_projects_on_created_at", :using=>:btree})
- -> 0.0030s
+ -> 0.0060s
-- add_index("projects", ["creator_id"], {:name=>"index_projects_on_creator_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0071s
-- add_index("projects", ["description"], {:name=>"index_projects_on_description_trigram", :using=>:gin, :opclasses=>{"description"=>"gin_trgm_ops"}})
- -> 0.0022s
+ -> 0.0009s
+-- add_index("projects", ["id"], {:name=>"index_projects_on_id_partial_for_visibility", :unique=>true, :where=>"(visibility_level = ANY (ARRAY[10, 20]))", :using=>:btree})
+ -> 0.0062s
-- add_index("projects", ["last_activity_at"], {:name=>"index_projects_on_last_activity_at", :using=>:btree})
- -> 0.0032s
+ -> 0.0060s
-- add_index("projects", ["last_repository_check_failed"], {:name=>"index_projects_on_last_repository_check_failed", :using=>:btree})
- -> 0.0030s
+ -> 0.0063s
-- add_index("projects", ["last_repository_updated_at"], {:name=>"index_projects_on_last_repository_updated_at", :using=>:btree})
- -> 0.0031s
+ -> 0.0633s
-- add_index("projects", ["name"], {:name=>"index_projects_on_name_trigram", :using=>:gin, :opclasses=>{"name"=>"gin_trgm_ops"}})
- -> 0.0022s
+ -> 0.0012s
-- add_index("projects", ["namespace_id"], {:name=>"index_projects_on_namespace_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0167s
-- add_index("projects", ["path"], {:name=>"index_projects_on_path", :using=>:btree})
- -> 0.0028s
+ -> 0.0222s
-- add_index("projects", ["path"], {:name=>"index_projects_on_path_trigram", :using=>:gin, :opclasses=>{"path"=>"gin_trgm_ops"}})
- -> 0.0023s
+ -> 0.0010s
-- add_index("projects", ["pending_delete"], {:name=>"index_projects_on_pending_delete", :using=>:btree})
- -> 0.0029s
+ -> 0.0229s
-- add_index("projects", ["repository_storage"], {:name=>"index_projects_on_repository_storage", :using=>:btree})
- -> 0.0026s
+ -> 0.0173s
-- add_index("projects", ["runners_token"], {:name=>"index_projects_on_runners_token", :using=>:btree})
- -> 0.0034s
+ -> 0.0167s
-- add_index("projects", ["star_count"], {:name=>"index_projects_on_star_count", :using=>:btree})
- -> 0.0028s
+ -> 0.0491s
-- add_index("projects", ["visibility_level"], {:name=>"index_projects_on_visibility_level", :using=>:btree})
- -> 0.0027s
+ -> 0.0598s
-- create_table("protected_branch_merge_access_levels", {:force=>:cascade})
- -> 0.0042s
+ -> 0.1964s
-- add_index("protected_branch_merge_access_levels", ["protected_branch_id"], {:name=>"index_protected_branch_merge_access", :using=>:btree})
- -> 0.0029s
+ -> 0.1112s
-- create_table("protected_branch_push_access_levels", {:force=>:cascade})
- -> 0.0037s
+ -> 0.0195s
-- add_index("protected_branch_push_access_levels", ["protected_branch_id"], {:name=>"index_protected_branch_push_access", :using=>:btree})
- -> 0.0030s
+ -> 0.0069s
-- create_table("protected_branches", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0113s
-- add_index("protected_branches", ["project_id"], {:name=>"index_protected_branches_on_project_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0071s
-- create_table("protected_tag_create_access_levels", {:force=>:cascade})
- -> 0.0037s
+ -> 0.0180s
-- add_index("protected_tag_create_access_levels", ["protected_tag_id"], {:name=>"index_protected_tag_create_access", :using=>:btree})
- -> 0.0029s
+ -> 0.0068s
-- add_index("protected_tag_create_access_levels", ["user_id"], {:name=>"index_protected_tag_create_access_levels_on_user_id", :using=>:btree})
- -> 0.0029s
+ -> 0.0077s
-- create_table("protected_tags", {:force=>:cascade})
- -> 0.0051s
+ -> 0.0115s
-- add_index("protected_tags", ["project_id"], {:name=>"index_protected_tags_on_project_id", :using=>:btree})
- -> 0.0034s
+ -> 0.0081s
-- create_table("push_event_payloads", {:id=>false, :force=>:cascade})
- -> 0.0030s
+ -> 0.0108s
-- add_index("push_event_payloads", ["event_id"], {:name=>"index_push_event_payloads_on_event_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0189s
-- create_table("redirect_routes", {:force=>:cascade})
- -> 0.0049s
+ -> 0.0106s
-- add_index("redirect_routes", ["path"], {:name=>"index_redirect_routes_on_path", :unique=>true, :using=>:btree})
- -> 0.0031s
+ -> 0.0075s
-- add_index("redirect_routes", ["source_type", "source_id"], {:name=>"index_redirect_routes_on_source_type_and_source_id", :using=>:btree})
- -> 0.0034s
+ -> 0.0099s
-- create_table("releases", {:force=>:cascade})
- -> 0.0043s
+ -> 0.0126s
-- add_index("releases", ["project_id", "tag"], {:name=>"index_releases_on_project_id_and_tag", :using=>:btree})
- -> 0.0032s
+ -> 0.0066s
-- add_index("releases", ["project_id"], {:name=>"index_releases_on_project_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0060s
-- create_table("routes", {:force=>:cascade})
- -> 0.0055s
+ -> 0.0091s
-- add_index("routes", ["path"], {:name=>"index_routes_on_path", :unique=>true, :using=>:btree})
- -> 0.0028s
+ -> 0.0073s
-- add_index("routes", ["path"], {:name=>"index_routes_on_path_text_pattern_ops", :using=>:btree, :opclasses=>{"path"=>"varchar_pattern_ops"}})
- -> 0.0026s
+ -> 0.0004s
-- add_index("routes", ["source_type", "source_id"], {:name=>"index_routes_on_source_type_and_source_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0111s
-- create_table("sent_notifications", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0093s
-- add_index("sent_notifications", ["reply_key"], {:name=>"index_sent_notifications_on_reply_key", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0060s
-- create_table("services", {:force=>:cascade})
- -> 0.0091s
+ -> 0.0099s
-- add_index("services", ["project_id"], {:name=>"index_services_on_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0068s
-- add_index("services", ["template"], {:name=>"index_services_on_template", :using=>:btree})
- -> 0.0031s
+ -> 0.0076s
-- create_table("snippets", {:force=>:cascade})
- -> 0.0050s
+ -> 0.0073s
-- add_index("snippets", ["author_id"], {:name=>"index_snippets_on_author_id", :using=>:btree})
- -> 0.0030s
+ -> 0.0055s
-- add_index("snippets", ["file_name"], {:name=>"index_snippets_on_file_name_trigram", :using=>:gin, :opclasses=>{"file_name"=>"gin_trgm_ops"}})
- -> 0.0020s
+ -> 0.0006s
-- add_index("snippets", ["project_id"], {:name=>"index_snippets_on_project_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0058s
-- add_index("snippets", ["title"], {:name=>"index_snippets_on_title_trigram", :using=>:gin, :opclasses=>{"title"=>"gin_trgm_ops"}})
- -> 0.0020s
+ -> 0.0005s
-- add_index("snippets", ["updated_at"], {:name=>"index_snippets_on_updated_at", :using=>:btree})
- -> 0.0026s
+ -> 0.0100s
-- add_index("snippets", ["visibility_level"], {:name=>"index_snippets_on_visibility_level", :using=>:btree})
- -> 0.0026s
+ -> 0.0091s
-- create_table("spam_logs", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0129s
-- create_table("subscriptions", {:force=>:cascade})
- -> 0.0041s
+ -> 0.0094s
-- add_index("subscriptions", ["subscribable_id", "subscribable_type", "user_id", "project_id"], {:name=>"index_subscriptions_on_subscribable_and_user_id_and_project_id", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0107s
-- create_table("system_note_metadata", {:force=>:cascade})
- -> 0.0040s
+ -> 0.0138s
-- add_index("system_note_metadata", ["note_id"], {:name=>"index_system_note_metadata_on_note_id", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0060s
-- create_table("taggings", {:force=>:cascade})
- -> 0.0047s
+ -> 0.0121s
-- add_index("taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], {:name=>"taggings_idx", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0078s
+-- add_index("taggings", ["tag_id"], {:name=>"index_taggings_on_tag_id", :using=>:btree})
+ -> 0.0058s
-- add_index("taggings", ["taggable_id", "taggable_type", "context"], {:name=>"index_taggings_on_taggable_id_and_taggable_type_and_context", :using=>:btree})
- -> 0.0025s
+ -> 0.0059s
+-- add_index("taggings", ["taggable_id", "taggable_type"], {:name=>"index_taggings_on_taggable_id_and_taggable_type", :using=>:btree})
+ -> 0.0056s
-- create_table("tags", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0063s
-- add_index("tags", ["name"], {:name=>"index_tags_on_name", :unique=>true, :using=>:btree})
- -> 0.0026s
+ -> 0.0055s
-- create_table("timelogs", {:force=>:cascade})
- -> 0.0033s
+ -> 0.0061s
-- add_index("timelogs", ["issue_id"], {:name=>"index_timelogs_on_issue_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0063s
-- add_index("timelogs", ["merge_request_id"], {:name=>"index_timelogs_on_merge_request_id", :using=>:btree})
- -> 0.0033s
+ -> 0.0052s
-- add_index("timelogs", ["user_id"], {:name=>"index_timelogs_on_user_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0055s
-- create_table("todos", {:force=>:cascade})
- -> 0.0043s
+ -> 0.0065s
-- add_index("todos", ["author_id"], {:name=>"index_todos_on_author_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0081s
-- add_index("todos", ["commit_id"], {:name=>"index_todos_on_commit_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0085s
-- add_index("todos", ["note_id"], {:name=>"index_todos_on_note_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0083s
-- add_index("todos", ["project_id"], {:name=>"index_todos_on_project_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0094s
-- add_index("todos", ["target_type", "target_id"], {:name=>"index_todos_on_target_type_and_target_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0070s
+-- add_index("todos", ["user_id", "id"], {:name=>"index_todos_on_user_id_and_id_done", :where=>"((state)::text = 'done'::text)", :using=>:btree})
+ -> 0.0099s
+-- add_index("todos", ["user_id", "id"], {:name=>"index_todos_on_user_id_and_id_pending", :where=>"((state)::text = 'pending'::text)", :using=>:btree})
+ -> 0.0080s
-- add_index("todos", ["user_id"], {:name=>"index_todos_on_user_id", :using=>:btree})
- -> 0.0026s
+ -> 0.0061s
-- create_table("trending_projects", {:force=>:cascade})
- -> 0.0030s
--- add_index("trending_projects", ["project_id"], {:name=>"index_trending_projects_on_project_id", :using=>:btree})
- -> 0.0027s
+ -> 0.0081s
+-- add_index("trending_projects", ["project_id"], {:name=>"index_trending_projects_on_project_id", :unique=>true, :using=>:btree})
+ -> 0.0046s
-- create_table("u2f_registrations", {:force=>:cascade})
- -> 0.0048s
+ -> 0.0063s
-- add_index("u2f_registrations", ["key_handle"], {:name=>"index_u2f_registrations_on_key_handle", :using=>:btree})
- -> 0.0029s
+ -> 0.0052s
-- add_index("u2f_registrations", ["user_id"], {:name=>"index_u2f_registrations_on_user_id", :using=>:btree})
- -> 0.0028s
+ -> 0.0072s
-- create_table("uploads", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0067s
-- add_index("uploads", ["checksum"], {:name=>"index_uploads_on_checksum", :using=>:btree})
- -> 0.0028s
+ -> 0.0046s
-- add_index("uploads", ["model_id", "model_type"], {:name=>"index_uploads_on_model_id_and_model_type", :using=>:btree})
- -> 0.0027s
--- add_index("uploads", ["path"], {:name=>"index_uploads_on_path", :using=>:btree})
- -> 0.0028s
+ -> 0.0049s
+-- add_index("uploads", ["uploader", "path"], {:name=>"index_uploads_on_uploader_and_path", :using=>:btree})
+ -> 0.0052s
-- create_table("user_agent_details", {:force=>:cascade})
- -> 0.0051s
+ -> 0.0059s
-- add_index("user_agent_details", ["subject_id", "subject_type"], {:name=>"index_user_agent_details_on_subject_id_and_subject_type", :using=>:btree})
- -> 0.0028s
+ -> 0.0052s
+-- create_table("user_callouts", {:force=>:cascade})
+ -> 0.0059s
+-- add_index("user_callouts", ["user_id", "feature_name"], {:name=>"index_user_callouts_on_user_id_and_feature_name", :unique=>true, :using=>:btree})
+ -> 0.0094s
+-- add_index("user_callouts", ["user_id"], {:name=>"index_user_callouts_on_user_id", :using=>:btree})
+ -> 0.0064s
-- create_table("user_custom_attributes", {:force=>:cascade})
- -> 0.0044s
+ -> 0.0086s
-- add_index("user_custom_attributes", ["key", "value"], {:name=>"index_user_custom_attributes_on_key_and_value", :using=>:btree})
- -> 0.0027s
+ -> 0.0080s
-- add_index("user_custom_attributes", ["user_id", "key"], {:name=>"index_user_custom_attributes_on_user_id_and_key", :unique=>true, :using=>:btree})
- -> 0.0026s
--- create_table("user_synced_attributes_metadata", {:force=>:cascade})
+ -> 0.0066s
+-- create_table("user_interacted_projects", {:id=>false, :force=>:cascade})
+ -> 0.0108s
+-- add_index("user_interacted_projects", ["project_id", "user_id"], {:name=>"index_user_interacted_projects_on_project_id_and_user_id", :unique=>true, :using=>:btree})
+ -> 0.0114s
+-- add_index("user_interacted_projects", ["user_id"], {:name=>"index_user_interacted_projects_on_user_id", :using=>:btree})
-> 0.0056s
+-- create_table("user_synced_attributes_metadata", {:force=>:cascade})
+ -> 0.0115s
-- add_index("user_synced_attributes_metadata", ["user_id"], {:name=>"index_user_synced_attributes_metadata_on_user_id", :unique=>true, :using=>:btree})
- -> 0.0027s
+ -> 0.0054s
-- create_table("users", {:force=>:cascade})
- -> 0.0134s
+ -> 0.0111s
-- add_index("users", ["admin"], {:name=>"index_users_on_admin", :using=>:btree})
- -> 0.0030s
+ -> 0.0065s
-- add_index("users", ["confirmation_token"], {:name=>"index_users_on_confirmation_token", :unique=>true, :using=>:btree})
- -> 0.0029s
+ -> 0.0065s
-- add_index("users", ["created_at"], {:name=>"index_users_on_created_at", :using=>:btree})
- -> 0.0034s
+ -> 0.0068s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true, :using=>:btree})
- -> 0.0030s
+ -> 0.0066s
-- add_index("users", ["email"], {:name=>"index_users_on_email_trigram", :using=>:gin, :opclasses=>{"email"=>"gin_trgm_ops"}})
- -> 0.0431s
+ -> 0.0011s
-- add_index("users", ["ghost"], {:name=>"index_users_on_ghost", :using=>:btree})
- -> 0.0051s
+ -> 0.0063s
-- add_index("users", ["incoming_email_token"], {:name=>"index_users_on_incoming_email_token", :using=>:btree})
- -> 0.0044s
+ -> 0.0057s
-- add_index("users", ["name"], {:name=>"index_users_on_name", :using=>:btree})
- -> 0.0044s
+ -> 0.0056s
-- add_index("users", ["name"], {:name=>"index_users_on_name_trigram", :using=>:gin, :opclasses=>{"name"=>"gin_trgm_ops"}})
- -> 0.0034s
+ -> 0.0011s
-- add_index("users", ["reset_password_token"], {:name=>"index_users_on_reset_password_token", :unique=>true, :using=>:btree})
- -> 0.0044s
+ -> 0.0055s
-- add_index("users", ["rss_token"], {:name=>"index_users_on_rss_token", :using=>:btree})
- -> 0.0046s
+ -> 0.0068s
-- add_index("users", ["state"], {:name=>"index_users_on_state", :using=>:btree})
- -> 0.0040s
+ -> 0.0067s
-- add_index("users", ["username"], {:name=>"index_users_on_username", :using=>:btree})
- -> 0.0046s
+ -> 0.0072s
-- add_index("users", ["username"], {:name=>"index_users_on_username_trigram", :using=>:gin, :opclasses=>{"username"=>"gin_trgm_ops"}})
- -> 0.0044s
+ -> 0.0012s
-- create_table("users_star_projects", {:force=>:cascade})
- -> 0.0055s
+ -> 0.0100s
-- add_index("users_star_projects", ["project_id"], {:name=>"index_users_star_projects_on_project_id", :using=>:btree})
- -> 0.0037s
+ -> 0.0061s
-- add_index("users_star_projects", ["user_id", "project_id"], {:name=>"index_users_star_projects_on_user_id_and_project_id", :unique=>true, :using=>:btree})
- -> 0.0044s
+ -> 0.0068s
-- create_table("web_hook_logs", {:force=>:cascade})
- -> 0.0060s
+ -> 0.0097s
-- add_index("web_hook_logs", ["web_hook_id"], {:name=>"index_web_hook_logs_on_web_hook_id", :using=>:btree})
- -> 0.0034s
+ -> 0.0057s
-- create_table("web_hooks", {:force=>:cascade})
- -> 0.0120s
+ -> 0.0080s
-- add_index("web_hooks", ["project_id"], {:name=>"index_web_hooks_on_project_id", :using=>:btree})
- -> 0.0038s
+ -> 0.0062s
-- add_index("web_hooks", ["type"], {:name=>"index_web_hooks_on_type", :using=>:btree})
- -> 0.0036s
+ -> 0.0065s
+-- add_foreign_key("badges", "namespaces", {:column=>"group_id", :on_delete=>:cascade})
+ -> 0.0158s
+-- add_foreign_key("badges", "projects", {:on_delete=>:cascade})
+ -> 0.0140s
+-- add_foreign_key("boards", "namespaces", {:column=>"group_id", :on_delete=>:cascade})
+ -> 0.0138s
-- add_foreign_key("boards", "projects", {:name=>"fk_f15266b5f9", :on_delete=>:cascade})
- -> 0.0030s
+ -> 0.0118s
-- add_foreign_key("chat_teams", "namespaces", {:on_delete=>:cascade})
- -> 0.0021s
+ -> 0.0130s
-- add_foreign_key("ci_build_trace_section_names", "projects", {:on_delete=>:cascade})
- -> 0.0022s
+ -> 0.0131s
-- add_foreign_key("ci_build_trace_sections", "ci_build_trace_section_names", {:column=>"section_name_id", :name=>"fk_264e112c66", :on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0210s
-- add_foreign_key("ci_build_trace_sections", "ci_builds", {:column=>"build_id", :name=>"fk_4ebe41f502", :on_delete=>:cascade})
- -> 0.0024s
+ -> 0.0823s
-- add_foreign_key("ci_build_trace_sections", "projects", {:on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0942s
-- add_foreign_key("ci_builds", "ci_pipelines", {:column=>"auto_canceled_by_id", :name=>"fk_a2141b1522", :on_delete=>:nullify})
- -> 0.0023s
+ -> 0.1346s
-- add_foreign_key("ci_builds", "ci_stages", {:column=>"stage_id", :name=>"fk_3a9eaa254d", :on_delete=>:cascade})
- -> 0.0020s
+ -> 0.0506s
-- add_foreign_key("ci_builds", "projects", {:name=>"fk_befce0568a", :on_delete=>:cascade})
- -> 0.0024s
+ -> 0.0403s
+-- add_foreign_key("ci_builds_metadata", "ci_builds", {:column=>"build_id", :on_delete=>:cascade})
+ -> 0.0160s
+-- add_foreign_key("ci_builds_metadata", "projects", {:on_delete=>:cascade})
+ -> 0.0165s
-- add_foreign_key("ci_group_variables", "namespaces", {:column=>"group_id", :name=>"fk_33ae4d58d8", :on_delete=>:cascade})
- -> 0.0024s
+ -> 0.0153s
-- add_foreign_key("ci_job_artifacts", "ci_builds", {:column=>"job_id", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0160s
-- add_foreign_key("ci_job_artifacts", "projects", {:on_delete=>:cascade})
- -> 0.0020s
+ -> 0.0278s
-- add_foreign_key("ci_pipeline_schedule_variables", "ci_pipeline_schedules", {:column=>"pipeline_schedule_id", :name=>"fk_41c35fda51", :on_delete=>:cascade})
- -> 0.0027s
+ -> 0.0193s
-- add_foreign_key("ci_pipeline_schedules", "projects", {:name=>"fk_8ead60fcc4", :on_delete=>:cascade})
- -> 0.0022s
+ -> 0.0184s
-- add_foreign_key("ci_pipeline_schedules", "users", {:column=>"owner_id", :name=>"fk_9ea99f58d2", :on_delete=>:nullify})
- -> 0.0025s
+ -> 0.0158s
-- add_foreign_key("ci_pipeline_variables", "ci_pipelines", {:column=>"pipeline_id", :name=>"fk_f29c5f4380", :on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0097s
-- add_foreign_key("ci_pipelines", "ci_pipeline_schedules", {:column=>"pipeline_schedule_id", :name=>"fk_3d34ab2e06", :on_delete=>:nullify})
- -> 0.0019s
+ -> 0.0693s
-- add_foreign_key("ci_pipelines", "ci_pipelines", {:column=>"auto_canceled_by_id", :name=>"fk_262d4c2d19", :on_delete=>:nullify})
- -> 0.0029s
+ -> 0.1599s
-- add_foreign_key("ci_pipelines", "projects", {:name=>"fk_86635dbd80", :on_delete=>:cascade})
- -> 0.0023s
+ -> 0.1505s
-- add_foreign_key("ci_runner_projects", "projects", {:name=>"fk_4478a6f1e4", :on_delete=>:cascade})
- -> 0.0036s
+ -> 0.0984s
-- add_foreign_key("ci_stages", "ci_pipelines", {:column=>"pipeline_id", :name=>"fk_fb57e6cc56", :on_delete=>:cascade})
- -> 0.0017s
+ -> 0.1152s
-- add_foreign_key("ci_stages", "projects", {:name=>"fk_2360681d1d", :on_delete=>:cascade})
- -> 0.0020s
+ -> 0.1062s
-- add_foreign_key("ci_trigger_requests", "ci_triggers", {:column=>"trigger_id", :name=>"fk_b8ec8b7245", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0455s
-- add_foreign_key("ci_triggers", "projects", {:name=>"fk_e3e63f966e", :on_delete=>:cascade})
- -> 0.0021s
+ -> 0.0725s
-- add_foreign_key("ci_triggers", "users", {:column=>"owner_id", :name=>"fk_e8e10d1964", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0774s
-- add_foreign_key("ci_variables", "projects", {:name=>"fk_ada5eb64b3", :on_delete=>:cascade})
- -> 0.0021s
+ -> 0.0626s
-- add_foreign_key("cluster_platforms_kubernetes", "clusters", {:on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0529s
-- add_foreign_key("cluster_projects", "clusters", {:on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0678s
-- add_foreign_key("cluster_projects", "projects", {:on_delete=>:cascade})
- -> 0.0020s
+ -> 0.0391s
-- add_foreign_key("cluster_providers_gcp", "clusters", {:on_delete=>:cascade})
- -> 0.0017s
+ -> 0.0328s
-- add_foreign_key("clusters", "users", {:on_delete=>:nullify})
- -> 0.0018s
+ -> 0.1266s
-- add_foreign_key("clusters_applications_helm", "clusters", {:on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0489s
+-- add_foreign_key("clusters_applications_ingress", "clusters", {:name=>"fk_753a7b41c1", :on_delete=>:cascade})
+ -> 0.0565s
+-- add_foreign_key("clusters_applications_prometheus", "clusters", {:name=>"fk_557e773639", :on_delete=>:cascade})
+ -> 0.0174s
+-- add_foreign_key("clusters_applications_runners", "ci_runners", {:column=>"runner_id", :name=>"fk_02de2ded36", :on_delete=>:nullify})
+ -> 0.0182s
+-- add_foreign_key("clusters_applications_runners", "clusters", {:on_delete=>:cascade})
+ -> 0.0208s
-- add_foreign_key("container_repositories", "projects")
- -> 0.0020s
+ -> 0.0186s
-- add_foreign_key("deploy_keys_projects", "projects", {:name=>"fk_58a901ca7e", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0140s
-- add_foreign_key("deployments", "projects", {:name=>"fk_b9a3851b82", :on_delete=>:cascade})
- -> 0.0021s
+ -> 0.0328s
-- add_foreign_key("environments", "projects", {:name=>"fk_d1c8c1da6a", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0221s
-- add_foreign_key("events", "projects", {:on_delete=>:cascade})
- -> 0.0020s
+ -> 0.0212s
-- add_foreign_key("events", "users", {:column=>"author_id", :name=>"fk_edfd187b6f", :on_delete=>:cascade})
- -> 0.0020s
+ -> 0.0150s
-- add_foreign_key("fork_network_members", "fork_networks", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0134s
-- add_foreign_key("fork_network_members", "projects", {:column=>"forked_from_project_id", :name=>"fk_b01280dae4", :on_delete=>:nullify})
- -> 0.0019s
+ -> 0.0200s
-- add_foreign_key("fork_network_members", "projects", {:on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0162s
-- add_foreign_key("fork_networks", "projects", {:column=>"root_project_id", :name=>"fk_e7b436b2b5", :on_delete=>:nullify})
- -> 0.0018s
+ -> 0.0138s
-- add_foreign_key("forked_project_links", "projects", {:column=>"forked_to_project_id", :name=>"fk_434510edb0", :on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0137s
-- add_foreign_key("gcp_clusters", "projects", {:on_delete=>:cascade})
- -> 0.0029s
+ -> 0.0148s
-- add_foreign_key("gcp_clusters", "services", {:on_delete=>:nullify})
- -> 0.0022s
+ -> 0.0216s
-- add_foreign_key("gcp_clusters", "users", {:on_delete=>:nullify})
- -> 0.0019s
+ -> 0.0156s
-- add_foreign_key("gpg_key_subkeys", "gpg_keys", {:on_delete=>:cascade})
- -> 0.0017s
+ -> 0.0139s
-- add_foreign_key("gpg_keys", "users", {:on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0142s
-- add_foreign_key("gpg_signatures", "gpg_key_subkeys", {:on_delete=>:nullify})
- -> 0.0016s
+ -> 0.0216s
-- add_foreign_key("gpg_signatures", "gpg_keys", {:on_delete=>:nullify})
- -> 0.0016s
+ -> 0.0211s
-- add_foreign_key("gpg_signatures", "projects", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0215s
-- add_foreign_key("group_custom_attributes", "namespaces", {:column=>"group_id", :on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0174s
+-- add_foreign_key("internal_ids", "projects", {:on_delete=>:cascade})
+ -> 0.0143s
-- add_foreign_key("issue_assignees", "issues", {:name=>"fk_b7d881734a", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0139s
-- add_foreign_key("issue_assignees", "users", {:name=>"fk_5e0c8d9154", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0138s
-- add_foreign_key("issue_metrics", "issues", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0106s
-- add_foreign_key("issues", "issues", {:column=>"moved_to_id", :name=>"fk_a194299be1", :on_delete=>:nullify})
- -> 0.0014s
+ -> 0.0366s
-- add_foreign_key("issues", "milestones", {:name=>"fk_96b1dd429c", :on_delete=>:nullify})
- -> 0.0016s
+ -> 0.0309s
-- add_foreign_key("issues", "projects", {:name=>"fk_899c8f3231", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0314s
-- add_foreign_key("issues", "users", {:column=>"author_id", :name=>"fk_05f1e72feb", :on_delete=>:nullify})
- -> 0.0015s
+ -> 0.0504s
+-- add_foreign_key("issues", "users", {:column=>"closed_by_id", :name=>"fk_c63cbf6c25", :on_delete=>:nullify})
+ -> 0.0428s
-- add_foreign_key("issues", "users", {:column=>"updated_by_id", :name=>"fk_ffed080f01", :on_delete=>:nullify})
- -> 0.0017s
+ -> 0.0333s
-- add_foreign_key("label_priorities", "labels", {:on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0143s
-- add_foreign_key("label_priorities", "projects", {:on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0160s
-- add_foreign_key("labels", "namespaces", {:column=>"group_id", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0176s
-- add_foreign_key("labels", "projects", {:name=>"fk_7de4989a69", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0216s
+-- add_foreign_key("lfs_file_locks", "projects", {:on_delete=>:cascade})
+ -> 0.0144s
+-- add_foreign_key("lfs_file_locks", "users", {:on_delete=>:cascade})
+ -> 0.0178s
-- add_foreign_key("lists", "boards", {:name=>"fk_0d3f677137", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0161s
-- add_foreign_key("lists", "labels", {:name=>"fk_7a5553d60f", :on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0137s
-- add_foreign_key("members", "users", {:name=>"fk_2e88fb7ce9", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0171s
-- add_foreign_key("merge_request_diff_commits", "merge_request_diffs", {:on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0143s
-- add_foreign_key("merge_request_diff_files", "merge_request_diffs", {:on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0106s
-- add_foreign_key("merge_request_diffs", "merge_requests", {:name=>"fk_8483f3258f", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0119s
-- add_foreign_key("merge_request_metrics", "ci_pipelines", {:column=>"pipeline_id", :on_delete=>:cascade})
- -> 0.0017s
+ -> 0.0163s
-- add_foreign_key("merge_request_metrics", "merge_requests", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0204s
-- add_foreign_key("merge_request_metrics", "users", {:column=>"latest_closed_by_id", :name=>"fk_ae440388cc", :on_delete=>:nullify})
- -> 0.0015s
+ -> 0.0196s
-- add_foreign_key("merge_request_metrics", "users", {:column=>"merged_by_id", :name=>"fk_7f28d925f3", :on_delete=>:nullify})
- -> 0.0015s
+ -> 0.0202s
-- add_foreign_key("merge_requests", "ci_pipelines", {:column=>"head_pipeline_id", :name=>"fk_fd82eae0b9", :on_delete=>:nullify})
- -> 0.0014s
+ -> 0.0394s
-- add_foreign_key("merge_requests", "merge_request_diffs", {:column=>"latest_merge_request_diff_id", :name=>"fk_06067f5644", :on_delete=>:nullify})
- -> 0.0014s
+ -> 0.0532s
-- add_foreign_key("merge_requests", "milestones", {:name=>"fk_6a5165a692", :on_delete=>:nullify})
- -> 0.0015s
+ -> 0.0291s
-- add_foreign_key("merge_requests", "projects", {:column=>"source_project_id", :name=>"fk_3308fe130c", :on_delete=>:nullify})
- -> 0.0017s
+ -> 0.0278s
-- add_foreign_key("merge_requests", "projects", {:column=>"target_project_id", :name=>"fk_a6963e8447", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0367s
-- add_foreign_key("merge_requests", "users", {:column=>"assignee_id", :name=>"fk_6149611a04", :on_delete=>:nullify})
- -> 0.0016s
+ -> 0.0327s
-- add_foreign_key("merge_requests", "users", {:column=>"author_id", :name=>"fk_e719a85f8a", :on_delete=>:nullify})
- -> 0.0017s
+ -> 0.0337s
-- add_foreign_key("merge_requests", "users", {:column=>"merge_user_id", :name=>"fk_ad525e1f87", :on_delete=>:nullify})
- -> 0.0018s
+ -> 0.0517s
-- add_foreign_key("merge_requests", "users", {:column=>"updated_by_id", :name=>"fk_641731faff", :on_delete=>:nullify})
- -> 0.0017s
+ -> 0.0335s
-- add_foreign_key("merge_requests_closing_issues", "issues", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0167s
-- add_foreign_key("merge_requests_closing_issues", "merge_requests", {:on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0191s
-- add_foreign_key("milestones", "namespaces", {:column=>"group_id", :name=>"fk_95650a40d4", :on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0206s
-- add_foreign_key("milestones", "projects", {:name=>"fk_9bd0a0c791", :on_delete=>:cascade})
- -> 0.0017s
+ -> 0.0221s
-- add_foreign_key("notes", "projects", {:name=>"fk_99e097b079", :on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0332s
-- add_foreign_key("oauth_openid_requests", "oauth_access_grants", {:column=>"access_grant_id", :name=>"fk_oauth_openid_requests_oauth_access_grants_access_grant_id"})
- -> 0.0014s
+ -> 0.0128s
-- add_foreign_key("pages_domains", "projects", {:name=>"fk_ea2f6dfc6f", :on_delete=>:cascade})
- -> 0.0021s
+ -> 0.0220s
-- add_foreign_key("personal_access_tokens", "users")
- -> 0.0016s
+ -> 0.0187s
-- add_foreign_key("project_authorizations", "projects", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0149s
-- add_foreign_key("project_authorizations", "users", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0167s
-- add_foreign_key("project_auto_devops", "projects", {:on_delete=>:cascade})
- -> 0.0026s
+ -> 0.0142s
-- add_foreign_key("project_custom_attributes", "projects", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0218s
-- add_foreign_key("project_features", "projects", {:name=>"fk_18513d9b92", :on_delete=>:cascade})
- -> 0.0020s
+ -> 0.0204s
-- add_foreign_key("project_group_links", "projects", {:name=>"fk_daa8cee94c", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0174s
-- add_foreign_key("project_import_data", "projects", {:name=>"fk_ffb9ee3a10", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0138s
-- add_foreign_key("project_statistics", "projects", {:on_delete=>:cascade})
- -> 0.0021s
+ -> 0.0125s
-- add_foreign_key("protected_branch_merge_access_levels", "protected_branches", {:name=>"fk_8a3072ccb3", :on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0157s
-- add_foreign_key("protected_branch_push_access_levels", "protected_branches", {:name=>"fk_9ffc86a3d9", :on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0112s
-- add_foreign_key("protected_branches", "projects", {:name=>"fk_7a9c6d93e7", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0122s
-- add_foreign_key("protected_tag_create_access_levels", "namespaces", {:column=>"group_id"})
- -> 0.0016s
+ -> 0.0131s
-- add_foreign_key("protected_tag_create_access_levels", "protected_tags", {:name=>"fk_f7dfda8c51", :on_delete=>:cascade})
- -> 0.0013s
+ -> 0.0168s
-- add_foreign_key("protected_tag_create_access_levels", "users")
- -> 0.0018s
+ -> 0.0221s
-- add_foreign_key("protected_tags", "projects", {:name=>"fk_8e4af87648", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0135s
-- add_foreign_key("push_event_payloads", "events", {:name=>"fk_36c74129da", :on_delete=>:cascade})
- -> 0.0013s
+ -> 0.0107s
-- add_foreign_key("releases", "projects", {:name=>"fk_47fe2a0596", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0131s
-- add_foreign_key("services", "projects", {:name=>"fk_71cce407f9", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0142s
-- add_foreign_key("snippets", "projects", {:name=>"fk_be41fd4bb7", :on_delete=>:cascade})
- -> 0.0017s
+ -> 0.0178s
-- add_foreign_key("subscriptions", "projects", {:on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0160s
-- add_foreign_key("system_note_metadata", "notes", {:name=>"fk_d83a918cb1", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0156s
-- add_foreign_key("timelogs", "issues", {:name=>"fk_timelogs_issues_issue_id", :on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0183s
-- add_foreign_key("timelogs", "merge_requests", {:name=>"fk_timelogs_merge_requests_merge_request_id", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0198s
+-- add_foreign_key("todos", "notes", {:name=>"fk_91d1f47b13", :on_delete=>:cascade})
+ -> 0.0276s
-- add_foreign_key("todos", "projects", {:name=>"fk_45054f9c45", :on_delete=>:cascade})
- -> 0.0018s
+ -> 0.0175s
+-- add_foreign_key("todos", "users", {:column=>"author_id", :name=>"fk_ccf0373936", :on_delete=>:cascade})
+ -> 0.0182s
+-- add_foreign_key("todos", "users", {:name=>"fk_d94154aa95", :on_delete=>:cascade})
+ -> 0.0184s
-- add_foreign_key("trending_projects", "projects", {:on_delete=>:cascade})
- -> 0.0015s
+ -> 0.0338s
-- add_foreign_key("u2f_registrations", "users")
- -> 0.0017s
+ -> 0.0176s
+-- add_foreign_key("user_callouts", "users", {:on_delete=>:cascade})
+ -> 0.0160s
-- add_foreign_key("user_custom_attributes", "users", {:on_delete=>:cascade})
- -> 0.0019s
+ -> 0.0191s
+-- add_foreign_key("user_interacted_projects", "projects", {:name=>"fk_722ceba4f7", :on_delete=>:cascade})
+ -> 0.0171s
+-- add_foreign_key("user_interacted_projects", "users", {:name=>"fk_0894651f08", :on_delete=>:cascade})
+ -> 0.0155s
-- add_foreign_key("user_synced_attributes_metadata", "users", {:on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0164s
-- add_foreign_key("users_star_projects", "projects", {:name=>"fk_22cd27ddfc", :on_delete=>:cascade})
- -> 0.0016s
+ -> 0.0180s
-- add_foreign_key("web_hook_logs", "web_hooks", {:on_delete=>:cascade})
- -> 0.0014s
+ -> 0.0164s
-- add_foreign_key("web_hooks", "projects", {:name=>"fk_0c8ca6d9d1", :on_delete=>:cascade})
- -> 0.0017s
+ -> 0.0172s
-- initialize_schema_migrations_table()
- -> 0.0112s
+ -> 0.0212s
+Adding limits to schema.rb for mysql
+-- column_exists?(:merge_request_diffs, :st_commits)
+ -> 0.0010s
+-- column_exists?(:merge_request_diffs, :st_diffs)
+ -> 0.0006s
+-- change_column(:snippets, :content, :text, {:limit=>2147483647})
+ -> 0.0308s
+-- change_column(:notes, :st_diff, :text, {:limit=>2147483647})
+ -> 0.0366s
+-- change_column(:snippets, :content_html, :text, {:limit=>2147483647})
+ -> 0.0272s
+-- change_column(:merge_request_diff_files, :diff, :text, {:limit=>2147483647})
+ -> 0.0170s
+$ date
+Thu Apr 5 11:19:41 UTC 2018
$ JOB_NAME=( $CI_JOB_NAME )
$ export CI_NODE_INDEX=${JOB_NAME[-2]}
$ export CI_NODE_TOTAL=${JOB_NAME[-1]}
$ export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
$ export KNAPSACK_GENERATE_REPORT=true
+$ export SUITE_FLAKY_RSPEC_REPORT_PATH=${FLAKY_RSPEC_SUITE_REPORT_PATH}
+$ export FLAKY_RSPEC_REPORT_PATH=rspec_flaky/all_${JOB_NAME[0]}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
+$ export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/new_${JOB_NAME[0]}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
+$ export FLAKY_RSPEC_GENERATE_REPORT=true
$ export CACHE_CLASSES=true
-$ cp ${KNAPSACK_SPINACH_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
+$ cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
+$ [[ -f $FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${FLAKY_RSPEC_REPORT_PATH}
+$ [[ -f $NEW_FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${NEW_FLAKY_RSPEC_REPORT_PATH}
$ scripts/gitaly-test-spawn
-Gem.path: ["/root/.gem/ruby/2.3.0", "/usr/local/lib/ruby/gems/2.3.0", "/usr/local/bundle"]
-ENV['BUNDLE_GEMFILE']: nil
-ENV['RUBYOPT']: nil
-bundle config in /builds/gitlab-org/gitlab-ce
-scripts/gitaly-test-spawn:10:in `<main>': undefined local variable or method `gitaly_dir' for main:Object (NameError)
-Did you mean? gitaly_dir
-Settings are listed in order of priority. The top value will be used.
-retry
-Set for your local app (/usr/local/bundle/config): 3
+59
+$ knapsack rspec "--color --format documentation"
+
+Report specs:
+spec/services/todo_service_spec.rb
+spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb
+spec/controllers/projects/merge_requests_controller_spec.rb
+spec/controllers/groups_controller_spec.rb
+spec/features/projects/import_export/import_file_spec.rb
+spec/lib/gitlab/middleware/go_spec.rb
+spec/services/groups/transfer_service_spec.rb
+spec/features/projects/blobs/edit_spec.rb
+spec/services/boards/lists/move_service_spec.rb
+spec/services/create_deployment_service_spec.rb
+spec/controllers/groups/milestones_controller_spec.rb
+spec/helpers/groups_helper_spec.rb
+spec/requests/api/v3/todos_spec.rb
+spec/models/project_services/teamcity_service_spec.rb
+spec/lib/gitlab/conflict/file_spec.rb
+spec/lib/banzai/filter/snippet_reference_filter_spec.rb
+spec/finders/autocomplete_users_finder_spec.rb
+spec/models/service_spec.rb
+spec/services/test_hooks/project_service_spec.rb
+spec/features/projects/merge_requests/user_views_open_merge_request_spec.rb
+spec/finders/runner_jobs_finder_spec.rb
+spec/features/projects/snippets_spec.rb
+spec/requests/api/v3/environments_spec.rb
+spec/requests/api/namespaces_spec.rb
+spec/services/merge_requests/get_urls_service_spec.rb
+spec/models/lfs_file_lock_spec.rb
+spec/lib/gitlab/ci/config/entry/boolean_spec.rb
+
+Leftover specs:
+
+Knapsack report generator started!
+
+==> Setting up GitLab Shell...
+ GitLab Shell setup in 0.307428917 seconds...
+
+==> Setting up Gitaly...
+ Gitaly setup in 0.000135767 seconds...
+
+TodoService
+ updates cached counts when a todo is created
+ Issues
+ #new_issue
+ creates a todo if assigned
+ does not create a todo if unassigned
+ creates a todo if assignee is the current user
+ creates a todo for each valid mentioned user
+ creates a directly addressed todo for each valid addressed user
+ creates correct todos for each valid user based on the type of mention
+ does not create todo if user can not see the issue when issue is confidential
+ does not create directly addressed todo if user cannot see the issue when issue is confidential
+ when a private group is mentioned
+ creates a todo for group members
+ #update_issue
+ creates a todo for each valid mentioned user not included in skip_users
+ creates a todo for each valid user not included in skip_users based on the type of mention
+ creates a directly addressed todo for each valid addressed user not included in skip_users
+ does not create a todo if user was already mentioned and todo is pending
+ does not create a todo if user was already mentioned and todo is done
+ does not create a directly addressed todo if user was already mentioned or addressed and todo is pending
+ does not create a directly addressed todo if user was already mentioned or addressed and todo is done
+ does not create todo if user can not see the issue when issue is confidential
+ does not create a directly addressed todo if user can not see the issue when issue is confidential
+ issues with a task list
+ does not create todo when tasks are marked as completed
+ does not create directly addressed todo when tasks are marked as completed
+ does not raise an error when description not change
+ #close_issue
+ marks related pending todos to the target for the user as done
+ #destroy_target
+ refreshes the todos count cache for users with todos on the target
+ does not refresh the todos count cache for users with only done todos on the target
+ yields the target to the caller
+ #reassigned_issue
+ creates a pending todo for new assignee
+ does not create a todo if unassigned
+ creates a todo if new assignee is the current user
+ #mark_pending_todos_as_done
+ marks related pending todos to the target for the user as done
+ cached counts
+ updates when todos change
+ #mark_todos_as_done
+ behaves like updating todos state
+ updates related todos for the user with the new_state
+ returns the updated ids
+ cached counts
+ updates when todos change
+ #mark_todos_as_done_by_ids
+ behaves like updating todos state
+ updates related todos for the user with the new_state
+ returns the updated ids
+ cached counts
+ updates when todos change
+ #mark_todos_as_pending
+ behaves like updating todos state
+ updates related todos for the user with the new_state
+ returns the updated ids
+ cached counts
+ updates when todos change
+ #mark_todos_as_pending_by_ids
+ behaves like updating todos state
+ updates related todos for the user with the new_state
+ returns the updated ids
+ cached counts
+ updates when todos change
+ #new_note
+ mark related pending todos to the noteable for the note author as done
+ does not mark related pending todos it is a system note
+ creates a todo for each valid mentioned user
+ creates a todo for each valid user based on the type of mention
+ creates a directly addressed todo for each valid addressed user
+ does not create todo if user can not see the issue when leaving a note on a confidential issue
+ does not create a directly addressed todo if user can not see the issue when leaving a note on a confidential issue
+ does not create todo when leaving a note on snippet
+ on commit
+ creates a todo for each valid mentioned user when leaving a note on commit
+ creates a directly addressed todo for each valid mentioned user when leaving a note on commit
+ #mark_todo
+ creates a todo from a issue
+ #todo_exists?
+ returns false when no todo exist for the given issuable
+ returns true when a todo exist for the given issuable
+ Merge Requests
+ #new_merge_request
+ creates a pending todo if assigned
+ does not create a todo if unassigned
+ does not create a todo if assignee is the current user
+ creates a todo for each valid mentioned user
+ creates a todo for each valid user based on the type of mention
+ creates a directly addressed todo for each valid addressed user
+ #update_merge_request
+ creates a todo for each valid mentioned user not included in skip_users
+ creates a todo for each valid user not included in skip_users based on the type of mention
+ creates a directly addressed todo for each valid addressed user not included in skip_users
+ does not create a todo if user was already mentioned and todo is pending
+ does not create a todo if user was already mentioned and todo is done
+ does not create a directly addressed todo if user was already mentioned or addressed and todo is pending
+ does not create a directly addressed todo if user was already mentioned or addressed and todo is done
+ with a task list
+ does not create todo when tasks are marked as completed
+ does not create directly addressed todo when tasks are marked as completed
+ does not raise an error when description not change
+ #close_merge_request
+ marks related pending todos to the target for the user as done
+ #reassigned_merge_request
+ creates a pending todo for new assignee
+ does not create a todo if unassigned
+ creates a todo if new assignee is the current user
+ does not create a todo for guests
+ does not create a directly addressed todo for guests
+ #merge_merge_request
+ marks related pending todos to the target for the user as done
+ does not create todo for guests
+ does not create directly addressed todo for guests
+ #new_award_emoji
+ marks related pending todos to the target for the user as done
+ #merge_request_build_failed
+ creates a pending todo for the merge request author
+ creates a pending todo for merge_user
+ #merge_request_push
+ marks related pending todos to the target for the user as done
+ #merge_request_became_unmergeable
+ creates a pending todo for a merge_user
+ #mark_todo
+ creates a todo from a merge request
+ #new_note
+ creates a todo for mentioned user on new diff note
+ creates a directly addressed todo for addressed user on new diff note
+ creates a todo for mentioned user on legacy diff note
+ does not create todo for guests
+ #update_note
+ creates a todo for each valid mentioned user not included in skip_users
+ creates a todo for each valid user not included in skip_users based on the type of mention
+ creates a directly addressed todo for each valid addressed user not included in skip_users
+ does not create a todo if user was already mentioned and todo is pending
+ does not create a todo if user was already mentioned and todo is done
+ does not create a directly addressed todo if user was already mentioned or addressed and todo is pending
+ does not create a directly addressed todo if user was already mentioned or addressed and todo is done
+ #mark_todos_as_done
+ marks a relation of todos as done
+ marks an array of todos as done
+ returns the ids of updated todos
+ when some of the todos are done already
+ returns the ids of those still pending
+ returns an empty array if all are done
+ #mark_todos_as_done_by_ids
+ marks an array of todo ids as done
+ marks a single todo id as done
+ caches the number of todos of a user
+
+Gitlab::ImportExport::ProjectTreeSaver
+ saves the project tree into a json object
+ saves project successfully
+ JSON
+ saves the correct json
+ has milestones
+ has merge requests
+ has merge request's milestones
+ has merge request's source branch SHA
+ has merge request's target branch SHA
+ has events
+ has snippets
+ has snippet notes
+ has releases
+ has issues
+ has issue comments
+ has issue assignees
+ has author on issue comments
+ has project members
+ has merge requests diffs
+ has merge request diff files
+ has merge request diff commits
+ has merge requests comments
+ has author on merge requests comments
+ has pipeline stages
+ has pipeline statuses
+ has pipeline builds
+ has no when YML attributes but only the DB column
+ has pipeline commits
+ has ci pipeline notes
+ has labels with no associations
+ has labels associated to records
+ has project and group labels
+ has priorities associated to labels
+ saves the correct service type
+ saves the properties for a service
+ has project feature
+ has custom attributes
+ has badges
+ does not complain about non UTF-8 characters in MR diff files
+ with description override
+ overrides the project description
+ group members
+ does not export group members if it has no permission
+ does not export group members as master
+ exports group members as group owner
+ as admin
+ exports group members as admin
+ exports group members as project members
+ project attributes
+ contains the html description
+ does not contain the runners token
+
+Gitlab::BackgroundMigration::DeserializeMergeRequestDiffsAndCommits
+ #perform
+ when the diff IDs passed do not exist
+ does not raise
+ when the merge request diff has no serialised commits or diffs
+ does not raise
+ processing multiple merge request diffs
+ when BUFFER_ROWS is exceeded
+ inserts commit rows in chunks of BUFFER_ROWS
+ inserts diff rows in chunks of DIFF_FILE_BUFFER_ROWS
+ when BUFFER_ROWS is not exceeded
+ only updates once
+ when some rows were already inserted due to a previous failure
+ does not raise
+ logs a message
+ ends up with the correct rows
+ when the merge request diff update fails
+ raises an error
+ logs the error
+ still adds diff commits
+ still adds diff files
+ when the merge request diff has valid commits and diffs
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diff has diffs but no commits
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diffs do not have too_large set
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diffs do not have a_mode and b_mode set
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diffs have binary content
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diff has commits, but no diffs
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diffs have invalid content
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diffs are Rugged::Patch instances
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+ when the merge request diffs are Rugged::Diff::Delta instances
+ creates correct entries in the merge_request_diff_commits table
+ creates correct entries in the merge_request_diff_files table
+ sets the st_commits and st_diffs columns to nil
+
+Projects::MergeRequestsController
+ GET commit_change_content
+ renders commit_change_content template
+ GET show
+ behaves like loads labels
+ loads labels into the @labels variable
+ as html
+ renders merge request page
+ loads notes
+ with special_role FIRST_TIME_CONTRIBUTOR
+ as json
+ with basic serializer param
+ renders basic MR entity as json
+ with widget serializer param
+ renders widget MR entity as json
+ when no serialiser was passed
+ renders widget MR entity as json
+ as diff
+ triggers workhorse to serve the request
+ as patch
+ triggers workhorse to serve the request
+ GET index
+ behaves like issuables list meta-data
+ creates indexed meta-data object for issuable notes and votes count
+ when given empty collection
+ doesn't execute any queries with false conditions
+ when page param
+ redirects to last_page if page number is larger than number of pages
+ redirects to specified page
+ does not redirect to external sites when provided a host field
+ when filtering by opened state
+ with opened merge requests
+ lists those merge requests
+ with reopened merge requests
+ lists those merge requests
+ PUT update
+ changing the assignee
+ limits the attributes exposed on the assignee
+ when user does not have access to update issue
+ responds with 404
+ there is no source project
+ closes MR without errors
+ allows editing of a closed merge request
+ does not allow to update target branch closed merge request
+ behaves like update invalid issuable
+ when updating causes conflicts
+ renders edit when format is html
+ renders json error message when format is json
+ when updating an invalid issuable
+ renders edit when merge request is invalid
+ POST merge
+ when user cannot access
+ returns 404
+ when the merge request is not mergeable
+ returns :failed
+ when the sha parameter does not match the source SHA
+ returns :sha_mismatch
+ when the sha parameter matches the source SHA
+ returns :success
+ starts the merge immediately
+ when the pipeline succeeds is passed
+ returns :merge_when_pipeline_succeeds
+ sets the MR to merge when the pipeline succeeds
+ when project.only_allow_merge_if_pipeline_succeeds? is true
+ returns :merge_when_pipeline_succeeds
+ and head pipeline is not the current one
+ returns :failed
+ only_allow_merge_if_all_discussions_are_resolved? setting
+ when enabled
+ with unresolved discussion
+ returns :failed
+ with all discussions resolved
+ returns :success
+ when disabled
+ with unresolved discussion
+ returns :success
+ with all discussions resolved
+ returns :success
+ DELETE destroy
+ denies access to users unless they're admin or project owner
+ when the user is owner
+ deletes the merge request
+ delegates the update of the todos count cache to TodoService
+ GET commits
+ renders the commits template to a string
+ GET pipelines
+ responds with serialized pipelines
+ POST remove_wip
+ removes the wip status
+ renders MergeRequest as JSON
+ POST cancel_merge_when_pipeline_succeeds
+ calls MergeRequests::MergeWhenPipelineSucceedsService
+ should respond with numeric status code success
+ renders MergeRequest as JSON
+ POST assign_related_issues
+ shows a flash message on success
+ correctly pluralizes flash message on success
+ calls MergeRequests::AssignIssuesService
+ is skipped when not signed in
+ GET ci_environments_status
+ the environment is from a forked project
+ links to the environment on that project
+ GET pipeline_status.json
+ when head_pipeline exists
+ return a detailed head_pipeline status in json
+ when head_pipeline does not exist
+ return empty
+ POST #rebase
+ successfully
+ enqeues a RebaseWorker
+ with a forked project
+ user cannot push to source branch
+ returns 404
+ user can push to source branch
+ returns 200
+
+GroupsController
+ GET #show
+ as html
+ assigns whether or not a group has children
+ as atom
+ assigns events for all the projects in the group
+ GET #new
+ when creating subgroups
+ and can_create_group is true
+ and logged in as Admin
+ behaves like member with ability to create subgroups
+ renders the new page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Owner
+ behaves like member with ability to create subgroups
+ renders the new page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Guest
+ behaves like member without ability to create subgroups
+ renders the 404 page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Developer
+ behaves like member without ability to create subgroups
+ renders the 404 page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Master
+ behaves like member without ability to create subgroups
+ renders the 404 page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and can_create_group is false
+ and logged in as Admin
+ behaves like member with ability to create subgroups
+ renders the new page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Owner
+ behaves like member with ability to create subgroups
+ renders the new page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Guest
+ behaves like member without ability to create subgroups
+ renders the 404 page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Developer
+ behaves like member without ability to create subgroups
+ renders the 404 page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Master
+ behaves like member without ability to create subgroups
+ renders the 404 page (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ GET #activity
+ as json
+ includes all projects in event feed
+ POST #create
+ when creating subgroups
+ and can_create_group is true
+ and logged in as Owner
+ creates the subgroup (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Developer
+ renders the new template (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and can_create_group is false
+ and logged in as Owner
+ creates the subgroup (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ and logged in as Developer
+ renders the new template (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ when creating a top level group
+ and can_create_group is enabled
+ creates the Group
+ and can_create_group is disabled
+ does not create the Group
+ GET #index
+ as a user
+ redirects to Groups Dashboard
+ as a guest
+ redirects to Explore Groups
+ GET #issues
+ sorting by votes
+ sorts most popular issues
+ sorts least popular issues
+ GET #merge_requests
+ sorting by votes
+ sorts most popular merge requests
+ sorts least popular merge requests
+ DELETE #destroy
+ as another user
+ returns 404
+ as the group owner
+ schedules a group destroy
+ redirects to the root path
+ PUT update
+ updates the path successfully
+ does not update the path on error
+ #ensure_canonical_path
+ for a GET request
+ when requesting groups at the root path
+ when requesting the canonical path with different casing
+ redirects to the correct casing
+ when requesting a redirected path
+ redirects to the canonical path
+ when the old group path is a substring of the scheme or host
+ does not modify the requested host
+ when the old group path is substring of groups
+ does not modify the /groups part of the path
+ when requesting groups under the /groups path
+ when requesting the canonical path
+ non-show path
+ with exactly matching casing
+ does not redirect
+ with different casing
+ redirects to the correct casing
+ show path
+ with exactly matching casing
+ does not redirect
+ with different casing
+ redirects to the correct casing at the root path
+ when requesting a redirected path
+ redirects to the canonical path
+ when the old group path is a substring of the scheme or host
+ does not modify the requested host
+ when the old group path is substring of groups
+ does not modify the /groups part of the path
+ when the old group path is substring of groups plus the new path
+ does not modify the /groups part of the path
+ for a POST request
+ when requesting the canonical path with different casing
+ does not 404
+ does not redirect to the correct casing
+ when requesting a redirected path
+ returns not found
+ for a DELETE request
+ when requesting the canonical path with different casing
+ does not 404
+ does not redirect to the correct casing
+ when requesting a redirected path
+ returns not found
+ PUT transfer
+ when transfering to a subgroup goes right
+ should return a notice (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should redirect to the new path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when converting to a root group goes right
+ should return a notice (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should redirect to the new path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ When the transfer goes wrong
+ should return an alert (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should redirect to the current path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the user is not allowed to transfer the group
+ should be denied (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+
+Import/Export - project import integration test
+Starting the Capybara driver server...
+ invalid project
+ when selecting the namespace
+ prefilled the path
+ user imports an exported project successfully
+ path is not prefilled
+ user imports an exported project successfully
+
+Gitlab::Middleware::Go
+ #call
+ when go-get=0
+ skips go-import generation
+ when go-get=1
+ with SSH disabled
+ with simple 2-segment project path
+ with subpackages
+ returns the full project path
+ without subpackages
+ returns the full project path
+ with a nested project path
+ with subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a subpackage that is not a valid project path
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ without subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a bogus path
+ skips go-import generation
+ with HTTP disabled
+ with simple 2-segment project path
+ with subpackages
+ returns the full project path
+ without subpackages
+ returns the full project path
+ with a nested project path
+ with subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a subpackage that is not a valid project path
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ without subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a bogus path
+ skips go-import generation
+ with nothing disabled
+ with simple 2-segment project path
+ with subpackages
+ returns the full project path
+ without subpackages
+ returns the full project path
+ with a nested project path
+ with subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a subpackage that is not a valid project path
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ without subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a bogus path
+ skips go-import generation
+ with nothing disabled (blank string)
+ with simple 2-segment project path
+ with subpackages
+ returns the full project path
+ without subpackages
+ returns the full project path
+ with a nested project path
+ with subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a subpackage that is not a valid project path
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ without subpackages
+ behaves like a nested project
+ when the project is public
+ returns the full project path
+ when the project is private
+ when not authenticated
+ behaves like unauthorized
+ returns the 2-segment group path
+ when authenticated
+ using warden
+ when active
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ when blocked
+ behaves like unauthorized
+ returns the 2-segment group path
+ using a personal access token
+ with api scope
+ behaves like authenticated
+ with access to the project
+ returns the full project path
+ without access to the project
+ behaves like unauthorized
+ returns the 2-segment group path
+ with read_user scope
+ behaves like unauthorized
+ returns the 2-segment group path
+ with a bogus path
+ skips go-import generation
+
+Groups::TransferService
+ #execute
+ when transforming a group into a root group
+ behaves like ensuring allowed transfer for a group
+ with other database than PostgreSQL
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when there's an exception on Gitlab shell directories
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the group is already a root group
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the user does not have the right policies
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when there is a group with the same path
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the group is a subgroup and the transfer is valid
+ should update group attributes (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should update group children path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should update group projects path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when transferring a subgroup into another group
+ behaves like ensuring allowed transfer for a group
+ with other database than PostgreSQL
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when there's an exception on Gitlab shell directories
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the new parent group is the same as the previous parent group
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the user does not have the right policies
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the parent has a group with the same path
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the parent group has a project with the same path
+ should return false (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should add an error on group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the group is allowed to be transferred
+ should update visibility for the group based on the parent group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should update parent group to the new parent (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should return the group as children of the new parent (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should create a redirect for the group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the group has a lower visibility than the parent group
+ should not update the visibility for the group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the group has a higher visibility than the parent group
+ should update visibility level based on the parent group (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when transferring a group with group descendants
+ should update subgroups path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should create redirects for the subgroups (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the new parent has a higher visibility than the children
+ should not update the children visibility (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the new parent has a lower visibility than the children
+ should update children visibility to match the new parent (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when transferring a group with project descendants
+ should update projects path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should create permanent redirects for the projects (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the new parent has a higher visibility than the projects
+ should not update projects visibility (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when the new parent has a lower visibility than the projects
+ should update projects visibility to match the new parent (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when transferring a group with subgroups & projects descendants
+ should update subgroups path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should update projects path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should create redirect for the subgroups and projects (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when transfering a group with nested groups and projects
+ should update subgroups path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should update projects path (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ should create redirect for the subgroups and projects (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+ when updating the group goes wrong
+ should restore group and projects visibility (PENDING: around hook at ./spec/spec_helper.rb:190 did not execute the example)
+
+Editing file blob
+ as a developer
+ from MR diff
+ returns me to the mr
+ from blob file path
+ updates content
+ previews content
+ visit blob edit
+ redirects to sign in and returns
+ as developer
+ redirects to sign in and returns
+ as guest
+ redirects to sign in and returns
+ as developer
+ on some branch
+ shows blob editor with same branch
+ with protected branch
+ shows blob editor with patch branch
+ as master
+ shows blob editor with same branch
+
+Boards::Lists::MoveService
+ #execute
+ when board parent is a project
+ behaves like lists move service
+ keeps position of lists when list type is closed
+ when list type is set to label
+ keeps position of lists when new position is nil
+ keeps position of lists when new positon is equal to old position
+ keeps position of lists when new positon is negative
+ keeps position of lists when new positon is equal to number of labels lists
+ keeps position of lists when new positon is greater than number of labels lists
+ increments position of intermediate lists when new positon is equal to first position
+ decrements position of intermediate lists when new positon is equal to last position
+ decrements position of intermediate lists when new position is greater than old position
+ increments position of intermediate lists when new position is lower than old position
+ when board parent is a group
+ behaves like lists move service
+ keeps position of lists when list type is closed
+ when list type is set to label
+ keeps position of lists when new position is nil
+ keeps position of lists when new positon is equal to old position
+ keeps position of lists when new positon is negative
+ keeps position of lists when new positon is equal to number of labels lists
+ keeps position of lists when new positon is greater than number of labels lists
+ increments position of intermediate lists when new positon is equal to first position
+ decrements position of intermediate lists when new positon is equal to last position
+ decrements position of intermediate lists when new position is greater than old position
+ increments position of intermediate lists when new position is lower than old position
+
+CreateDeploymentService
+ #execute
+ when environment exists
+ creates a deployment
+ when environment does not exist
+ does not create a deployment
+ when start action is defined
+ and environment is stopped
+ makes environment available
+ creates a deployment
+ when stop action is defined
+ and environment is available
+ makes environment stopped
+ does not create a deployment
+ when variables are used
+ creates a new deployment
+ does not create a new environment
+ updates external url
+ when project was removed
+ does not create deployment or environment
+ #expanded_environment_url
+ when yaml environment uses $CI_COMMIT_REF_NAME
+ should eq "http://review/master"
+ when yaml environment uses $CI_ENVIRONMENT_SLUG
+ should eq "http://review/prod-slug"
+ when yaml environment uses yaml_variables containing symbol keys
+ should eq "http://review/host"
+ when yaml environment does not have url
+ returns the external_url from persisted environment
+ processing of builds
+ without environment specified
+ behaves like does not create deployment
+ does not create a new deployment
+ does not call a service
+ when environment is specified
+ when job succeeds
+ behaves like creates deployment
+ creates a new deployment
+ calls a service
+ is set as deployable
+ updates environment URL
+ when job fails
+ behaves like does not create deployment
+ does not create a new deployment
+ does not call a service
+ when job is retried
+ behaves like creates deployment
+ creates a new deployment
+ calls a service
+ is set as deployable
+ updates environment URL
+ merge request metrics
+ while updating the 'first_deployed_to_production_at' time
+ for merge requests merged before the current deploy
+ sets the time if the deploy's environment is 'production'
+ doesn't set the time if the deploy's environment is not 'production'
+ does not raise errors if the merge request does not have a metrics record
+ for merge requests merged before the previous deploy
+ if the 'first_deployed_to_production_at' time is already set
+ does not overwrite the older 'first_deployed_to_production_at' time
+ if the 'first_deployed_to_production_at' time is not already set
+ does not overwrite the older 'first_deployed_to_production_at' time
+
+Groups::MilestonesController
+ #index
+ shows group milestones page
+ as JSON
+ lists legacy group milestones and group milestones
+ #show
+ when there is a title parameter
+ searchs for a legacy group milestone
+ when there is not a title parameter
+ searchs for a group milestone
+ behaves like milestone tabs
+ #merge_requests
+ as html
+ redirects to milestone#show
+ as json
+ renders the merge requests tab template to a string
+ #participants
+ as html
+ redirects to milestone#show
+ as json
+ renders the participants tab template to a string
+ #labels
+ as html
+ redirects to milestone#show
+ as json
+ renders the labels tab template to a string
+ #create
+ creates group milestone with Chinese title
+ #update
+ updates group milestone
+ legacy group milestones
+ updates only group milestones state
+ #ensure_canonical_path
+ for a GET request
+ when requesting the canonical path
+ non-show path
+ with exactly matching casing
+ does not redirect
+ with different casing
+ redirects to the correct casing
+ show path
+ with exactly matching casing
+ does not redirect
+ with different casing
+ redirects to the correct casing
+ when requesting a redirected path
+ redirects to the canonical path
+ when the old group path is a substring of the scheme or host
+ does not modify the requested host
+ when the old group path is substring of groups
+ does not modify the /groups part of the path
+ when the old group path is substring of groups plus the new path
+ does not modify the /groups part of the path
+ for a non-GET request
+ when requesting the canonical path with different casing
+ does not 404
+ does not redirect to the correct casing
+ when requesting a redirected path
+ returns not found
+
+GroupsHelper
+ group_icon
+ returns an url for the avatar
+ group_icon_url
+ returns an url for the avatar
+ gives default avatar_icon when no avatar is present
+ group_lfs_status
+ only one project in group
+ returns all projects as enabled
+ returns all projects as disabled
+ more than one project in group
+ LFS enabled in group
+ returns both projects as enabled
+ returns only one as enabled
+ LFS disabled in group
+ returns both projects as disabled
+ returns only one as disabled
+ group_title
+ outputs the groups in the correct order (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ #share_with_group_lock_help_text
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :subgroup
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :subgroup
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :subgroup
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :ancestor_locked_but_you_can_override, linked_ancestor: :subgroup
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :ancestor_locked_but_you_can_override, linked_ancestor: :subgroup
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :ancestor_locked_so_ask_the_owner, linked_ancestor: :subgroup
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :root_group
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :root_group
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :root_group
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :ancestor_locked_but_you_can_override, linked_ancestor: :root_group
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :ancestor_locked_so_ask_the_owner, linked_ancestor: :root_group
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :ancestor_locked_so_ask_the_owner, linked_ancestor: :root_group
+ has the correct help text with correct ancestor links (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ #group_sidebar_links
+ returns all the expected links
+ includes settings when the user can admin the group
+ excludes cross project features when the user cannot read cross project
+
+API::V3::Todos
+ DELETE /todos/:id
+ when unauthenticated
+ returns authentication error
+ when authenticated
+ marks a todo as done
+ updates todos cache
+ returns 404 if the todo does not belong to the current user
+ DELETE /todos
+ when unauthenticated
+ returns authentication error
+ when authenticated
+ marks all todos as done
+ updates todos cache
+
+TeamcityService
+ Associations
+ should belong to project
+ should have one service_hook
+ Validations
+ when service is active
+ should validate that :build_type cannot be empty/falsy
+ should validate that :teamcity_url cannot be empty/falsy
+ behaves like issue tracker service URL attribute
+ should allow :teamcity_url to be ‹"https://example.com"›
+ should not allow :teamcity_url to be ‹"example.com"›
+ should not allow :teamcity_url to be ‹"ftp://example.com"›
+ should not allow :teamcity_url to be ‹"herp-and-derp"›
+ #username
+ does not validate the presence of username if password is nil
+ validates the presence of username if password is present
+ #password
+ does not validate the presence of password if username is nil
+ validates the presence of password if username is present
+ when service is inactive
+ should not validate that :build_type cannot be empty/falsy
+ should not validate that :teamcity_url cannot be empty/falsy
+ should not validate that :username cannot be empty/falsy
+ should not validate that :password cannot be empty/falsy
+ Callbacks
+ before_update :reset_password
+ saves password if new url is set together with password when no password was previously set
+ when a password was previously set
+ resets password if url changed
+ does not reset password if username changed
+ does not reset password if new url is set together with password, even if it's the same password
+ #build_page
+ returns the contents of the reactive cache
+ #commit_status
+ returns the contents of the reactive cache
+ #calculate_reactive_cache
+ build_page
+ returns a specific URL when status is 500
+ returns a build URL when teamcity_url has no trailing slash
+ teamcity_url has trailing slash
+ returns a build URL
+ commit_status
+ sets commit status to :error when status is 500
+ sets commit status to "pending" when status is 404
+ sets commit status to "success" when build status contains SUCCESS
+ sets commit status to "failed" when build status contains FAILURE
+ sets commit status to "pending" when build status contains Pending
+ sets commit status to :error when build status is unknown
+
+Gitlab::Conflict::File
+ #resolve_lines
+ raises ResolutionError when passed a hash without resolutions for all sections
+ when resolving everything to the same side
+ has the correct number of lines
+ has content matching the chosen lines
+ with mixed resolutions
+ has the correct number of lines
+ returns a file containing only the chosen parts of the resolved sections
+ #highlight_lines!
+ modifies the existing lines
+ is called implicitly when rich_text is accessed on a line
+ sets the rich_text of the lines matching the text content
+ highlights the lines correctly
+ #sections
+ only inserts match lines when there is a gap between sections
+ sets conflict to false for sections with only unchanged lines
+ only includes a maximum of CONTEXT_LINES (plus an optional match line) in context sections
+ sets conflict to true for sections with only changed lines
+ adds unique IDs to conflict sections, and not to other sections
+ with an example file
+ sets the correct match line headers
+ does not add match lines where they are not needed
+ creates context sections of the correct length
+ #as_json
+ includes the blob path for the file
+ includes the blob icon for the file
+ with the full_content option passed
+ includes the full content of the conflict
+ includes the detected language of the conflict file
+
+Banzai::Filter::SnippetReferenceFilter
+ requires project context
+ ignores valid references contained inside 'pre' element
+ ignores valid references contained inside 'code' element
+ ignores valid references contained inside 'a' element
+ ignores valid references contained inside 'style' element
+ internal reference
+ links to a valid reference
+ links with adjacent text
+ ignores invalid snippet IDs
+ includes a title attribute
+ escapes the title attribute
+ includes default classes
+ includes a data-project attribute
+ includes a data-snippet attribute
+ supports an :only_path context
+ cross-project / cross-namespace complete reference
+ links to a valid reference
+ link has valid text
+ has valid text
+ ignores invalid snippet IDs on the referenced project
+ cross-project / same-namespace complete reference
+ links to a valid reference
+ link has valid text
+ has valid text
+ ignores invalid snippet IDs on the referenced project
+ cross-project shorthand reference
+ links to a valid reference
+ link has valid text
+ has valid text
+ ignores invalid snippet IDs on the referenced project
+ cross-project URL reference
+ links to a valid reference
+ links with adjacent text
+ ignores invalid snippet IDs on the referenced project
+ group context
+ links to a valid reference
+
+AutocompleteUsersFinder
+ #execute
+ should contain exactly #<User id:2126 @johndoe>, #<User id:2128 @user2119>, #<User id:2129 @user2120>, and #<User id:2130 @user2121>
+ when current_user not passed or nil
+ should contain exactly
+ when project passed
+ should contain exactly #<User id:2140 @user2127>
+ when author_id passed
+ should contain exactly #<User id:2146 @user2131> and #<User id:2142 @notsorandom>
+ when group passed and project not passed
+ should contain exactly #<User id:2147 @johndoe>
+ when passed a subgroup
+ includes users from parent groups as well (PENDING: around hook at ./spec/spec_helper.rb:186 did not execute the example)
+ when filtered by search
+ should contain exactly #<User id:2152 @johndoe>
+ when filtered by skip_users
+ should contain exactly #<User id:2157 @johndoe> and #<User id:2159 @user2138>
+ when todos exist
+ when filtered by todo_filter without todo_state_filter
+ should contain exactly
+ when filtered by todo_filter with pending todo_state_filter
+ should contain exactly #<User id:2175 @johndoe>
+ when filtered by todo_filter with done todo_state_filter
+ should contain exactly #<User id:2190 @user2163>
+ when filtered by current_user
+ should contain exactly #<User id:2202 @notsorandom>, #<User id:2201 @johndoe>, #<User id:2203 @user2174>, and #<User id:2204 @user2175>
+ when filtered by author_id
+ should contain exactly #<User id:2206 @notsorandom>, #<User id:2205 @johndoe>, #<User id:2207 @user2176>, #<User id:2208 @user2177>, and #<User id:2209 @user2178>
+
+Service
+ Associations
+ should belong to project
+ should have one service_hook
+ Validations
+ should validate that :type cannot be empty/falsy
+ Scopes
+ .confidential_note_hooks
+ includes services where confidential_note_events is true
+ excludes services where confidential_note_events is false
+ Test Button
+ #can_test?
+ when repository is not empty
+ returns true
+ when repository is empty
+ returns true
+ #test
+ when repository is not empty
+ test runs execute
+ when repository is empty
+ test runs execute
+ Template
+ .build_from_template
+ when template is invalid
+ sets service template to inactive when template is invalid
+ for pushover service
+ is prefilled for projects pushover service
+ has all fields prefilled
+ {property}_changed?
+ returns false when the property has not been assigned a new value
+ returns true when the property has been assigned a different value
+ returns true when the property has been assigned a different value twice
+ returns false when the property has been re-assigned the same value
+ returns false when the property has been assigned a new value then saved
+ {property}_touched?
+ returns false when the property has not been assigned a new value
+ returns true when the property has been assigned a different value
+ returns true when the property has been assigned a different value twice
+ returns true when the property has been re-assigned the same value
+ returns false when the property has been assigned a new value then saved
+ {property}_was
+ returns nil when the property has not been assigned a new value
+ returns the previous value when the property has been assigned a different value
+ returns initial value when the property has been re-assigned the same value
+ returns initial value when the property has been assigned multiple values
+ returns nil when the property has been assigned a new value then saved
+ initialize service with no properties
+ does not raise error
+ creates the properties
+ callbacks
+ on create
+ updates the has_external_issue_tracker boolean
+ on update
+ updates the has_external_issue_tracker boolean
+ #deprecated?
+ should return false by default
+ #deprecation_message
+ should be empty by default
+ .find_by_template
+ returns service template
+ #api_field_names
+ filters out sensitive fields
+
+TestHooks::ProjectService
+ #execute
+ hook with not implemented test
+ returns error message
+ push_events
+ returns error message if not enough data
+ executes hook
+ tag_push_events
+ returns error message if not enough data
+ executes hook
+ note_events
+ returns error message if not enough data
+ executes hook
+ issues_events
+ returns error message if not enough data
+ executes hook
+ confidential_issues_events
+ returns error message if not enough data
+ executes hook
+ merge_requests_events
+ returns error message if not enough data
+ executes hook
+ job_events
+ returns error message if not enough data
+ executes hook
+ pipeline_events
+ returns error message if not enough data
+ executes hook
+ wiki_page_events
+ returns error message if wiki disabled
+ returns error message if not enough data
+ executes hook
+
+User views an open merge request
+ when a merge request does not have repository
+ renders both the title and the description
+ when a merge request has repository
+ when rendering description preview
+ renders empty description preview
+ renders description preview
+ when the branch is rebased on the target
+ does not show diverged commits count
+ when the branch is diverged on the target
+ shows diverged commits count
+
+RunnerJobsFinder
+ #execute
+ when params is empty
+ returns all jobs assigned to Runner
+ when params contains status
+ when status is created
+ returns matched job
+ when status is pending
+ returns matched job
+ when status is running
+ returns matched job
+ when status is success
+ returns matched job
+ when status is failed
+ returns matched job
+ when status is canceled
+ returns matched job
+ when status is skipped
+ returns matched job
+ when status is manual
+ returns matched job
+
+Project snippets
+ when the project has snippets
+ pagination
+ behaves like paginated snippets
+ is limited to 20 items per page
+ clicking on the link to the second page
+ shows the remaining snippets
+ list content
+ contains all project snippets
+ when submitting a note
+ should have autocomplete
+ should have zen mode
+
+API::V3::Environments
+ GET /projects/:id/environments
+ as member of the project
+ returns project environments
+ behaves like a paginated resources
+ has pagination headers
+ as non member
+ returns a 404 status code
+ POST /projects/:id/environments
+ as a member
+ creates a environment with valid params
+ requires name to be passed
+ returns a 400 if environment already exists
+ returns a 400 if slug is specified
+ a non member
+ rejects the request
+ returns a 400 when the required params are missing
+ PUT /projects/:id/environments/:environment_id
+ returns a 200 if name and external_url are changed
+ won't allow slug to be changed
+ won't update the external_url if only the name is passed
+ returns a 404 if the environment does not exist
+ DELETE /projects/:id/environments/:environment_id
+ as a master
+ returns a 200 for an existing environment
+ returns a 404 for non existing id
+ a non member
+ rejects the request
+
+API::Namespaces
+ GET /namespaces
+ when unauthenticated
+ returns authentication error
+ when authenticated as admin
+ returns correct attributes
+ admin: returns an array of all namespaces
+ admin: returns an array of matched namespaces
+ when authenticated as a regular user
+ returns correct attributes when user can admin group
+ returns correct attributes when user cannot admin group
+ user: returns an array of namespaces
+ admin: returns an array of matched namespaces
+ GET /namespaces/:id
+ when unauthenticated
+ returns authentication error
+ when authenticated as regular user
+ when requested namespace is not owned by user
+ when requesting group
+ returns not-found
+ when requesting personal namespace
+ returns not-found
+ when requested namespace is owned by user
+ behaves like namespace reader
+ when namespace exists
+ when requested by ID
+ when requesting group
+ behaves like can access namespace
+ returns namespace details
+ when requesting personal namespace
+ behaves like can access namespace
+ returns namespace details
+ when requested by path
+ when requesting group
+ behaves like can access namespace
+ returns namespace details
+ when requesting personal namespace
+ behaves like can access namespace
+ returns namespace details
+ when namespace doesn't exist
+ returns not-found
+ when authenticated as admin
+ when requested namespace is not owned by user
+ when requesting group
+ behaves like can access namespace
+ returns namespace details
+ when requesting personal namespace
+ behaves like can access namespace
+ returns namespace details
+ when requested namespace is owned by user
+ behaves like namespace reader
+ when namespace exists
+ when requested by ID
+ when requesting group
+ behaves like can access namespace
+ returns namespace details
+ when requesting personal namespace
+ behaves like can access namespace
+ returns namespace details
+ when requested by path
+ when requesting group
+ behaves like can access namespace
+ returns namespace details
+ when requesting personal namespace
+ behaves like can access namespace
+ returns namespace details
+ when namespace doesn't exist
+ returns not-found
+
+MergeRequests::GetUrlsService
+ #execute
+ pushing to default branch
+ behaves like no_merge_request_url
+ returns no URL
+ pushing to project with MRs disabled
+ behaves like no_merge_request_url
+ returns no URL
+ pushing one completely new branch
+ behaves like new_merge_request_link
+ returns url to create new merge request
+ pushing to existing branch but no merge request
+ behaves like new_merge_request_link
+ returns url to create new merge request
+ pushing to deleted branch
+ behaves like no_merge_request_url
+ returns no URL
+ pushing to existing branch and merge request opened
+ behaves like show_merge_request_url
+ returns url to view merge request
+ pushing to existing branch and merge request is reopened
+ behaves like show_merge_request_url
+ returns url to view merge request
+ pushing to existing branch from forked project
+ behaves like show_merge_request_url
+ returns url to view merge request
+ pushing to existing branch and merge request is closed
+ behaves like new_merge_request_link
+ returns url to create new merge request
+ pushing to existing branch and merge request is merged
+ behaves like new_merge_request_link
+ returns url to create new merge request
+ pushing new branch and existing branch (with merge request created) at once
+ returns 2 urls for both creating new and showing merge request
+ when printing_merge_request_link_enabled is false
+ returns empty array
+
+LfsFileLock
+ should belong to project
+ should belong to user
+ should validate that :project_id cannot be empty/falsy
+ should validate that :user_id cannot be empty/falsy
+ should validate that :path cannot be empty/falsy
+ #can_be_unlocked_by?
+ when it's forced
+ can be unlocked by the author
+ can be unlocked by a master
+ can't be unlocked by other user
+ when it isn't forced
+ can be unlocked by the author
+ can't be unlocked by a master
+ can't be unlocked by other user
+
+Gitlab::Ci::Config::Entry::Boolean
+ validations
+ when entry config value is valid
+ #value
+ returns key value
+ #valid?
+ is valid
+ when entry value is not valid
+ #errors
+ saves errors
+Knapsack report was generated. Preview:
+{
+ "spec/services/todo_service_spec.rb": 53.71851348876953,
+ "spec/lib/gitlab/import_export/project_tree_saver_spec.rb": 48.39624857902527,
+ "spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb": 35.17360734939575,
+ "spec/controllers/projects/merge_requests_controller_spec.rb": 25.50887441635132,
+ "spec/controllers/groups_controller_spec.rb": 13.007296323776245,
+ "spec/features/projects/import_export/import_file_spec.rb": 16.827879428863525,
+ "spec/lib/gitlab/middleware/go_spec.rb": 12.497276306152344,
+ "spec/features/projects/blobs/edit_spec.rb": 11.511932134628296,
+ "spec/services/boards/lists/move_service_spec.rb": 8.695446491241455,
+ "spec/services/create_deployment_service_spec.rb": 6.754847526550293,
+ "spec/controllers/groups/milestones_controller_spec.rb": 6.8740551471710205,
+ "spec/helpers/groups_helper_spec.rb": 0.9002459049224854,
+ "spec/requests/api/v3/todos_spec.rb": 6.5924904346466064,
+ "spec/models/project_services/teamcity_service_spec.rb": 2.9881808757781982,
+ "spec/lib/gitlab/conflict/file_spec.rb": 5.294132709503174,
+ "spec/lib/banzai/filter/snippet_reference_filter_spec.rb": 4.118850469589233,
+ "spec/finders/autocomplete_users_finder_spec.rb": 3.864232063293457,
+ "spec/models/service_spec.rb": 3.1697962284088135,
+ "spec/services/test_hooks/project_service_spec.rb": 4.167759656906128,
+ "spec/features/projects/merge_requests/user_views_open_merge_request_spec.rb": 4.707003355026245,
+ "spec/finders/runner_jobs_finder_spec.rb": 3.2137575149536133,
+ "spec/features/projects/snippets_spec.rb": 3.631467580795288,
+ "spec/requests/api/v3/environments_spec.rb": 2.314746856689453,
+ "spec/requests/api/namespaces_spec.rb": 2.352935314178467,
+ "spec/services/merge_requests/get_urls_service_spec.rb": 2.8039824962615967,
+ "spec/models/lfs_file_lock_spec.rb": 0.7295050621032715,
+ "spec/lib/gitlab/ci/config/entry/boolean_spec.rb": 0.007024049758911133
+}
+
+Knapsack global time execution for tests: 04m 49s
+
+Pending: (Failures listed here are expected and do not affect your suite's status)
+
+ 1) GroupsController GET #new when creating subgroups and can_create_group is true and logged in as Admin behaves like member with ability to create subgroups renders the new page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:15
+
+ 2) GroupsController GET #new when creating subgroups and can_create_group is true and logged in as Owner behaves like member with ability to create subgroups renders the new page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:15
+
+ 3) GroupsController GET #new when creating subgroups and can_create_group is true and logged in as Guest behaves like member without ability to create subgroups renders the 404 page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:25
+
+ 4) GroupsController GET #new when creating subgroups and can_create_group is true and logged in as Developer behaves like member without ability to create subgroups renders the 404 page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:25
+
+ 5) GroupsController GET #new when creating subgroups and can_create_group is true and logged in as Master behaves like member without ability to create subgroups renders the 404 page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:25
+
+ 6) GroupsController GET #new when creating subgroups and can_create_group is false and logged in as Admin behaves like member with ability to create subgroups renders the new page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:15
+
+ 7) GroupsController GET #new when creating subgroups and can_create_group is false and logged in as Owner behaves like member with ability to create subgroups renders the new page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:15
+
+ 8) GroupsController GET #new when creating subgroups and can_create_group is false and logged in as Guest behaves like member without ability to create subgroups renders the 404 page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:25
+
+ 9) GroupsController GET #new when creating subgroups and can_create_group is false and logged in as Developer behaves like member without ability to create subgroups renders the 404 page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:25
+
+ 10) GroupsController GET #new when creating subgroups and can_create_group is false and logged in as Master behaves like member without ability to create subgroups renders the 404 page
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:25
+
+ 11) GroupsController POST #create when creating subgroups and can_create_group is true and logged in as Owner creates the subgroup
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:117
+
+ 12) GroupsController POST #create when creating subgroups and can_create_group is true and logged in as Developer renders the new template
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:129
+
+ 13) GroupsController POST #create when creating subgroups and can_create_group is false and logged in as Owner creates the subgroup
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:117
+
+ 14) GroupsController POST #create when creating subgroups and can_create_group is false and logged in as Developer renders the new template
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:129
+
+ 15) GroupsController PUT transfer when transfering to a subgroup goes right should return a notice
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:516
+
+ 16) GroupsController PUT transfer when transfering to a subgroup goes right should redirect to the new path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:520
+
+ 17) GroupsController PUT transfer when converting to a root group goes right should return a notice
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:535
+
+ 18) GroupsController PUT transfer when converting to a root group goes right should redirect to the new path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:539
+
+ 19) GroupsController PUT transfer When the transfer goes wrong should return an alert
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:557
+
+ 20) GroupsController PUT transfer When the transfer goes wrong should redirect to the current path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:561
+
+ 21) GroupsController PUT transfer when the user is not allowed to transfer the group should be denied
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/controllers/groups_controller_spec.rb:577
+
+ 22) Groups::TransferService#execute when transforming a group into a root group behaves like ensuring allowed transfer for a group with other database than PostgreSQL should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:15
+
+ 23) Groups::TransferService#execute when transforming a group into a root group behaves like ensuring allowed transfer for a group with other database than PostgreSQL should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:19
+
+ 24) Groups::TransferService#execute when transforming a group into a root group behaves like ensuring allowed transfer for a group when there's an exception on Gitlab shell directories should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:33
+
+ 25) Groups::TransferService#execute when transforming a group into a root group behaves like ensuring allowed transfer for a group when there's an exception on Gitlab shell directories should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:37
+
+ 26) Groups::TransferService#execute when transforming a group into a root group when the group is already a root group should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:53
+
+ 27) Groups::TransferService#execute when transforming a group into a root group when the user does not have the right policies should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:62
+
+ 28) Groups::TransferService#execute when transforming a group into a root group when the user does not have the right policies should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:66
+
+ 29) Groups::TransferService#execute when transforming a group into a root group when there is a group with the same path should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:79
+
+ 30) Groups::TransferService#execute when transforming a group into a root group when there is a group with the same path should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:83
+
+ 31) Groups::TransferService#execute when transforming a group into a root group when the group is a subgroup and the transfer is valid should update group attributes
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:99
+
+ 32) Groups::TransferService#execute when transforming a group into a root group when the group is a subgroup and the transfer is valid should update group children path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:103
+
+ 33) Groups::TransferService#execute when transforming a group into a root group when the group is a subgroup and the transfer is valid should update group projects path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:109
+
+ 34) Groups::TransferService#execute when transferring a subgroup into another group behaves like ensuring allowed transfer for a group with other database than PostgreSQL should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:15
+
+ 35) Groups::TransferService#execute when transferring a subgroup into another group behaves like ensuring allowed transfer for a group with other database than PostgreSQL should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:19
+
+ 36) Groups::TransferService#execute when transferring a subgroup into another group behaves like ensuring allowed transfer for a group when there's an exception on Gitlab shell directories should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:33
+
+ 37) Groups::TransferService#execute when transferring a subgroup into another group behaves like ensuring allowed transfer for a group when there's an exception on Gitlab shell directories should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:37
+
+ 38) Groups::TransferService#execute when transferring a subgroup into another group when the new parent group is the same as the previous parent group should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:125
+
+ 39) Groups::TransferService#execute when transferring a subgroup into another group when the new parent group is the same as the previous parent group should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:129
+
+ 40) Groups::TransferService#execute when transferring a subgroup into another group when the user does not have the right policies should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:138
+
+ 41) Groups::TransferService#execute when transferring a subgroup into another group when the user does not have the right policies should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:142
+
+ 42) Groups::TransferService#execute when transferring a subgroup into another group when the parent has a group with the same path should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:155
+
+ 43) Groups::TransferService#execute when transferring a subgroup into another group when the parent has a group with the same path should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:159
+
+ 44) Groups::TransferService#execute when transferring a subgroup into another group when the parent group has a project with the same path should return false
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:174
+
+ 45) Groups::TransferService#execute when transferring a subgroup into another group when the parent group has a project with the same path should add an error on group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:178
+
+ 46) Groups::TransferService#execute when transferring a subgroup into another group when the group is allowed to be transferred should update visibility for the group based on the parent group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:212
+
+ 47) Groups::TransferService#execute when transferring a subgroup into another group when the group is allowed to be transferred should update parent group to the new parent
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:216
+
+ 48) Groups::TransferService#execute when transferring a subgroup into another group when the group is allowed to be transferred should return the group as children of the new parent
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:220
+
+ 49) Groups::TransferService#execute when transferring a subgroup into another group when the group is allowed to be transferred should create a redirect for the group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:225
+
+ 50) Groups::TransferService#execute when transferring a subgroup into another group when the group is allowed to be transferred when the group has a lower visibility than the parent group should not update the visibility for the group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:194
+
+ 51) Groups::TransferService#execute when transferring a subgroup into another group when the group is allowed to be transferred when the group has a higher visibility than the parent group should update visibility level based on the parent group
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:205
+
+ 52) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with group descendants should update subgroups path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:239
+
+ 53) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with group descendants should create redirects for the subgroups
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:246
+
+ 54) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with group descendants when the new parent has a higher visibility than the children should not update the children visibility
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:253
+
+ 55) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with group descendants when the new parent has a lower visibility than the children should update children visibility to match the new parent
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:264
+
+ 56) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with project descendants should update projects path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:282
+
+ 57) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with project descendants should create permanent redirects for the projects
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:289
+
+ 58) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with project descendants when the new parent has a higher visibility than the projects should not update projects visibility
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:296
+
+ 59) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with project descendants when the new parent has a lower visibility than the projects should update projects visibility to match the new parent
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:307
+
+ 60) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with subgroups & projects descendants should update subgroups path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:327
+
+ 61) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with subgroups & projects descendants should update projects path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:334
+
+ 62) Groups::TransferService#execute when transferring a subgroup into another group when transferring a group with subgroups & projects descendants should create redirect for the subgroups and projects
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:341
+
+ 63) Groups::TransferService#execute when transferring a subgroup into another group when transfering a group with nested groups and projects should update subgroups path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:363
+
+ 64) Groups::TransferService#execute when transferring a subgroup into another group when transfering a group with nested groups and projects should update projects path
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:375
+
+ 65) Groups::TransferService#execute when transferring a subgroup into another group when transfering a group with nested groups and projects should create redirect for the subgroups and projects
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:383
+
+ 66) Groups::TransferService#execute when transferring a subgroup into another group when updating the group goes wrong should restore group and projects visibility
+ # around hook at ./spec/spec_helper.rb:190 did not execute the example
+ # ./spec/services/groups/transfer_service_spec.rb:405
+
+ 67) GroupsHelper group_title outputs the groups in the correct order
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:106
+
+ 68) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 69) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 70) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 71) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 72) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 73) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 74) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :subgroup has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 75) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :subgroup has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 76) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :subgroup has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 77) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :ancestor_locked_but_you_can_override, linked_ancestor: :subgroup has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 78) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :ancestor_locked_but_you_can_override, linked_ancestor: :subgroup has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 79) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: false, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :ancestor_locked_so_ask_the_owner, linked_ancestor: :subgroup has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 80) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 81) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 82) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 83) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
+
+ 84) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-path
-Set for your local app (/usr/local/bundle/config): "vendor"
-Set via BUNDLE_PATH: "/usr/local/bundle"
+ 85) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: false, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :default_help, linked_ancestor: nil has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-jobs
-Set for your local app (/usr/local/bundle/config): "2"
+ 86) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :root_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :root_group has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-clean
-Set for your local app (/usr/local/bundle/config): "true"
+ 87) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :root_group has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-without
-Set for your local app (/usr/local/bundle/config): [:production]
+ 88) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: false, current_user: :sub_sub_owner, help_text: :ancestor_locked_and_has_been_overridden, linked_ancestor: :root_group has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-silence_root_warning
-Set via BUNDLE_SILENCE_ROOT_WARNING: true
+ 89) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :root_owner, help_text: :ancestor_locked_but_you_can_override, linked_ancestor: :root_group has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-app_config
-Set via BUNDLE_APP_CONFIG: "/usr/local/bundle"
+ 90) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_owner, help_text: :ancestor_locked_so_ask_the_owner, linked_ancestor: :root_group has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-install_flags
-Set via BUNDLE_INSTALL_FLAGS: "--without=production --jobs=2 --path=vendor --retry=3 --quiet"
+ 91) GroupsHelper#share_with_group_lock_help_text root_share_with_group_locked: true, subgroup_share_with_group_locked: true, sub_subgroup_share_with_group_locked: true, current_user: :sub_sub_owner, help_text: :ancestor_locked_so_ask_the_owner, linked_ancestor: :root_group has the correct help text with correct ancestor links
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/helpers/groups_helper_spec.rb:198
-bin
-Set via BUNDLE_BIN: "/usr/local/bundle/bin"
+ 92) AutocompleteUsersFinder#execute when passed a subgroup includes users from parent groups as well
+ # around hook at ./spec/spec_helper.rb:186 did not execute the example
+ # ./spec/finders/autocomplete_users_finder_spec.rb:55
-gemfile
-Set via BUNDLE_GEMFILE: "/builds/gitlab-org/gitlab-ce/Gemfile"
+Finished in 5 minutes 7 seconds (files took 16.6 seconds to load)
+819 examples, 0 failures, 92 pending
-section_end:1517486961:build_script
-section_start:1517486961:after_script
-section_end:1517486962:after_script
-section_start:1517486962:upload_artifacts
+section_end:1522927514:build_script
+section_start:1522927514:after_script
+Running after script...
+$ date
+Thu Apr 5 11:25:14 UTC 2018
+section_end:1522927515:after_script
+section_start:1522927515:archive_cache
+Not uploading cache ruby-2.3.6-with-yarn due to policy
+section_end:1522927516:archive_cache
+section_start:1522927516:upload_artifacts
Uploading artifacts...
-WARNING: coverage/: no matching files 
+coverage/: found 5 matching files 
knapsack/: found 5 matching files 
+rspec_flaky/: found 4 matching files 
WARNING: tmp/capybara/: no matching files 
-Uploading artifacts to coordinator... ok  id=50551722 responseStatus=201 Created token=XkN753rp
-section_end:1517486963:upload_artifacts
-ERROR: Job failed: exit code 1
- \ No newline at end of file
+Uploading artifacts to coordinator... ok  id=61303283 responseStatus=201 Created token=rusBKvxM
+section_end:1522927520:upload_artifacts
+Job succeeded
+
diff --git a/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js b/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js
new file mode 100644
index 00000000000..d62d58101d6
--- /dev/null
+++ b/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js
@@ -0,0 +1,174 @@
+import Vue from 'vue';
+import CommitMessageField from '~/ide/components/commit_sidebar/message_field.vue';
+import createComponent from 'spec/helpers/vue_mount_component_helper';
+
+describe('IDE commit message field', () => {
+ const Component = Vue.extend(CommitMessageField);
+ let vm;
+
+ beforeEach(() => {
+ setFixtures('<div id="app"></div>');
+
+ vm = createComponent(
+ Component,
+ {
+ text: '',
+ },
+ '#app',
+ );
+ });
+
+ afterEach(() => {
+ vm.$destroy();
+ });
+
+ it('adds is-focused class on focus', done => {
+ vm.$el.querySelector('textarea').focus();
+
+ vm.$nextTick(() => {
+ expect(vm.$el.querySelector('.is-focused')).not.toBeNull();
+
+ done();
+ });
+ });
+
+ it('removed is-focused class on blur', done => {
+ vm.$el.querySelector('textarea').focus();
+
+ vm
+ .$nextTick()
+ .then(() => {
+ expect(vm.$el.querySelector('.is-focused')).not.toBeNull();
+
+ vm.$el.querySelector('textarea').blur();
+
+ return vm.$nextTick();
+ })
+ .then(() => {
+ expect(vm.$el.querySelector('.is-focused')).toBeNull();
+
+ done();
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+
+ it('emits input event on input', () => {
+ spyOn(vm, '$emit');
+
+ const textarea = vm.$el.querySelector('textarea');
+ textarea.value = 'testing';
+
+ textarea.dispatchEvent(new Event('input'));
+
+ expect(vm.$emit).toHaveBeenCalledWith('input', 'testing');
+ });
+
+ describe('highlights', () => {
+ describe('subject line', () => {
+ it('does not highlight less than 50 characters', done => {
+ vm.text = 'text less than 50 chars';
+
+ vm
+ .$nextTick()
+ .then(() => {
+ expect(vm.$el.querySelector('.highlights span').textContent).toContain(
+ 'text less than 50 chars',
+ );
+ expect(vm.$el.querySelector('mark').style.display).toBe('none');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+
+ it('highlights characters over 50 length', done => {
+ vm.text =
+ 'text less than 50 chars that should not highlighted. text more than 50 should be highlighted';
+
+ vm
+ .$nextTick()
+ .then(() => {
+ expect(vm.$el.querySelector('.highlights span').textContent).toContain(
+ 'text less than 50 chars that should not highlighte',
+ );
+ expect(vm.$el.querySelector('mark').style.display).not.toBe('none');
+ expect(vm.$el.querySelector('mark').textContent).toBe(
+ 'd. text more than 50 should be highlighted',
+ );
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ });
+
+ describe('body text', () => {
+ it('does not highlight body text less tan 72 characters', done => {
+ vm.text = 'subject line\nbody content';
+
+ vm
+ .$nextTick()
+ .then(() => {
+ expect(vm.$el.querySelectorAll('.highlights span').length).toBe(2);
+ expect(vm.$el.querySelectorAll('mark')[1].style.display).toBe('none');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+
+ it('highlights body text more than 72 characters', done => {
+ vm.text =
+ 'subject line\nbody content that will be highlighted when it is more than 72 characters in length';
+
+ vm
+ .$nextTick()
+ .then(() => {
+ expect(vm.$el.querySelectorAll('.highlights span').length).toBe(2);
+ expect(vm.$el.querySelectorAll('mark')[1].style.display).not.toBe('none');
+ expect(vm.$el.querySelectorAll('mark')[1].textContent).toBe(' in length');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+
+ it('highlights body text & subject line', done => {
+ vm.text =
+ 'text less than 50 chars that should not highlighted\nbody content that will be highlighted when it is more than 72 characters in length';
+
+ vm
+ .$nextTick()
+ .then(() => {
+ expect(vm.$el.querySelectorAll('.highlights span').length).toBe(2);
+ expect(vm.$el.querySelectorAll('mark').length).toBe(2);
+
+ expect(vm.$el.querySelectorAll('mark')[0].textContent).toContain('d');
+ expect(vm.$el.querySelectorAll('mark')[1].textContent).toBe(' in length');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ });
+ });
+
+ describe('scrolling textarea', () => {
+ it('updates transform of highlights', done => {
+ vm.text = 'subject line\n\n\n\n\n\n\n\n\n\n\nbody content';
+
+ vm
+ .$nextTick()
+ .then(() => {
+ vm.$el.querySelector('textarea').scrollTo(0, 50);
+
+ vm.handleScroll();
+ })
+ .then(vm.$nextTick)
+ .then(() => {
+ expect(vm.scrollTop).toBe(50);
+ expect(vm.$el.querySelector('.highlights').style.transform).toBe(
+ 'translate3d(0px, -50px, 0px)',
+ );
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ });
+});
diff --git a/spec/javascripts/ide/components/commit_sidebar/radio_group_spec.js b/spec/javascripts/ide/components/commit_sidebar/radio_group_spec.js
index 4e8243439f3..21bfe4be52f 100644
--- a/spec/javascripts/ide/components/commit_sidebar/radio_group_spec.js
+++ b/spec/javascripts/ide/components/commit_sidebar/radio_group_spec.js
@@ -69,19 +69,6 @@ describe('IDE commit sidebar radio group', () => {
});
});
- it('renders helpText tooltip', done => {
- vm.helpText = 'help text';
-
- Vue.nextTick(() => {
- const help = vm.$el.querySelector('.help-block');
-
- expect(help).not.toBeNull();
- expect(help.getAttribute('data-original-title')).toBe('help text');
-
- done();
- });
- });
-
describe('with input', () => {
beforeEach(done => {
vm.$destroy();
diff --git a/spec/lib/banzai/object_renderer_spec.rb b/spec/lib/banzai/object_renderer_spec.rb
index 1fe034ae9a2..209a547c3b3 100644
--- a/spec/lib/banzai/object_renderer_spec.rb
+++ b/spec/lib/banzai/object_renderer_spec.rb
@@ -11,7 +11,7 @@ describe Banzai::ObjectRenderer do
)
end
- let(:object) { Note.new(note: 'hello', note_html: '<p dir="auto">hello</p>', cached_markdown_version: CacheMarkdownField::CACHE_VERSION) }
+ let(:object) { Note.new(note: 'hello', note_html: '<p dir="auto">hello</p>', cached_markdown_version: CacheMarkdownField::CACHE_COMMONMARK_VERSION) }
describe '#render' do
context 'with cache' do
diff --git a/spec/lib/gitlab/ci/trace_spec.rb b/spec/lib/gitlab/ci/trace_spec.rb
index 3a9371ed2e8..6a9c6442282 100644
--- a/spec/lib/gitlab/ci/trace_spec.rb
+++ b/spec/lib/gitlab/ci/trace_spec.rb
@@ -458,7 +458,7 @@ describe Gitlab::Ci::Trace do
context 'when job does not have trace artifact' do
context 'when trace file stored in default path' do
let!(:build) { create(:ci_build, :success, :trace_live) }
- let!(:src_path) { trace.read { |s| return s.path } }
+ let!(:src_path) { trace.read { |s| s.path } }
let!(:src_checksum) { Digest::SHA256.file(src_path).hexdigest }
it_behaves_like 'archive trace file'
diff --git a/spec/lib/gitlab/shell_spec.rb b/spec/lib/gitlab/shell_spec.rb
index 7ff2c0639ec..7f579df1c36 100644
--- a/spec/lib/gitlab/shell_spec.rb
+++ b/spec/lib/gitlab/shell_spec.rb
@@ -727,7 +727,7 @@ describe Gitlab::Shell do
def find_in_authorized_keys_file(key_id)
gitlab_shell.batch_read_key_ids do |ids|
- return true if ids.include?(key_id)
+ return true if ids.include?(key_id) # rubocop:disable Cop/AvoidReturnFromBlocks
end
false
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index a12717835b0..d7075d4a6b4 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -2140,10 +2140,6 @@ describe Ci::Build do
it "doesn't save timeout_source" do
expect { run_job_without_exception }.not_to change { job.reload.ensure_metadata.timeout_source }
end
-
- it 'raises an exception' do
- expect { job.run! }.to raise_error(StateMachines::InvalidTransition)
- end
end
end
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 959383ff0b7..4e6b037a720 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -450,6 +450,11 @@ eos
it "returns nil if the path doesn't exists" do
expect(commit.uri_type('this/path/doesnt/exist')).to be_nil
end
+
+ it 'is nil if the path is nil or empty' do
+ expect(commit.uri_type(nil)).to be_nil
+ expect(commit.uri_type("")).to be_nil
+ end
end
context 'when Gitaly commit_tree_entry feature is enabled' do
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb
index c536dab2681..2ed29052dc1 100644
--- a/spec/models/commit_status_spec.rb
+++ b/spec/models/commit_status_spec.rb
@@ -533,4 +533,36 @@ describe CommitStatus do
end
end
end
+
+ describe '#enqueue' do
+ let!(:current_time) { Time.new(2018, 4, 5, 14, 0, 0) }
+
+ before do
+ allow(Time).to receive(:now).and_return(current_time)
+ end
+
+ shared_examples 'commit status enqueued' do
+ it 'sets queued_at value when enqueued' do
+ expect { commit_status.enqueue }.to change { commit_status.reload.queued_at }.from(nil).to(current_time)
+ end
+ end
+
+ context 'when initial state is :created' do
+ let(:commit_status) { create(:commit_status, :created) }
+
+ it_behaves_like 'commit status enqueued'
+ end
+
+ context 'when initial state is :skipped' do
+ let(:commit_status) { create(:commit_status, :skipped) }
+
+ it_behaves_like 'commit status enqueued'
+ end
+
+ context 'when initial state is :manual' do
+ let(:commit_status) { create(:commit_status, :manual) }
+
+ it_behaves_like 'commit status enqueued'
+ end
+ end
end
diff --git a/spec/models/concerns/cache_markdown_field_spec.rb b/spec/models/concerns/cache_markdown_field_spec.rb
index 3c7f578975b..b3797c1fb46 100644
--- a/spec/models/concerns/cache_markdown_field_spec.rb
+++ b/spec/models/concerns/cache_markdown_field_spec.rb
@@ -72,7 +72,7 @@ describe CacheMarkdownField do
let(:updated_markdown) { '`Bar`' }
let(:updated_html) { '<p dir="auto"><code>Bar</code></p>' }
- let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: CacheMarkdownField::CACHE_VERSION) }
+ let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: CacheMarkdownField::CACHE_COMMONMARK_VERSION) }
describe '.attributes' do
it 'excludes cache attributes' do
@@ -89,17 +89,24 @@ describe CacheMarkdownField do
it { expect(thing.foo).to eq(markdown) }
it { expect(thing.foo_html).to eq(html) }
it { expect(thing.foo_html_changed?).not_to be_truthy }
- it { expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION) }
+ it { expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_COMMONMARK_VERSION) }
end
context 'a changed markdown field' do
- before do
- thing.foo = updated_markdown
- thing.save
+ shared_examples 'with cache version' do |cache_version|
+ let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: cache_version) }
+
+ before do
+ thing.foo = updated_markdown
+ thing.save
+ end
+
+ it { expect(thing.foo_html).to eq(updated_html) }
+ it { expect(thing.cached_markdown_version).to eq(cache_version) }
end
- it { expect(thing.foo_html).to eq(updated_html) }
- it { expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION) }
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_REDCARPET_VERSION
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_COMMONMARK_VERSION
end
context 'when a markdown field is set repeatedly to an empty string' do
@@ -123,15 +130,22 @@ describe CacheMarkdownField do
end
context 'a non-markdown field changed' do
- before do
- thing.bar = 'OK'
- thing.save
+ shared_examples 'with cache version' do |cache_version|
+ let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: cache_version) }
+
+ before do
+ thing.bar = 'OK'
+ thing.save
+ end
+
+ it { expect(thing.bar).to eq('OK') }
+ it { expect(thing.foo).to eq(markdown) }
+ it { expect(thing.foo_html).to eq(html) }
+ it { expect(thing.cached_markdown_version).to eq(cache_version) }
end
- it { expect(thing.bar).to eq('OK') }
- it { expect(thing.foo).to eq(markdown) }
- it { expect(thing.foo_html).to eq(html) }
- it { expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION) }
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_REDCARPET_VERSION
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_COMMONMARK_VERSION
end
context 'version is out of date' do
@@ -142,59 +156,85 @@ describe CacheMarkdownField do
end
it { expect(thing.foo_html).to eq(updated_html) }
- it { expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION) }
+ it { expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_REDCARPET_VERSION) }
end
describe '#cached_html_up_to_date?' do
- subject { thing.cached_html_up_to_date?(:foo) }
+ shared_examples 'with cache version' do |cache_version|
+ let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: cache_version) }
- it 'returns false when the version is absent' do
- thing.cached_markdown_version = nil
+ subject { thing.cached_html_up_to_date?(:foo) }
- is_expected.to be_falsy
- end
+ it 'returns false when the version is absent' do
+ thing.cached_markdown_version = nil
- it 'returns false when the version is too early' do
- thing.cached_markdown_version -= 1
+ is_expected.to be_falsy
+ end
- is_expected.to be_falsy
- end
+ it 'returns false when the version is too early' do
+ thing.cached_markdown_version -= 1
- it 'returns false when the version is too late' do
- thing.cached_markdown_version += 1
+ is_expected.to be_falsy
+ end
- is_expected.to be_falsy
- end
+ it 'returns false when the version is too late' do
+ thing.cached_markdown_version += 1
- it 'returns true when the version is just right' do
- thing.cached_markdown_version = CacheMarkdownField::CACHE_VERSION
+ is_expected.to be_falsy
+ end
- is_expected.to be_truthy
- end
+ it 'returns true when the version is just right' do
+ thing.cached_markdown_version = cache_version
- it 'returns false if markdown has been changed but html has not' do
- thing.foo = updated_html
+ is_expected.to be_truthy
+ end
- is_expected.to be_falsy
- end
+ it 'returns false if markdown has been changed but html has not' do
+ thing.foo = updated_html
- it 'returns true if markdown has not been changed but html has' do
- thing.foo_html = updated_html
+ is_expected.to be_falsy
+ end
+
+ it 'returns true if markdown has not been changed but html has' do
+ thing.foo_html = updated_html
- is_expected.to be_truthy
+ is_expected.to be_truthy
+ end
+
+ it 'returns true if markdown and html have both been changed' do
+ thing.foo = updated_markdown
+ thing.foo_html = updated_html
+
+ is_expected.to be_truthy
+ end
+
+ it 'returns false if the markdown field is set but the html is not' do
+ thing.foo_html = nil
+
+ is_expected.to be_falsy
+ end
end
- it 'returns true if markdown and html have both been changed' do
- thing.foo = updated_markdown
- thing.foo_html = updated_html
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_REDCARPET_VERSION
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_COMMONMARK_VERSION
+ end
+
+ describe '#latest_cached_markdown_version' do
+ subject { thing.latest_cached_markdown_version }
- is_expected.to be_truthy
+ it 'returns redcarpet version' do
+ thing.cached_markdown_version = CacheMarkdownField::CACHE_COMMONMARK_VERSION_START - 1
+ is_expected.to eq(CacheMarkdownField::CACHE_REDCARPET_VERSION)
end
- it 'returns false if the markdown field is set but the html is not' do
- thing.foo_html = nil
+ it 'returns commonmark version' do
+ thing.cached_markdown_version = CacheMarkdownField::CACHE_COMMONMARK_VERSION_START + 1
+ is_expected.to eq(CacheMarkdownField::CACHE_COMMONMARK_VERSION)
+ end
- is_expected.to be_falsy
+ it 'returns default version when version is nil' do
+ thing.cached_markdown_version = nil
+ is_expected.to eq(CacheMarkdownField::CACHE_REDCARPET_VERSION)
end
end
@@ -221,37 +261,44 @@ describe CacheMarkdownField do
thing.cached_markdown_version = nil
thing.refresh_markdown_cache
- expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION)
+ expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_REDCARPET_VERSION)
end
end
describe '#refresh_markdown_cache!' do
- before do
- thing.foo = updated_markdown
- end
+ shared_examples 'with cache version' do |cache_version|
+ let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: cache_version) }
- it 'fills all html fields' do
- thing.refresh_markdown_cache!
+ before do
+ thing.foo = updated_markdown
+ end
- expect(thing.foo_html).to eq(updated_html)
- expect(thing.foo_html_changed?).to be_truthy
- expect(thing.baz_html_changed?).to be_truthy
- end
+ it 'fills all html fields' do
+ thing.refresh_markdown_cache!
- it 'skips saving if not persisted' do
- expect(thing).to receive(:persisted?).and_return(false)
- expect(thing).not_to receive(:update_columns)
+ expect(thing.foo_html).to eq(updated_html)
+ expect(thing.foo_html_changed?).to be_truthy
+ expect(thing.baz_html_changed?).to be_truthy
+ end
- thing.refresh_markdown_cache!
- end
+ it 'skips saving if not persisted' do
+ expect(thing).to receive(:persisted?).and_return(false)
+ expect(thing).not_to receive(:update_columns)
- it 'saves the changes using #update_columns' do
- expect(thing).to receive(:persisted?).and_return(true)
- expect(thing).to receive(:update_columns)
- .with("foo_html" => updated_html, "baz_html" => "", "cached_markdown_version" => CacheMarkdownField::CACHE_VERSION)
+ thing.refresh_markdown_cache!
+ end
- thing.refresh_markdown_cache!
+ it 'saves the changes using #update_columns' do
+ expect(thing).to receive(:persisted?).and_return(true)
+ expect(thing).to receive(:update_columns)
+ .with("foo_html" => updated_html, "baz_html" => "", "cached_markdown_version" => cache_version)
+
+ thing.refresh_markdown_cache!
+ end
end
+
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_REDCARPET_VERSION
+ it_behaves_like 'with cache version', CacheMarkdownField::CACHE_COMMONMARK_VERSION
end
describe '#banzai_render_context' do
@@ -299,7 +346,7 @@ describe CacheMarkdownField do
expect(thing.foo_html).to eq(updated_html)
expect(thing.baz_html).to eq(updated_html)
- expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION)
+ expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_REDCARPET_VERSION)
end
end
@@ -319,7 +366,7 @@ describe CacheMarkdownField do
expect(thing.foo_html).to eq(updated_html)
expect(thing.baz_html).to eq(updated_html)
- expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_VERSION)
+ expect(thing.cached_markdown_version).to eq(CacheMarkdownField::CACHE_REDCARPET_VERSION)
end
end
end
diff --git a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
new file mode 100644
index 00000000000..ac7b1575ec0
--- /dev/null
+++ b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
@@ -0,0 +1,74 @@
+require 'spec_helper'
+require 'rubocop'
+require 'rubocop/rspec/support'
+require_relative '../../../rubocop/cop/avoid_break_from_strong_memoize'
+
+describe RuboCop::Cop::AvoidBreakFromStrongMemoize do
+ include CopHelper
+
+ subject(:cop) { described_class.new }
+
+ it 'flags violation for break inside strong_memoize' do
+ expect_offense(<<~RUBY)
+ strong_memoize(:result) do
+ break if something
+ ^^^^^ Do not use break inside strong_memoize, use next instead.
+
+ do_an_heavy_calculation
+ end
+ RUBY
+ end
+
+ it 'flags violation for break inside strong_memoize nested blocks' do
+ expect_offense(<<~RUBY)
+ strong_memoize do
+ items.each do |item|
+ break item
+ ^^^^^^^^^^ Do not use break inside strong_memoize, use next instead.
+ end
+ end
+ RUBY
+ end
+
+ it "doesn't flag violation for next inside strong_memoize" do
+ expect_no_offenses(<<~RUBY)
+ strong_memoize(:result) do
+ next if something
+
+ do_an_heavy_calculation
+ end
+ RUBY
+ end
+
+ it "doesn't flag violation for break inside blocks" do
+ expect_no_offenses(<<~RUBY)
+ call do
+ break if something
+
+ do_an_heavy_calculation
+ end
+ RUBY
+ end
+
+ it "doesn't call add_offense twice for nested blocks" do
+ source = <<~RUBY
+ call do
+ strong_memoize(:result) do
+ break if something
+
+ do_an_heavy_calculation
+ end
+ end
+ RUBY
+ expect_any_instance_of(described_class).to receive(:add_offense).once
+
+ inspect_source(source)
+ end
+
+ it "doesn't check when block is empty" do
+ expect_no_offenses(<<~RUBY)
+ strong_memoize(:result) do
+ end
+ RUBY
+ end
+end
diff --git a/spec/rubocop/cop/avoid_return_from_blocks_spec.rb b/spec/rubocop/cop/avoid_return_from_blocks_spec.rb
new file mode 100644
index 00000000000..a5c280a7adc
--- /dev/null
+++ b/spec/rubocop/cop/avoid_return_from_blocks_spec.rb
@@ -0,0 +1,127 @@
+require 'spec_helper'
+require 'rubocop'
+require 'rubocop/rspec/support'
+require_relative '../../../rubocop/cop/avoid_return_from_blocks'
+
+describe RuboCop::Cop::AvoidReturnFromBlocks do
+ include CopHelper
+
+ subject(:cop) { described_class.new }
+
+ it 'flags violation for return inside a block' do
+ expect_offense(<<~RUBY)
+ call do
+ do_something
+ return if something_else
+ ^^^^^^ Do not return from a block, use next or break instead.
+ end
+ RUBY
+ end
+
+ it "doesn't call add_offense twice for nested blocks" do
+ source = <<~RUBY
+ call do
+ call do
+ something
+ return if something_else
+ end
+ end
+ RUBY
+ expect_any_instance_of(described_class).to receive(:add_offense).once
+
+ inspect_source(source)
+ end
+
+ it 'flags violation for return inside included > def > block' do
+ expect_offense(<<~RUBY)
+ included do
+ def a_method
+ return if something
+
+ call do
+ return if something_else
+ ^^^^^^ Do not return from a block, use next or break instead.
+ end
+ end
+ end
+ RUBY
+ end
+
+ shared_examples 'examples with whitelisted method' do |whitelisted_method|
+ it "doesn't flag violation for return inside #{whitelisted_method}" do
+ expect_no_offenses(<<~RUBY)
+ items.#{whitelisted_method} do |item|
+ do_something
+ return if something_else
+ end
+ RUBY
+ end
+ end
+
+ %i[each each_filename times loop].each do |whitelisted_method|
+ it_behaves_like 'examples with whitelisted method', whitelisted_method
+ end
+
+ shared_examples 'examples with def methods' do |def_method|
+ it "doesn't flag violation for return inside #{def_method}" do
+ expect_no_offenses(<<~RUBY)
+ helpers do
+ #{def_method} do
+ return if something
+
+ do_something_more
+ end
+ end
+ RUBY
+ end
+ end
+
+ %i[define_method lambda].each do |def_method|
+ it_behaves_like 'examples with def methods', def_method
+ end
+
+ it "doesn't flag violation for return inside a lambda" do
+ expect_no_offenses(<<~RUBY)
+ lambda do
+ do_something
+ return if something_else
+ end
+ RUBY
+ end
+
+ it "doesn't flag violation for return used inside a method definition" do
+ expect_no_offenses(<<~RUBY)
+ describe Klass do
+ def a_method
+ do_something
+ return if something_else
+ end
+ end
+ RUBY
+ end
+
+ it "doesn't flag violation for next inside a block" do
+ expect_no_offenses(<<~RUBY)
+ call do
+ do_something
+ next if something_else
+ end
+ RUBY
+ end
+
+ it "doesn't flag violation for break inside a block" do
+ expect_no_offenses(<<~RUBY)
+ call do
+ do_something
+ break if something_else
+ end
+ RUBY
+ end
+
+ it "doesn't check when block is empty" do
+ expect_no_offenses(<<~RUBY)
+ call do
+ end
+ RUBY
+ end
+end
diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb
index 97a563c1ce1..8a537e83d5f 100644
--- a/spec/services/ci/register_job_service_spec.rb
+++ b/spec/services/ci/register_job_service_spec.rb
@@ -370,10 +370,111 @@ module Ci
it_behaves_like 'validation is not active'
end
end
+ end
+
+ describe '#register_success' do
+ let!(:current_time) { Time.new(2018, 4, 5, 14, 0, 0) }
+ let!(:attempt_counter) { double('Gitlab::Metrics::NullMetric') }
+ let!(:job_queue_duration_seconds) { double('Gitlab::Metrics::NullMetric') }
+
+ before do
+ allow(Time).to receive(:now).and_return(current_time)
+
+ # Stub defaults for any metrics other than the ones we're testing
+ allow(Gitlab::Metrics).to receive(:counter)
+ .with(any_args)
+ .and_return(Gitlab::Metrics::NullMetric.instance)
+ allow(Gitlab::Metrics).to receive(:histogram)
+ .with(any_args)
+ .and_return(Gitlab::Metrics::NullMetric.instance)
+
+ # Stub tested metrics
+ allow(Gitlab::Metrics).to receive(:counter)
+ .with(:job_register_attempts_total, anything)
+ .and_return(attempt_counter)
+ allow(Gitlab::Metrics).to receive(:histogram)
+ .with(:job_queue_duration_seconds, anything, anything, anything)
+ .and_return(job_queue_duration_seconds)
+
+ project.update(shared_runners_enabled: true)
+ pending_job.update(created_at: current_time - 3600, queued_at: current_time - 1800)
+ end
+
+ shared_examples 'attempt counter collector' do
+ it 'increments attempt counter' do
+ allow(job_queue_duration_seconds).to receive(:observe)
+ expect(attempt_counter).to receive(:increment)
+
+ execute(runner)
+ end
+ end
+
+ shared_examples 'jobs queueing time histogram collector' do
+ it 'counts job queuing time histogram with expected labels' do
+ allow(attempt_counter).to receive(:increment)
+ expect(job_queue_duration_seconds).to receive(:observe)
+ .with({ shared_runner: expected_shared_runner,
+ jobs_running_for_project: expected_jobs_running_for_project_first_job }, 1800)
+
+ execute(runner)
+ end
+
+ context 'when project already has running jobs' do
+ let!(:build2) { create( :ci_build, :running, pipeline: pipeline, runner: shared_runner) }
+ let!(:build3) { create( :ci_build, :running, pipeline: pipeline, runner: shared_runner) }
+
+ it 'counts job queuing time histogram with expected labels' do
+ allow(attempt_counter).to receive(:increment)
+ expect(job_queue_duration_seconds).to receive(:observe)
+ .with({ shared_runner: expected_shared_runner,
+ jobs_running_for_project: expected_jobs_running_for_project_third_job }, 1800)
+
+ execute(runner)
+ end
+ end
+ end
- def execute(runner)
- described_class.new(runner).execute.build
+ shared_examples 'metrics collector' do
+ it_behaves_like 'attempt counter collector'
+ it_behaves_like 'jobs queueing time histogram collector'
end
+
+ context 'when shared runner is used' do
+ let(:runner) { shared_runner }
+ let(:expected_shared_runner) { true }
+ let(:expected_jobs_running_for_project_first_job) { 0 }
+ let(:expected_jobs_running_for_project_third_job) { 2 }
+
+ it_behaves_like 'metrics collector'
+
+ context 'when pending job with queued_at=nil is used' do
+ before do
+ pending_job.update(queued_at: nil)
+ end
+
+ it_behaves_like 'attempt counter collector'
+
+ it "doesn't count job queuing time histogram" do
+ allow(attempt_counter).to receive(:increment)
+ expect(job_queue_duration_seconds).not_to receive(:observe)
+
+ execute(runner)
+ end
+ end
+ end
+
+ context 'when specific runner is used' do
+ let(:runner) { specific_runner }
+ let(:expected_shared_runner) { false }
+ let(:expected_jobs_running_for_project_first_job) { '+Inf' }
+ let(:expected_jobs_running_for_project_third_job) { '+Inf' }
+
+ it_behaves_like 'metrics collector'
+ end
+ end
+
+ def execute(runner)
+ described_class.new(runner).execute.build
end
end
end
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index f8fa2540804..55bbe954491 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -933,6 +933,46 @@ describe NotificationService, :mailer do
let(:notification_trigger) { notification.issue_moved(issue, new_issue, @u_disabled) }
end
end
+
+ describe '#issue_due' do
+ before do
+ issue.update!(due_date: Date.today)
+
+ update_custom_notification(:issue_due, @u_guest_custom, resource: project)
+ update_custom_notification(:issue_due, @u_custom_global)
+ end
+
+ it 'sends email to issue notification recipients, excluding watchers' do
+ notification.issue_due(issue)
+
+ should_email(issue.assignees.first)
+ should_email(issue.author)
+ should_email(@u_guest_custom)
+ should_email(@u_custom_global)
+ should_email(@u_participant_mentioned)
+ should_email(@subscriber)
+ should_email(@watcher_and_subscriber)
+ should_not_email(@u_watcher)
+ should_not_email(@u_guest_watcher)
+ should_not_email(@unsubscriber)
+ should_not_email(@u_participating)
+ should_not_email(@u_disabled)
+ should_not_email(@u_lazy_participant)
+ end
+
+ it 'sends the email from the author' do
+ notification.issue_due(issue)
+ email = find_email_for(@subscriber)
+
+ expect(email.header[:from].display_names).to eq([issue.author.name])
+ end
+
+ it_behaves_like 'participating notifications' do
+ let(:participant) { create(:user, username: 'user-participant') }
+ let(:issuable) { issue }
+ let(:notification_trigger) { notification.issue_due(issue) }
+ end
+ end
end
describe 'Merge Requests' do
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index e28b0ea5cf2..893804f1470 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -909,7 +909,13 @@ describe SystemNoteService do
it 'sets the note text' do
noteable.update_attribute(:time_estimate, 277200)
- expect(subject.note).to eq "changed time estimate to 1w 4d 5h"
+ expect(subject.note).to eq "changed time estimate to 1w 4d 5h,"
+ end
+
+ it 'appends a comma to separate the note from the update_at time' do
+ noteable.update_attribute(:time_estimate, 277200)
+
+ expect(subject.note).to end_with(',')
end
end
diff --git a/spec/support/http_io/http_io_helpers.rb b/spec/support/http_io/http_io_helpers.rb
index 31e07e720cd..2c68c2cd9a6 100644
--- a/spec/support/http_io/http_io_helpers.rb
+++ b/spec/support/http_io/http_io_helpers.rb
@@ -44,10 +44,11 @@ module HttpIOHelpers
def remote_trace_body
@remote_trace_body ||= File.read(expand_fixture_path('trace/sample_trace'))
+ .force_encoding(Encoding::BINARY)
end
def remote_trace_size
- remote_trace_body.length
+ remote_trace_body.bytesize
end
def set_smaller_buffer_size_than(file_size)
diff --git a/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb b/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb
index 934d53e7bba..93c21a99e59 100644
--- a/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb
+++ b/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb
@@ -4,7 +4,7 @@ shared_examples "matches the method pattern" do |method|
let(:pattern) { patterns[method] }
it do
- return skip "No pattern provided, skipping." unless pattern
+ skip "No pattern provided, skipping." unless pattern
expect(target.method(method).call(*args)).to match(pattern)
end
diff --git a/spec/workers/issue_due_scheduler_worker_spec.rb b/spec/workers/issue_due_scheduler_worker_spec.rb
new file mode 100644
index 00000000000..7b60835fd26
--- /dev/null
+++ b/spec/workers/issue_due_scheduler_worker_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe IssueDueSchedulerWorker do
+ describe '#perform' do
+ it 'schedules one MailScheduler::IssueDueWorker per project with open issues due tomorrow' do
+ project1 = create(:project)
+ project2 = create(:project)
+ project_closed_issue = create(:project)
+ project_issue_due_another_day = create(:project)
+
+ create(:issue, :opened, project: project1, due_date: Date.tomorrow)
+ create(:issue, :opened, project: project1, due_date: Date.tomorrow)
+ create(:issue, :opened, project: project2, due_date: Date.tomorrow)
+ create(:issue, :closed, project: project_closed_issue, due_date: Date.tomorrow)
+ create(:issue, :opened, project: project_issue_due_another_day, due_date: Date.today)
+
+ expect(MailScheduler::IssueDueWorker).to receive(:bulk_perform_async).with([[project1.id], [project2.id]])
+
+ described_class.new.perform
+ end
+ end
+end
diff --git a/spec/workers/mail_scheduler/issue_due_worker_spec.rb b/spec/workers/mail_scheduler/issue_due_worker_spec.rb
new file mode 100644
index 00000000000..48ac1b8a1a4
--- /dev/null
+++ b/spec/workers/mail_scheduler/issue_due_worker_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe MailScheduler::IssueDueWorker do
+ describe '#perform' do
+ let(:worker) { described_class.new }
+ let(:project) { create(:project) }
+
+ it 'sends emails for open issues due tomorrow in the project specified' do
+ issue1 = create(:issue, :opened, project: project, due_date: Date.tomorrow)
+ issue2 = create(:issue, :opened, project: project, due_date: Date.tomorrow)
+ create(:issue, :closed, project: project, due_date: Date.tomorrow) # closed
+ create(:issue, :opened, project: project, due_date: 2.days.from_now) # due on another day
+ create(:issue, :opened, due_date: Date.tomorrow) # different project
+
+ expect_any_instance_of(NotificationService).to receive(:issue_due).with(issue1)
+ expect_any_instance_of(NotificationService).to receive(:issue_due).with(issue2)
+
+ worker.perform(project.id)
+ end
+ end
+end