Commit 3f803928 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'caalberts-use-crystalball-with-knapsack' into 'master'

Use test detection based on crystalball mapping in rspec jobs

See merge request gitlab-org/gitlab!48655
parents ddfe65bb 5f2e5d2c
<svg width="234" height="162" viewBox="0 0 234 162" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M174.68 56.344H200.5C215.412 56.344 227.5 44.1787 227.5 29.172C227.5 14.1653 215.412 2 200.5 2C185.588 2 173.5 14.1653 173.5 29.172C173.5 36.2548 176.193 42.7046 180.604 47.5412" stroke="#C2B7E6" stroke-width="4" stroke-linecap="round"/>
<path d="M145.5 76.4714C145.5 65.3553 154.454 56.344 165.5 56.344" stroke="#C2B7E6" stroke-width="4" stroke-linecap="round"/>
<path d="M102.5 121.758H29.5C14.5883 121.758 2.5 109.593 2.5 94.586C2.5 79.5794 14.5883 67.4141 29.5 67.4141C44.4117 67.4141 56.5 79.5794 56.5 94.586C56.5 101.669 53.8072 108.119 49.3957 112.955" stroke="#C2B7E6" stroke-width="4" stroke-linecap="round"/>
<path d="M67.0466 121.758H52.5C42.5589 121.758 34.5 129.868 34.5 139.873C34.5 149.877 42.5589 157.987 52.5 157.987C62.4411 157.987 70.5 149.877 70.5 139.873C70.5 137.478 70.0384 135.192 69.1998 133.1" stroke="#C2B7E6" stroke-width="4" stroke-linecap="round"/>
<g clip-path="url(#clip0)">
<path d="M55.0188 135.3C55.1617 134.764 54.8451 134.211 54.3117 134.068C53.7782 133.925 53.2298 134.243 53.0869 134.78L49.9811 146.445C49.8381 146.981 50.1547 147.534 50.6882 147.677C51.2217 147.821 51.77 147.503 51.9129 146.965L55.0188 135.3Z" fill="#FC6D26"/>
<path d="M49.2071 137.142C49.5976 137.534 49.5976 138.172 49.2071 138.565L46.9142 140.873L49.2071 143.18C49.5976 143.573 49.5976 144.211 49.2071 144.603C48.8166 144.997 48.1834 144.997 47.7929 144.603L44.7929 141.584C44.4024 141.192 44.4024 140.554 44.7929 140.161L47.7929 137.142C48.1834 136.748 48.8166 136.748 49.2071 137.142Z" fill="#FC6D26"/>
<path d="M55.7929 137.142C55.4024 137.534 55.4024 138.172 55.7929 138.565L58.0858 140.873L55.7929 143.18C55.4024 143.573 55.4024 144.211 55.7929 144.603C56.1834 144.997 56.8166 144.997 57.2071 144.603L60.2071 141.584C60.5976 141.192 60.5976 140.554 60.2071 140.161L57.2071 137.142C56.8166 136.748 56.1834 136.748 55.7929 137.142Z" fill="#FC6D26"/>
</g>
<path d="M212.102 160C222.815 160 231.5 151.214 231.5 140.376C231.5 129.537 222.815 120.752 212.102 120.752H151.5" stroke="#C2B7E6" stroke-width="4" stroke-linecap="round"/>
<path d="M126.5 138.866C107.171 138.866 91.5 123.096 91.5 103.643C91.5 84.191 107.171 68.4204 126.5 68.4204C145.829 68.4204 161.5 84.191 161.5 103.643C161.5 123.096 145.829 138.866 126.5 138.866ZM126.5 131.451C141.76 131.451 154.132 119.001 154.132 103.643C154.132 88.2861 141.76 75.8358 126.5 75.8358C111.24 75.8358 98.8684 88.2861 98.8684 103.643C98.8684 119.001 111.24 131.451 126.5 131.451Z" fill="#FC6D26"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M126.126 87.1326C135.355 87.1326 142.906 94.5624 142.906 103.643C142.906 112.724 135.355 120.154 126.126 120.154C120.672 120.154 115.638 117.265 112.281 113.137L126.126 103.643V87.1326Z" fill="#6E49CB"/>
<g clip-path="url(#clip1)">
<path d="M29.5 90.2659L24.3571 91.9534V93.1629C24.3571 94.9623 25.087 96.6872 26.3846 97.9546L29.5 100.997V90.2659Z" fill="#FC6D26"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 86.8909L29.5 83.5159L41.5 86.8909V93.1115C41.5 96.6919 40.0551 100.126 37.4832 102.657L29.5 110.516L21.5168 102.657C18.9449 100.126 17.5 96.6919 17.5 93.1115V86.8909ZM20.9286 93.1115V89.4366L29.5 87.0259L38.0714 89.4366V93.1115C38.0714 95.7968 36.9878 98.3721 35.0588 100.271L29.5 105.743L23.9412 100.271C22.0122 98.3721 20.9286 95.7968 20.9286 93.1115Z" fill="#FC6D26"/>
</g>
<g clip-path="url(#clip2)">
<path d="M210.857 19.7297L209.51 24.8237C208.922 27.0445 207.518 28.9576 205.581 30.1752L194.728 36.999L191.862 34.1146L198.642 23.1922C199.852 21.2431 201.753 19.8298 203.96 19.2386L209.022 17.8826C209.822 17.6681 210.644 18.1474 210.857 18.953C210.925 19.2075 210.925 19.4752 210.857 19.7297ZM207.292 21.4702L204.732 22.1561C203.261 22.5503 201.993 23.4925 201.187 24.7918L196.517 32.3146L203.992 27.6148C205.283 26.803 206.219 25.5276 206.611 24.0471L207.292 21.4702ZM196.5 38.2294L204 33.7007V35.2103C204 38.5451 201.314 41.2485 198 41.2485H196.5V38.2294ZM190.5 32.1912H187.5V30.6816C187.5 27.3468 190.186 24.6434 193.5 24.6434H195L190.5 32.1912Z" fill="#FC6D26"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M209.914 132.822C209.384 132.822 208.875 133.032 208.5 133.407L204.796 137.111C204.613 137.293 204.5 137.544 204.5 137.822V144.822C204.5 145.926 205.395 146.822 206.5 146.822H216.5C217.605 146.822 218.5 145.926 218.5 144.822V137.822C218.5 137.546 218.388 137.296 218.207 137.115L214.5 133.407C214.125 133.032 213.616 132.822 213.086 132.822H209.914ZM215.086 136.822L213.086 134.822H212.5V136.822H215.086ZM210.5 134.822H209.914L207.914 136.822H210.5V134.822ZM206.5 138.822H216.5V144.822H206.5V138.822Z" fill="#FC6D26"/>
<defs>
<clipPath id="clip0">
<rect width="16" height="13.6779" fill="white" transform="translate(44.5 134.033)"/>
</clipPath>
<clipPath id="clip1">
<rect width="24" height="27.172" fill="white" transform="translate(17.5 83.5159)"/>
</clipPath>
<clipPath id="clip2">
<rect width="24" height="24.1529" fill="white" transform="translate(187.5 17.0956)"/>
</clipPath>
</defs>
</svg>
<script> <script>
import { createNamespacedHelpers, mapState, mapActions, mapGetters } from 'vuex'; import { createNamespacedHelpers, mapState, mapActions, mapGetters } from 'vuex';
import { GlFormGroup, GlFormInput, GlFormCheckbox, GlIcon, GlLink, GlSprintf } from '@gitlab/ui'; import {
GlFormGroup,
GlFormInput,
GlFormCheckbox,
GlIcon,
GlLink,
GlSprintf,
GlButton,
} from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import ClusterFormDropdown from '~/create_cluster/components/cluster_form_dropdown.vue'; import ClusterFormDropdown from '~/create_cluster/components/cluster_form_dropdown.vue';
import { KUBERNETES_VERSIONS } from '../constants'; import { KUBERNETES_VERSIONS } from '../constants';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
const { mapState: mapRolesState, mapActions: mapRolesActions } = createNamespacedHelpers('roles'); const { mapState: mapRolesState, mapActions: mapRolesActions } = createNamespacedHelpers('roles');
const { mapState: mapKeyPairsState, mapActions: mapKeyPairsActions } = createNamespacedHelpers( const { mapState: mapKeyPairsState, mapActions: mapKeyPairsActions } = createNamespacedHelpers(
...@@ -29,7 +36,7 @@ export default { ...@@ -29,7 +36,7 @@ export default {
GlIcon, GlIcon,
GlLink, GlLink,
GlSprintf, GlSprintf,
LoadingButton, GlButton,
}, },
props: { props: {
gitlabManagedClusterHelpPath: { gitlabManagedClusterHelpPath: {
...@@ -508,13 +515,16 @@ export default { ...@@ -508,13 +515,16 @@ export default {
</p> </p>
</div> </div>
<div class="form-group"> <div class="form-group">
<loading-button <gl-button
class="js-create-cluster btn-success" variant="success"
category="primary"
class="js-create-cluster"
:disabled="createClusterButtonDisabled" :disabled="createClusterButtonDisabled"
:loading="isCreatingCluster" :loading="isCreatingCluster"
:label="createClusterButtonLabel"
@click="createCluster()" @click="createCluster()"
/> >
{{ createClusterButtonLabel }}
</gl-button>
</div> </div>
</form> </form>
</template> </template>
...@@ -10,19 +10,20 @@ const initJiraFormHandlers = () => { ...@@ -10,19 +10,20 @@ const initJiraFormHandlers = () => {
AP.navigator.reload(); AP.navigator.reload();
}; };
const reqFailed = res => { const reqFailed = (res, fallbackErrorMessage) => {
const { responseJSON: { error } = {} } = res || {};
// eslint-disable-next-line no-alert // eslint-disable-next-line no-alert
alert(res.responseJSON.error); alert(error || fallbackErrorMessage);
}; };
AP.getLocation(location => { AP.getLocation(location => {
$('.js-jira-connect-sign-in').each(() => { $('.js-jira-connect-sign-in').each(function updateSignInLink() {
const updatedLink = `${$(this).attr('href')}?return_to=${location}`; const updatedLink = `${$(this).attr('href')}?return_to=${location}`;
$(this).attr('href', updatedLink); $(this).attr('href', updatedLink);
}); });
}); });
$('#add-subscription-form').on('submit', e => { $('#add-subscription-form').on('submit', function onAddSubscriptionForm(e) {
const actionUrl = $(this).attr('action'); const actionUrl = $(this).attr('action');
e.preventDefault(); e.preventDefault();
...@@ -34,11 +35,11 @@ const initJiraFormHandlers = () => { ...@@ -34,11 +35,11 @@ const initJiraFormHandlers = () => {
format: 'json', format: 'json',
}) })
.done(reqComplete) .done(reqComplete)
.fail(reqFailed); .fail(err => reqFailed(err, 'Failed to add namespace. Please try again.'));
}); });
}); });
$('.remove-subscription').on('click', e => { $('.remove-subscription').on('click', function onRemoveSubscriptionClick(e) {
const href = $(this).attr('href'); const href = $(this).attr('href');
e.preventDefault(); e.preventDefault();
...@@ -53,7 +54,7 @@ const initJiraFormHandlers = () => { ...@@ -53,7 +54,7 @@ const initJiraFormHandlers = () => {
}, },
}) })
.done(reqComplete) .done(reqComplete)
.fail(reqFailed); .fail(err => reqFailed(err, 'Failed to remove namespace. Please try again.'));
}); });
}); });
}; };
......
...@@ -85,6 +85,7 @@ export default { ...@@ -85,6 +85,7 @@ export default {
v-model="filter" v-model="filter"
:placeholder="$options.i18n.searchPlaceholder" :placeholder="$options.i18n.searchPlaceholder"
class="gl-align-self-center gl-ml-auto fork-filtered-search" class="gl-align-self-center gl-ml-auto fork-filtered-search"
data-qa-selector="fork_groups_list_search_field"
/> />
</template> </template>
</gl-tabs> </gl-tabs>
......
import Vue from 'vue'; import Vue from 'vue';
import GlCountdown from '~/vue_shared/components/gl_countdown.vue'; import GlCountdown from '~/vue_shared/components/gl_countdown.vue';
import Tracking from '~/tracking';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const remainingTimeElements = document.querySelectorAll('.js-remaining-time'); const remainingTimeElements = document.querySelectorAll('.js-remaining-time');
...@@ -13,4 +14,13 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -13,4 +14,13 @@ document.addEventListener('DOMContentLoaded', () => {
}, },
}), }),
); );
const trackButtonClick = () => {
if (gon.tracking_data) {
const { category, action, ...data } = gon.tracking_data;
Tracking.event(category, action, data);
}
};
const buttons = document.querySelectorAll('.js-empty-state-button');
buttons.forEach(button => button.addEventListener('click', trackButtonClick));
}); });
<script> <script>
import { GlIcon } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
export default { export default {
components: {
GlIcon,
},
props: { props: {
user: { user: {
type: Object, type: Object,
...@@ -46,6 +50,6 @@ export default { ...@@ -46,6 +50,6 @@ export default {
class="avatar avatar-inline m-0" class="avatar avatar-inline m-0"
data-qa-selector="avatar_image" data-qa-selector="avatar_image"
/> />
<i v-if="hasMergeIcon" aria-hidden="true" class="fa fa-exclamation-triangle merge-icon"></i> <gl-icon v-if="hasMergeIcon" name="warning-solid" aria-hidden="true" class="merge-icon" />
</span> </span>
</template> </template>
...@@ -112,11 +112,12 @@ export default { ...@@ -112,11 +112,12 @@ export default {
/> />
<button v-if="hasMoreThanTwoAssignees" class="btn-link" type="button"> <button v-if="hasMoreThanTwoAssignees" class="btn-link" type="button">
<span class="avatar-counter sidebar-avatar-counter"> {{ sidebarAvatarCounter }} </span> <span class="avatar-counter sidebar-avatar-counter"> {{ sidebarAvatarCounter }} </span>
<i <gl-icon
v-if="isMergeRequest && !allAssigneesCanMerge" v-if="isMergeRequest && !allAssigneesCanMerge"
name="warning-solid"
aria-hidden="true" aria-hidden="true"
class="fa fa-exclamation-triangle merge-icon" class="merge-icon"
></i> />
</button> </button>
</div> </div>
</template> </template>
...@@ -97,11 +97,12 @@ export default { ...@@ -97,11 +97,12 @@ export default {
<collapsed-reviewer v-for="user in collapsedUsers" :key="user.id" :user="user" /> <collapsed-reviewer v-for="user in collapsedUsers" :key="user.id" :user="user" />
<button v-if="hasMoreThanTwoReviewers" class="btn-link" type="button"> <button v-if="hasMoreThanTwoReviewers" class="btn-link" type="button">
<span class="avatar-counter sidebar-avatar-counter"> {{ sidebarAvatarCounter }} </span> <span class="avatar-counter sidebar-avatar-counter"> {{ sidebarAvatarCounter }} </span>
<i <gl-icon
v-if="!allReviewersCanMerge" v-if="!allReviewersCanMerge"
name="warning-solid"
aria-hidden="true" aria-hidden="true"
class="fa fa-exclamation-triangle merge-icon" class="merge-icon"
></i> />
</button> </button>
</div> </div>
</template> </template>
<script> <script>
// NOTE! For the first iteration, we are simply copying the implementation of Assignees // NOTE! For the first iteration, we are simply copying the implementation of Assignees
// It will soon be overhauled in Issue https://gitlab.com/gitlab-org/gitlab/-/issues/233736 // It will soon be overhauled in Issue https://gitlab.com/gitlab-org/gitlab/-/issues/233736
import { GlIcon } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
export default { export default {
components: {
GlIcon,
},
props: { props: {
user: { user: {
type: Object, type: Object,
...@@ -38,6 +42,6 @@ export default { ...@@ -38,6 +42,6 @@ export default {
class="avatar avatar-inline m-0" class="avatar avatar-inline m-0"
data-qa-selector="avatar_image" data-qa-selector="avatar_image"
/> />
<i v-if="hasMergeIcon" aria-hidden="true" class="fa fa-exclamation-triangle merge-icon"></i> <gl-icon v-if="hasMergeIcon" name="warning-solid" aria-hidden="true" class="merge-icon" />
</span> </span>
</template> </template>
...@@ -796,7 +796,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) { ...@@ -796,7 +796,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) {
const mergeIcon = const mergeIcon =
issuableType === 'merge_request' && !user.can_merge issuableType === 'merge_request' && !user.can_merge
? `${spriteIcon('warning-solid', 's12 merge-icon')}` ? spriteIcon('warning-solid', 's12 merge-icon')
: ''; : '';
return `<span class="position-relative mr-2"> return `<span class="position-relative mr-2">
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 0; right: 0;
text-shadow: -1px -1px 2px $white, 1px -1px 2px $white, -1px 1px 2px $white, 1px 1px 2px $white; filter: drop-shadow(0 0 0.5px $white) drop-shadow(0 0 1px $white) drop-shadow(0 0 2px $white);
} }
} }
...@@ -392,6 +392,13 @@ ...@@ -392,6 +392,13 @@
text-align: center; text-align: center;
} }
.merge-icon {
height: 12px;
width: 12px;
bottom: -5px;
right: 4px;
}
.sidebar-collapsed-icon { .sidebar-collapsed-icon {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -402,7 +409,7 @@ ...@@ -402,7 +409,7 @@
text-align: center; text-align: center;
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
svg { > svg {
fill: $gl-text-color-secondary; fill: $gl-text-color-secondary;
} }
...@@ -410,7 +417,7 @@ ...@@ -410,7 +417,7 @@
&:hover .todo-undone { &:hover .todo-undone {
color: $gl-text-color; color: $gl-text-color;
svg { > svg {
fill: $gl-text-color; fill: $gl-text-color;
} }
} }
...@@ -482,10 +489,6 @@ ...@@ -482,10 +489,6 @@
display: none; display: none;
} }
.merge-icon {
font-size: 10px;
}
.multiple-users { .multiple-users {
position: relative; position: relative;
height: 24px; height: 24px;
......
...@@ -287,10 +287,6 @@ $mr-widget-min-height: 69px; ...@@ -287,10 +287,6 @@ $mr-widget-min-height: 69px;
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
&.has-conflicts .fa-exclamation-triangle {
color: $orange-500;
}
time { time {
font-weight: $gl-font-weight-normal; font-weight: $gl-font-weight-normal;
} }
......
...@@ -17,6 +17,9 @@ class Projects::JobsController < Projects::ApplicationController ...@@ -17,6 +17,9 @@ class Projects::JobsController < Projects::ApplicationController
before_action do before_action do
push_frontend_feature_flag(:ci_job_line_links, @project) push_frontend_feature_flag(:ci_job_line_links, @project)
end end
before_action only: :index do
frontend_experimentation_tracking_data(:jobs_empty_state, 'click_button')
end
layout 'project' layout 'project'
......
...@@ -13,6 +13,7 @@ module IconsHelper ...@@ -13,6 +13,7 @@ module IconsHelper
# Right now this method simply delegates directly to `fa_icon` from the # Right now this method simply delegates directly to `fa_icon` from the
# font-awesome-rails gem, but should we ever use a different icon pack in the # font-awesome-rails gem, but should we ever use a different icon pack in the
# future we won't have to change hundreds of method calls. # future we won't have to change hundreds of method calls.
# @deprecated use sprite_icon to render a SVG icon
def icon(names, options = {}) def icon(names, options = {})
if (options.keys & %w[aria-hidden aria-label data-hidden]).empty? if (options.keys & %w[aria-hidden aria-label data-hidden]).empty?
# Add 'aria-hidden' and 'data-hidden' if they are not set in options. # Add 'aria-hidden' and 'data-hidden' if they are not set in options.
......
...@@ -13,6 +13,8 @@ class AuditEvent < ApplicationRecord ...@@ -13,6 +13,8 @@ class AuditEvent < ApplicationRecord
:target_id :target_id
].freeze ].freeze
self.primary_key = :id
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
belongs_to :user, foreign_key: :author_id belongs_to :user, foreign_key: :author_id
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- if current_user.admin? - if current_user.admin?
.text-warning .text-warning
%p %p
= icon("exclamation-triangle fw") = sprite_icon('warning-solid')
= html_escape(_('You are an admin, which means granting access to %{client_name} will allow them to interact with GitLab as an admin as well. Proceed with caution.')) % { client_name: tag.strong(@pre_auth.client.name) } = html_escape(_('You are an admin, which means granting access to %{client_name} will allow them to interact with GitLab as an admin as well. Proceed with caution.')) % { client_name: tag.strong(@pre_auth.client.name) }
%p %p
- link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer') - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer')
......
- if project.archived? - if project.archived?
.text-warning.center.prepend-top-20 .text-warning.center.prepend-top-20
%p %p
= icon("exclamation-triangle fw") = sprite_icon('warning-solid')
= _('Archived project! Repository and other project resources are read only') = _('Archived project! Repository and other project resources are read only')
...@@ -37,7 +37,9 @@ ...@@ -37,7 +37,9 @@
= _('Add previously merged commits') = _('Add previously merged commits')
- if commits.size == 0 && context_commits.nil? - if commits.size == 0 && context_commits.nil?
.mt-4.text-center .commits-empty.gl-mt-6
.bold = custom_icon('illustration_no_commits')
%h4
= _('Your search didn\'t match any commits.') = _('Your search didn\'t match any commits.')
= _('Try changing or removing filters.') %p
= _('Try changing or removing filters.')
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
.control .control
= form_tag(project_commits_path(@project, @id), method: :get, class: 'commits-search-form js-signature-container', data: { 'signatures-path' => namespace_project_signatures_path }) do = form_tag(project_commits_path(@project, @id), method: :get, class: 'commits-search-form js-signature-container', data: { 'signatures-path' => namespace_project_signatures_path }) do
= search_field_tag :search, params[:search], { placeholder: _('Search by message'), id: 'commits-search', class: 'form-control search-text-input input-short gl-mt-3 gl-sm-mt-0 gl-min-w-full', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: _('Search by message'), id: 'commits-search', class: 'form-control gl-form-input input-short gl-mt-3 gl-sm-mt-0 gl-min-w-full gl-inset-border-1-gray-200!', spellcheck: false }
.control.d-none.d-md-block .control.d-none.d-md-block
= link_to project_commits_path(@project, @ref, rss_url_options), title: _("Commits feed"), class: 'btn gl-button btn-svg' do = link_to project_commits_path(@project, @ref, rss_url_options), title: _("Commits feed"), class: 'btn gl-button btn-svg' do
= sprite_icon('rss', css_class: 'qa-rss-icon') = sprite_icon('rss', css_class: 'qa-rss-icon')
......
- admin = local_assigns.fetch(:admin, false) - admin = local_assigns.fetch(:admin, false)
- if builds.blank? - if builds.blank?
%div - if experiment_enabled?(:jobs_empty_state)
.nothing-here-block No jobs to show .row.empty-state
.col-12
.svg-content.svg-250
= image_tag('jobs-empty-state.svg')
.col-12
.text-content.gl-text-center
%h4
= s_('Jobs|Use jobs to automate your tasks')
%p
= s_('Jobs|Jobs are the building blocks of a GitLab CI/CD pipeline. Each job has a specific task, like testing code. To set up jobs in a CI/CD pipeline, add a CI/CD configuration file to your project.')
= link_to s_('Jobs|Create CI/CD configuration file'), help_page_path('ci/quick_start/README'), class: 'btn gl-button btn-info js-empty-state-button'
- else
.nothing-here-block= s_('Jobs|No jobs to show')
- else - else
.table-holder .table-holder
%table.table.ci-table.builds-page %table.table.ci-table.builds-page
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
.nav-controls .nav-controls
- if can?(current_user, :update_build, @project) - if can?(current_user, :update_build, @project)
- unless @repository.gitlab_ci_yml - if !@repository.gitlab_ci_yml && !experiment_enabled?(:jobs_empty_state)
= link_to 'Get started with Pipelines', help_page_path('ci/quick_start/README'), class: 'btn gl-button btn-info' = link_to 'Get started with Pipelines', help_page_path('ci/quick_start/README'), class: 'btn gl-button btn-info js-empty-state-button'
= link_to project_ci_lint_path(@project), class: 'btn gl-button btn-default' do = link_to project_ci_lint_path(@project), class: 'btn gl-button btn-default' do
%span CI lint %span CI lint
......
%h4 %h4
= icon('exclamation-triangle') = sprite_icon('warning-solid')
This merge request failed to be merged automatically This merge request failed to be merged automatically
%p %p
......
%tr.tree-truncated-warning %tr.tree-truncated-warning
%td{ colspan: '3' } %td{ colspan: '3' }
= icon('exclamation-triangle fw') = sprite_icon('warning-solid')
%span %span
Too many items to show. To preserve performance only Too many items to show. To preserve performance only
%strong #{number_with_delimiter(limit)} of #{number_with_delimiter(total)} %strong #{number_with_delimiter(limit)} of #{number_with_delimiter(total)}
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
- if referenced_users - if referenced_users
.referenced-users.hide .referenced-users.hide
%span %span
= icon("exclamation-triangle") = sprite_icon('warning-solid')
You are about to add You are about to add
%strong %strong
%span.js-referenced-users-count 0 %span.js-referenced-users-count 0
......
...@@ -2021,7 +2021,7 @@ ...@@ -2021,7 +2021,7 @@
:urgency: :low :urgency: :low
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent: :idempotent: true
:tags: [] :tags: []
- :name: self_monitoring_project_create - :name: self_monitoring_project_create
:feature_category: :metrics :feature_category: :metrics
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryUpdateRemoteMirrorWorker # rubocop:disable Scalability/IdempotentWorker class RepositoryUpdateRemoteMirrorWorker
UpdateError = Class.new(StandardError) UpdateError = Class.new(StandardError)
include ApplicationWorker include ApplicationWorker
...@@ -11,6 +11,7 @@ class RepositoryUpdateRemoteMirrorWorker # rubocop:disable Scalability/Idempoten ...@@ -11,6 +11,7 @@ class RepositoryUpdateRemoteMirrorWorker # rubocop:disable Scalability/Idempoten
sidekiq_options retry: 3, dead: false sidekiq_options retry: 3, dead: false
feature_category :source_code_management feature_category :source_code_management
loggable_arguments 1 loggable_arguments 1
idempotent!
LOCK_WAIT_TIME = 30.seconds LOCK_WAIT_TIME = 30.seconds
MAX_TRIES = 3 MAX_TRIES = 3
......
---
title: Update empty state for no commits result
merge_request: 48538
author:
type: changed
---
title: Fix misalignment of commit search by message input
merge_request: 48430
author:
type: fixed
---
title: Replace fa-exclamation-triangle icons with GitLab SVG warning-solid icon
merge_request: 47089
author:
type: changed
---
title: Resolve Cannot remove namespace
merge_request: 48973
author:
type: fixed
--- ---
name: branch_list_keyset_pagination name: branch_list_keyset_pagination
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35819 introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35819
rollout_issue_url: rollout_issue_url:
milestone: '13.2' milestone: '13.2'
type: development type: development
group: group::source code group: group::source code
default_enabled: false default_enabled: true
...@@ -143,16 +143,39 @@ jq 'select(."grpc.code" != null and ."grpc.code" != "OK")' current ...@@ -143,16 +143,39 @@ jq 'select(."grpc.code" != null and ."grpc.code" != "OK")' current
jq 'select(."grpc.time_ms" > 30000)' current jq 'select(."grpc.time_ms" > 30000)' current
``` ```
#### Print top three projects by request volume and their three longest durations #### Print top ten projects by request volume and their three longest durations
```shell ```shell
jq -s -r 'map(select(."grpc.request.glProjectPath" != null and ."grpc.request.glProjectPath" != "" and ."grpc.time_ms" != null)) | group_by(."grpc.request.glProjectPath") | sort_by(-length) | limit(3; .[]) | sort_by(-."grpc.time_ms") | "CT: \(length)\tPROJECT: \(.[0]."grpc.request.glProjectPath")\tDURS: \(.[0]."grpc.time_ms"), \(.[1]."grpc.time_ms"), \(.[2]."grpc.time_ms")"' current jq --raw-output --slurp '
map(
select(
."grpc.request.glProjectPath" != null
and ."grpc.request.glProjectPath" != ""
and ."grpc.time_ms" != null
)
)
| group_by(."grpc.request.glProjectPath")
| sort_by(-length)
| limit(10; .[])
| sort_by(-."grpc.time_ms")
| [
length,
.[0]."grpc.time_ms",
.[1]."grpc.time_ms",
.[2]."grpc.time_ms",
.[0]."grpc.request.glProjectPath"
]
| @sh' /var/log/gitlab/gitaly/current \
| awk 'BEGIN { printf "%7s %10s %10s %10s\t%s\n", "CT", "MAX DURS", "", "", "PROJECT" }
{ printf "%7u %7u ms, %7u ms, %7u ms\t%s\n", $1, $2, $3, $4, $5 }'
``` ```
**Example output** **Example output**
```plaintext ```plaintext
CT: 635 PROJECT: groupA/project1 DURS: 4292.269, 4228.853, 2885.548 CT MAX DURS PROJECT
CT: 462 PROJECT: groupB/project5 DURS: 4368.981, 3623.553, 361.399 206 4898 ms, 1101 ms, 1032 ms 'groupD/project4'
CT: 455 PROJECT: groupC/project7 DURS: 387.295, 381.874, 373.988 109 1420 ms, 962 ms, 875 ms 'groupEF/project56'
663 106 ms, 96 ms, 94 ms 'groupABC/project123'
...
``` ```
...@@ -8,62 +8,81 @@ type: reference ...@@ -8,62 +8,81 @@ type: reference
# The .gitlab-ci.yml file # The .gitlab-ci.yml file
<!-- markdownlint-enable MD044 --> <!-- markdownlint-enable MD044 -->
To use GitLab CI/CD, you need an application codebase hosted in a To use GitLab CI/CD, you need:
Git repository, and for your build, test, and deployment
scripts to be specified in a file called [`.gitlab-ci.yml`](README.md), - Application code hosted in a Git repository.
located in the root path of your repository. - A file called [`.gitlab-ci.yml`](README.md) in the root of your repository, which
contains the CI/CD configuration.
In this file, you can define the scripts you want to run, define include and
cache dependencies, choose commands you want to run in sequence In the `.gitlab-ci.yml` file, you can define:
and those you want to run in parallel, define where you want to
deploy your app, and specify whether you want to run the scripts automatically - The scripts you want to run.
or trigger any of them manually. After you're familiar with - Other configuration files and templates you want to include.
GitLab CI/CD you can add more advanced steps into the configuration file. - Dependencies and caches.
- The commands you want to run in sequence and those you want to run in parallel.
To add scripts to that file, you need to organize them in a - The location to deploy your application to.
sequence that suits your application and are in accordance with - Whether you want to run the scripts automatically or trigger any of them manually.
the tests you wish to perform. To visualize the process, imagine
that all the scripts you add to the configuration file are the The scripts are grouped into **jobs**, and jobs run as part of a larger
same as the commands you run on a terminal on your computer. **pipeline**. You can group multiple independent jobs into **stages** that run in a defined order.
After you've added your `.gitlab-ci.yml` configuration file to your You should organize your jobs in a sequence that suits your application and is in accordance with
repository, GitLab detects it and run your scripts with the the tests you wish to perform. To [visualize](visualization.md) the process, imagine
tool called [GitLab Runner](https://docs.gitlab.com/runner/), which the scripts you add to jobs are the same as CLI commands you run on your computer.
works similarly to your terminal.
When you add a `.gitlab-ci.yml` file to your
The scripts are grouped into **jobs**, and together they compose repository, GitLab detects it and an application called [GitLab Runner](https://docs.gitlab.com/runner/)
a **pipeline**. A minimalist example of `.gitlab-ci.yml` file runs the scripts defined in the jobs.
could contain:
A `.gitlab-ci.yml` file might contain:
```yaml ```yaml
before_script: stages:
- apt-get install rubygems ruby-dev -y - build
- test
build-code-job:
stage: build
script:
- echo "Check the ruby version, then build some Ruby project files:"
- ruby -v
- rake
run-test: test-code-job1:
stage: test
script: script:
- ruby --version - echo "If the files are built successfully, test some files with one command:"
- rake test1
test-code-job2:
stage: test
script:
- echo "If the files are built successfully, test other files with a different command:"
- rake test2
``` ```
The `before_script` attribute would install the dependencies In this example, the `build-code-job` job in the `build` stage runs first. It outputs
for your app before running anything, and a **job** called the Ruby version the job is using, then runs `rake` to build project files.
`run-test` would print the Ruby version of the current system. If this job completes successfully, the two `test-code-job` jobs in the `test` stage start
Both of them compose a **pipeline** triggered at every push in parallel and run tests on the files.
to any branch of the repository.
The full pipeline in the example is composed of three jobs, grouped into two stages,
`build` and `test`. The pipeline runs every time changes are pushed to any
branch in the project.
GitLab CI/CD not only executes the jobs you've GitLab CI/CD not only executes the jobs but also shows you what's happening during execution,
set but also shows you what's happening during execution, as you just as you would see in your terminal:
would see in your terminal:
![job running](img/job_running.png) ![job running](img/job_running.png)
You create the strategy for your app and GitLab runs the pipeline You create the strategy for your app and GitLab runs the pipeline
for you according to what you've defined. Your pipeline status is also according to what you've defined. Your pipeline status is also
displayed by GitLab: displayed by GitLab:
![pipeline status](img/pipeline_status.png) ![pipeline status](img/pipeline_status.png)
At the end, if anything goes wrong, you can easily If anything goes wrong, you can
[roll back](../environments/index.md#retrying-and-rolling-back) all the changes: [roll back](../environments/index.md#retrying-and-rolling-back) the changes:
![rollback button](img/rollback.png) ![rollback button](img/rollback.png)
......
...@@ -22,7 +22,7 @@ Our goal is to replace one by one all inline SVG Icons (as those currently bloat ...@@ -22,7 +22,7 @@ Our goal is to replace one by one all inline SVG Icons (as those currently bloat
### Usage in HAML/Rails ### Usage in HAML/Rails
To use a sprite Icon in HAML or Rails we use a specific helper function : To use a sprite Icon in HAML or Rails we use a specific helper function:
```ruby ```ruby
sprite_icon(icon_name, size: nil, css_class: '') sprite_icon(icon_name, size: nil, css_class: '')
...@@ -48,6 +48,8 @@ sprite_icon(icon_name, size: nil, css_class: '') ...@@ -48,6 +48,8 @@ sprite_icon(icon_name, size: nil, css_class: '')
</svg> </svg>
``` ```
**Please note:** The `icon(icon_name, options: {})` helper function is deprecated and should not be used anymore.
### Usage in Vue ### Usage in Vue
[GitLab UI](https://gitlab-org.gitlab.io/gitlab-ui/), our components library, provides a component to display sprite icons. [GitLab UI](https://gitlab-org.gitlab.io/gitlab-ui/), our components library, provides a component to display sprite icons.
......
...@@ -23,8 +23,7 @@ module BillingPlansHelper ...@@ -23,8 +23,7 @@ module BillingPlansHelper
end end
def use_new_purchase_flow?(namespace) def use_new_purchase_flow?(namespace)
namespace.group? && namespace.group? && (namespace.actual_plan_name == Plan::FREE || namespace.trial_active?)
namespace.actual_plan_name == Plan::FREE
end end
def show_contact_sales_button?(purchase_link_action) def show_contact_sales_button?(purchase_link_action)
......
...@@ -39,6 +39,22 @@ module EE ...@@ -39,6 +39,22 @@ module EE
scope :include_gitlab_subscription_with_hosted_plan, -> { includes(gitlab_subscription: :hosted_plan) } scope :include_gitlab_subscription_with_hosted_plan, -> { includes(gitlab_subscription: :hosted_plan) }
scope :join_gitlab_subscription, -> { joins("LEFT OUTER JOIN gitlab_subscriptions ON gitlab_subscriptions.namespace_id=namespaces.id") } scope :join_gitlab_subscription, -> { joins("LEFT OUTER JOIN gitlab_subscriptions ON gitlab_subscriptions.namespace_id=namespaces.id") }
scope :top_most, -> { where(parent_id: nil) }
scope :in_active_trial, -> do
left_joins(gitlab_subscription: :hosted_plan)
.where(gitlab_subscriptions: { trial: true, trial_ends_on: Date.today.. })
end
scope :in_default_plan, -> do
left_joins(gitlab_subscription: :hosted_plan)
.where(plans: { name: [nil, *::Plan.default_plans] })
end
scope :eligible_for_subscription, -> do
top_most.in_active_trial.or(top_most.in_default_plan)
end
scope :eligible_for_trial, -> do scope :eligible_for_trial, -> do
left_joins(gitlab_subscription: :hosted_plan) left_joins(gitlab_subscription: :hosted_plan)
.where( .where(
......
...@@ -256,11 +256,7 @@ module EE ...@@ -256,11 +256,7 @@ module EE
end end
def manageable_groups_eligible_for_subscription def manageable_groups_eligible_for_subscription
manageable_groups manageable_groups.eligible_for_subscription.order(:name)
.where(parent_id: nil)
.left_joins(:gitlab_subscription)
.merge(GitlabSubscription.left_joins(:hosted_plan).where(plans: { name: [nil, *::Plan.default_plans] }))
.order(:name)
end end
def manageable_groups_eligible_for_trial def manageable_groups_eligible_for_trial
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.form-group.gl-mb-3 .form-group.gl-mb-3
.form-check .form-check
= f.check_box :prevent_forking_outside_group, checked: group.prevent_forking_outside_group?, class: 'form-check-input', disabled: !can_change_prevent_forking?(current_user, group) = f.check_box :prevent_forking_outside_group, checked: group.prevent_forking_outside_group?, class: 'form-check-input', disabled: !can_change_prevent_forking?(current_user, group), data: { qa_selector: 'prevent_forking_outside_group_checkbox' }
= f.label :prevent_forking_outside_group, class: 'form-check-label' do = f.label :prevent_forking_outside_group, class: 'form-check-label' do
%span.gl-display-block= s_('GroupSettings|Prevent forking outside of the group') %span.gl-display-block= s_('GroupSettings|Prevent forking outside of the group')
%span.text-muted= s_('GroupSettings|This setting will prevent group members from forking projects outside of the group.') %span.text-muted= s_('GroupSettings|This setting will prevent group members from forking projects outside of the group.')
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
- if project.archived? - if project.archived?
.text-warning.center.prepend-top-20 .text-warning.center.prepend-top-20
%p %p
= icon("exclamation-triangle fw") = sprite_icon('warning-solid')
= _('Archived project! Repository and other project resources are read-only') = _('Archived project! Repository and other project resources are read-only')
- if project.marked_for_deletion? - if project.marked_for_deletion?
.text-warning.center.prepend-top-20 .text-warning.center.prepend-top-20
%p %p
= icon("exclamation-triangle fw") = sprite_icon('warning-solid')
= _("Deletion pending. This project will be removed on %{date}. Repository and other project resources are read-only.") % { date: permanent_deletion_date(project.marked_for_deletion_at) } = _("Deletion pending. This project will be removed on %{date}. Repository and other project resources are read-only.") % { date: permanent_deletion_date(project.marked_for_deletion_at) }
- if @project.mirror_ever_updated_successfully? && @repository.diverged_from_upstream?(branch.name) - if @project.mirror_ever_updated_successfully? && @repository.diverged_from_upstream?(branch.name)
%span.badge.badge-danger.gl-ml-2.has-tooltip{ data: { html: "true", title: branch_diverged_tooltip_message } } %span.badge.badge-danger.gl-ml-2.has-tooltip{ data: { html: "true", title: branch_diverged_tooltip_message } }
= icon('exclamation-triangle') = sprite_icon('warning-solid')
= s_('Branches|diverged from upstream') = s_('Branches|diverged from upstream')
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- if @ref.present? && @project.mirror_ever_updated_successfully? && @repository.diverged_from_upstream?(@ref) - if @ref.present? && @project.mirror_ever_updated_successfully? && @repository.diverged_from_upstream?(@ref)
%span.has-tooltip{ data: { html: "true", title: branch_diverged_tooltip_message } } %span.has-tooltip{ data: { html: "true", title: branch_diverged_tooltip_message } }
= icon('exclamation-triangle') = sprite_icon('warning-solid')
This branch has diverged from upstream. This branch has diverged from upstream.
.project-mirror-button .project-mirror-button
= render "shared/mirror_update_button" = render "shared/mirror_update_button"
- error_messages = @project.repository_size_checker.error_message - error_messages = @project.repository_size_checker.error_message
%h4.size-limit-reached %h4.size-limit-reached
= icon("exclamation-triangle") = sprite_icon('warning-solid')
= error_messages.merge_error = error_messages.merge_error
%p %p
......
---
title: New subscription purchase for trial namespaces follow new flow
merge_request: 47880
author:
type: changed
...@@ -200,14 +200,6 @@ module EE ...@@ -200,14 +200,6 @@ module EE
ldap_keys: count(::LDAPKey), ldap_keys: count(::LDAPKey),
ldap_users: count(::User.ldap, 'users.id'), ldap_users: count(::User.ldap, 'users.id'),
pod_logs_usages_total: redis_usage_data { ::Gitlab::UsageCounters::PodLogs.usage_totals[:total] }, pod_logs_usages_total: redis_usage_data { ::Gitlab::UsageCounters::PodLogs.usage_totals[:total] },
projects_enforcing_code_owner_approval: count(::Project.without_deleted.non_archived.requiring_code_owner_approval),
merge_requests_with_added_rules: distinct_count(::ApprovalMergeRequestRule.with_added_approval_rules,
:merge_request_id,
start: approval_merge_request_rule_minimum_id,
finish: approval_merge_request_rule_maximum_id),
merge_requests_with_optional_codeowners: distinct_count(::ApprovalMergeRequestRule.code_owner_approval_optional, :merge_request_id),
merge_requests_with_overridden_project_rules: merge_requests_with_overridden_project_rules,
merge_requests_with_required_codeowners: distinct_count(::ApprovalMergeRequestRule.code_owner_approval_required, :merge_request_id),
merged_merge_requests_using_approval_rules: count(::MergeRequest.merged.joins(:approval_rules), # rubocop: disable CodeReuse/ActiveRecord merged_merge_requests_using_approval_rules: count(::MergeRequest.merged.joins(:approval_rules), # rubocop: disable CodeReuse/ActiveRecord
start: merge_request_minimum_id, start: merge_request_minimum_id,
finish: merge_request_maximum_id), finish: merge_request_maximum_id),
......
import { GlTooltip, GlIcon } from '@gitlab/ui'; import { GlTooltip, GlIcon, GlLoadingIcon } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import DeployBoard from 'ee/environments/components/deploy_board_component.vue'; import DeployBoard from 'ee/environments/components/deploy_board_component.vue';
...@@ -95,7 +95,7 @@ describe('Deploy Board', () => { ...@@ -95,7 +95,7 @@ describe('Deploy Board', () => {
}); });
it('should render loading spinner', () => { it('should render loading spinner', () => {
expect(wrapper.find('.fa-spin')).toBeDefined(); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
}); });
......
...@@ -57,7 +57,8 @@ RSpec.describe BillingPlansHelper do ...@@ -57,7 +57,8 @@ RSpec.describe BillingPlansHelper do
describe '#use_new_purchase_flow?' do describe '#use_new_purchase_flow?' do
where type: ['Group', nil], where type: ['Group', nil],
plan: Plan.all_plans plan: Plan.all_plans,
trial_active: [true, false]
with_them do with_them do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -68,12 +69,13 @@ RSpec.describe BillingPlansHelper do ...@@ -68,12 +69,13 @@ RSpec.describe BillingPlansHelper do
before do before do
allow(helper).to receive(:current_user).and_return(user) allow(helper).to receive(:current_user).and_return(user)
allow(namespace).to receive(:trial_active?).and_return(trial_active)
end end
subject { helper.use_new_purchase_flow?(namespace) } subject { helper.use_new_purchase_flow?(namespace) }
it do it do
result = type == 'Group' && plan == Plan::FREE result = type == 'Group' && (plan == Plan::FREE || trial_active)
is_expected.to be(result) is_expected.to be(result)
end end
......
...@@ -219,24 +219,6 @@ RSpec.describe Gitlab::UsageData do ...@@ -219,24 +219,6 @@ RSpec.describe Gitlab::UsageData do
end end
end end
describe 'code owner approval required' do
before do
create(:protected_branch, code_owner_approval_required: true)
create(:protected_branch,
code_owner_approval_required: true,
project: create(:project, :archived))
create(:protected_branch,
code_owner_approval_required: true,
project: create(:project, pending_delete: true))
end
it 'counts the projects actively requiring code owner approval' do
expect(described_class.system_usage_data[:counts][:projects_enforcing_code_owner_approval]).to eq(1)
end
end
describe 'merge requests merged using approval rules' do describe 'merge requests merged using approval rules' do
before do before do
create(:approval_merge_request_rule, merge_request: create(:merge_request, :merged)) create(:approval_merge_request_rule, merge_request: create(:merge_request, :merged))
......
...@@ -171,6 +171,130 @@ RSpec.describe Namespace do ...@@ -171,6 +171,130 @@ RSpec.describe Namespace do
end end
end end
describe '.top_most' do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:sub_namespace) { create(:namespace, parent: namespace) }
subject { described_class.top_most.ids }
it 'only contains root namespace' do
is_expected.to eq([namespace.id])
end
end
describe '.in_active_trial' do
let_it_be(:namespaces) do
[
create(:namespace),
create(:namespace_with_plan),
create(:namespace_with_plan, trial_ends_on: Date.tomorrow)
]
end
it 'is consistent to trial_active? method' do
namespaces.each do |ns|
consistent = described_class.in_active_trial.include?(ns) == !!ns.trial_active?
expect(consistent).to be true
end
end
end
describe '.in_default_plan' do
subject { described_class.in_default_plan.ids }
where(:plan_name, :expect_in_default_plan) do
::Plan::FREE | true
::Plan::DEFAULT | true
::Plan::BRONZE | false
::Plan::SILVER | false
::Plan::GOLD | false
end
with_them do
it 'returns expected result' do
namespace = create(:namespace_with_plan, plan: "#{plan_name}_plan")
is_expected.to eq(expect_in_default_plan ? [namespace.id] : [])
end
end
it 'includes namespace with no subscription' do
namespace = create(:namespace)
is_expected.to eq([namespace.id])
end
end
describe '.eligible_for_subscription' do
let_it_be(:namespace) { create :namespace }
let_it_be(:sub_namespace) { create(:namespace, parent: namespace) }
subject { described_class.eligible_for_subscription.ids }
context 'when there is no subscription' do
it { is_expected.to eq([namespace.id]) }
end
context 'when there is a subscription' do
context 'with a plan that is eligible for a trial' do
where(plan: ::Plan::PLANS_ELIGIBLE_FOR_TRIAL)
with_them do
context 'and has not yet been trialed' do
before do
create :gitlab_subscription, plan, namespace: namespace
create :gitlab_subscription, plan, namespace: sub_namespace
end
it { is_expected.to eq([namespace.id]) }
end
context 'but has already had a trial' do
before do
create :gitlab_subscription, plan, :expired_trial, namespace: namespace
create :gitlab_subscription, plan, :expired_trial, namespace: sub_namespace
end
it { is_expected.to eq([namespace.id]) }
end
context 'but is currently being trialed' do
before do
create :gitlab_subscription, plan, :active_trial, namespace: namespace
create :gitlab_subscription, plan, :active_trial, namespace: sub_namespace
end
it { is_expected.to eq([namespace.id]) }
end
end
end
context 'in active trial gold plan' do
before do
create :gitlab_subscription, ::Plan::GOLD, :active_trial, namespace: namespace
create :gitlab_subscription, ::Plan::GOLD, :active_trial, namespace: sub_namespace
end
it { is_expected.to eq([namespace.id]) }
end
context 'with a paid plan and not in trial' do
where(plan: ::Plan::PAID_HOSTED_PLANS)
with_them do
context 'and has not yet been trialed' do
before do
create :gitlab_subscription, plan, namespace: namespace
end
it { is_expected.to be_empty }
end
end
end
end
end
describe '.eligible_for_trial' do describe '.eligible_for_trial' do
let_it_be(:namespace) { create :namespace } let_it_be(:namespace) { create :namespace }
......
...@@ -1019,6 +1019,7 @@ RSpec.describe User do ...@@ -1019,6 +1019,7 @@ RSpec.describe User do
let_it_be(:free_group_z) { create(:group, name: 'AZ', gitlab_subscription: create(:gitlab_subscription, :free)) } let_it_be(:free_group_z) { create(:group, name: 'AZ', gitlab_subscription: create(:gitlab_subscription, :free)) }
let_it_be(:free_group_a) { create(:group, name: 'AA', gitlab_subscription: create(:gitlab_subscription, :free)) } let_it_be(:free_group_a) { create(:group, name: 'AA', gitlab_subscription: create(:gitlab_subscription, :free)) }
let_it_be(:sub_group) { create(:group, name: 'SubGroup', parent: free_group_a) } let_it_be(:sub_group) { create(:group, name: 'SubGroup', parent: free_group_a) }
let_it_be(:trial_group) { create(:group, name: 'AB', gitlab_subscription: create(:gitlab_subscription, :active_trial, :gold)) }
subject { user.manageable_groups_eligible_for_subscription } subject { user.manageable_groups_eligible_for_subscription }
...@@ -1068,6 +1069,30 @@ RSpec.describe User do ...@@ -1068,6 +1069,30 @@ RSpec.describe User do
it { is_expected.not_to include(sub_group) } it { is_expected.not_to include(sub_group) }
end end
context 'developer of a trial group' do
before do
trial_group.add_developer(user)
end
it { is_expected.not_to include(trial_group) }
end
context 'owner of a trial group' do
before do
trial_group.add_owner(user)
end
it { is_expected.to include(trial_group) }
end
context 'maintainer of a trial group' do
before do
trial_group.add_maintainer(user)
end
it { is_expected.to include(trial_group) }
end
end end
describe '#manageable_groups_eligible_for_trial' do describe '#manageable_groups_eligible_for_trial' do
......
...@@ -77,6 +77,9 @@ module Gitlab ...@@ -77,6 +77,9 @@ module Gitlab
default_to_issues_board: { default_to_issues_board: {
tracking_category: 'Growth::Conversion::Experiment::DefaultToIssuesBoard', tracking_category: 'Growth::Conversion::Experiment::DefaultToIssuesBoard',
use_backwards_compatible_subject_index: true use_backwards_compatible_subject_index: true
},
jobs_empty_state: {
tracking_category: 'Growth::Activation::Experiment::JobsEmptyState'
} }
}.freeze }.freeze
......
...@@ -26,11 +26,11 @@ module Gitlab ...@@ -26,11 +26,11 @@ module Gitlab
private private
def keyset_pagination_enabled? def keyset_pagination_enabled?
Feature.enabled?(:branch_list_keyset_pagination, project) && params[:pagination] == 'keyset' Feature.enabled?(:branch_list_keyset_pagination, project, default_enabled: true) && params[:pagination] == 'keyset'
end end
def paginate_first_page? def paginate_first_page?
Feature.enabled?(:branch_list_keyset_pagination, project) && (params[:page].blank? || params[:page].to_i == 1) Feature.enabled?(:branch_list_keyset_pagination, project, default_enabled: true) && (params[:page].blank? || params[:page].to_i == 1)
end end
def paginate_via_gitaly(finder) def paginate_via_gitaly(finder)
......
...@@ -15527,6 +15527,18 @@ msgstr "" ...@@ -15527,6 +15527,18 @@ msgstr ""
msgid "Jobs|Are you sure you want to retry this job?" msgid "Jobs|Are you sure you want to retry this job?"
msgstr "" msgstr ""
msgid "Jobs|Create CI/CD configuration file"
msgstr ""
msgid "Jobs|Jobs are the building blocks of a GitLab CI/CD pipeline. Each job has a specific task, like testing code. To set up jobs in a CI/CD pipeline, add a CI/CD configuration file to your project."
msgstr ""
msgid "Jobs|No jobs to show"
msgstr ""
msgid "Jobs|Use jobs to automate your tasks"
msgstr ""
msgid "Jobs|You're about to retry a job that failed because it attempted to deploy code that is older than the latest deployment. Retrying this job could result in overwriting the environment with the older source code." msgid "Jobs|You're about to retry a job that failed because it attempted to deploy code that is older than the latest deployment. Retrying this job could result in overwriting the environment with the older source code."
msgstr "" msgstr ""
......
...@@ -29,6 +29,10 @@ module QA ...@@ -29,6 +29,10 @@ module QA
element :membership_lock_checkbox element :membership_lock_checkbox
end end
view 'ee/app/views/groups/settings/_prevent_forking.html.haml' do
element :prevent_forking_outside_group_checkbox
end
view 'ee/app/views/shared/_repository_size_limit_setting.html.haml' do view 'ee/app/views/shared/_repository_size_limit_setting.html.haml' do
element :repository_size_limit_field element :repository_size_limit_field
end end
...@@ -88,6 +92,18 @@ module QA ...@@ -88,6 +92,18 @@ module QA
click_element :save_permissions_changes_button click_element :save_permissions_changes_button
end end
def set_prevent_forking_outside_group_enabled
expand_content :permission_lfs_2fa_content
check_element :prevent_forking_outside_group_checkbox
click_element :save_permissions_changes_button
end
def set_prevent_forking_outside_group_disabled
expand_content :permission_lfs_2fa_content
uncheck_element :prevent_forking_outside_group_checkbox
click_element :save_permissions_changes_button
end
def set_repository_size_limit(limit) def set_repository_size_limit(limit)
find_element(:repository_size_limit_field).set limit find_element(:repository_size_limit_field).set limit
end end
......
...@@ -228,7 +228,7 @@ module QA ...@@ -228,7 +228,7 @@ module QA
def finished_loading_block? def finished_loading_block?
wait_for_requests wait_for_requests
has_no_css?('.fa-spinner.block-loading', wait: Capybara.default_max_wait_time) has_no_css?('.gl-spinner', wait: Capybara.default_max_wait_time)
end end
def has_loaded_all_images? def has_loaded_all_images?
......
...@@ -9,9 +9,17 @@ module QA ...@@ -9,9 +9,17 @@ module QA
element :fork_namespace_button element :fork_namespace_button
end end
view 'app/assets/javascripts/pages/projects/forks/new/components/fork_groups_list.vue' do
element :fork_groups_list_search_field
end
def choose_namespace(namespace = Runtime::Namespace.path) def choose_namespace(namespace = Runtime::Namespace.path)
click_element(:fork_namespace_button, name: namespace) click_element(:fork_namespace_button, name: namespace)
end end
def search_for_group(group_name)
find_element(:fork_groups_list_search_field).set(group_name)
end
end end
end end
end end
......
...@@ -76,6 +76,19 @@ module QA ...@@ -76,6 +76,19 @@ module QA
visibility: 'public' visibility: 'public'
} }
end end
def api_put_path
"/groups/#{id}"
end
def update_group_setting(group_setting:, value:)
put_body = { "#{group_setting}": value }
response = put Runtime::API::Request.new(api_client, api_put_path).url, put_body
unless response.code == HTTP_STATUS_OK
raise ResourceUpdateFailedError, "Could not update #{group_setting} to #{value}. Request returned (#{response.code}): `#{response}`."
end
end
end end
end end
end end
# frozen_string_literal: true
module QA
RSpec.describe 'Manage' do
describe 'prevent forking outside group' do
let!(:group_for_fork) do
Resource::Sandbox.fabricate_via_api! do |sandbox_group|
sandbox_group.path = "group_for_fork_#{SecureRandom.hex(8)}"
end
end
let(:project) do
Resource::Project.fabricate! do |project|
project.name = "project_to_fork"
project.initialize_with_readme = true
end
end
context 'when disabled' do
before do
set_prevent_forking_outside_group('disabled')
end
it 'allows forking outside of group', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1070' do
visit_project_and_search_group_for_fork
expect(page).to have_text(group_for_fork.path)
expect(page).to have_text('Select a namespace to fork the project')
end
end
context 'when enabled' do
before do
set_prevent_forking_outside_group('enabled')
end
it 'does not allow forking outside of group', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1107' do
visit_project_and_search_group_for_fork
expect(page).not_to have_text(group_for_fork.path)
expect(page).not_to have_text('Select a namespace to fork the project')
end
end
after do
project.group.sandbox.update_group_setting(group_setting: 'prevent_forking_outside_group', value: false)
project.remove_via_api!
group_for_fork.remove_via_api!
end
def set_prevent_forking_outside_group(enabled_or_disabled)
Flow::Login.sign_in
project.group.sandbox.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item)
Page::Group::Settings::General.perform do |general_setting|
general_setting.send("set_prevent_forking_outside_group_#{enabled_or_disabled}")
end
end
def visit_project_and_search_group_for_fork
project.visit!
Page::Project::Show.perform(&:fork_project)
Page::Project::Fork::New.perform do |fork_new|
fork_new.search_for_group(group_for_fork.path)
end
end
end
end
end
...@@ -25,7 +25,7 @@ module QA ...@@ -25,7 +25,7 @@ module QA
# https://gitlab.com/groups/gitlab-org/-/epics/956 # https://gitlab.com/groups/gitlab-org/-/epics/956
# retry_on_exception added here due to `StaleElementReferenceError`. See: https://gitlab.com/gitlab-org/gitlab/-/issues/232485 # retry_on_exception added here due to `StaleElementReferenceError`. See: https://gitlab.com/gitlab-org/gitlab/-/issues/232485
Support::Retrier.retry_on_exception do Support::Retrier.retry_on_exception do
Capybara.page.has_no_css?('.gl-spinner, .fa-spinner, .spinner', wait: wait) Capybara.page.has_no_css?('.gl-spinner', wait: wait)
end end
end end
end end
......
...@@ -15,6 +15,54 @@ RSpec.describe Projects::JobsController, :clean_gitlab_redis_shared_state do ...@@ -15,6 +15,54 @@ RSpec.describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end end
describe 'GET index' do describe 'GET index' do
describe 'pushing tracking_data to Gon' do
before do
stub_experiment(jobs_empty_state: experiment_active)
stub_experiment_for_user(jobs_empty_state: in_experiment_group)
get_index
end
context 'when experiment not active' do
let(:experiment_active) { false }
let(:in_experiment_group) { false }
it 'does not push tracking_data to Gon' do
expect(Gon.tracking_data).to be_nil
end
end
context 'when experiment active and user in control group' do
let(:experiment_active) { true }
let(:in_experiment_group) { false }
it 'pushes tracking_data to Gon' do
expect(Gon.tracking_data).to match(
{
category: 'Growth::Activation::Experiment::JobsEmptyState',
action: 'click_button',
label: anything,
property: 'control_group'
}
)
end
end
context 'when experiment active and user in experimental group' do
let(:experiment_active) { true }
let(:in_experiment_group) { true }
it 'pushes tracking_data to gon' do
expect(Gon.tracking_data).to match(
category: 'Growth::Activation::Experiment::JobsEmptyState',
action: 'click_button',
label: anything,
property: 'experimental_group'
)
end
end
end
context 'when scope is pending' do context 'when scope is pending' do
before do before do
create(:ci_build, :pending, pipeline: pipeline) create(:ci_build, :pending, pipeline: pipeline)
......
...@@ -25,72 +25,113 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do ...@@ -25,72 +25,113 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do
end end
describe "GET /:project/jobs" do describe "GET /:project/jobs" do
let!(:job) { create(:ci_build, pipeline: pipeline) } context 'with no jobs' do
context "Pending scope" do
before do before do
visit project_jobs_path(project, scope: :pending) stub_experiment(jobs_empty_state: experiment_active)
end stub_experiment_for_user(jobs_empty_state: in_experiment_group)
it "shows Pending tab jobs" do visit project_jobs_path(project)
expect(page).to have_selector('.nav-links li.active', text: 'Pending')
expect(page).to have_content job.short_sha
expect(page).to have_content job.ref
expect(page).to have_content job.name
end end
end
context "Running scope" do context 'when experiment not active' do
before do let(:experiment_active) { false }
job.run! let(:in_experiment_group) { false }
visit project_jobs_path(project, scope: :running)
end
it "shows Running tab jobs" do it 'shows the empty state control page' do
expect(page).to have_selector('.nav-links li.active', text: 'Running') expect(page).to have_content('No jobs to show')
expect(page).to have_content job.short_sha expect(page).to have_link('Get started with Pipelines')
expect(page).to have_content job.ref end
expect(page).to have_content job.name
end end
end
context "Finished scope" do context 'when experiment active and user in control group' do
before do let(:experiment_active) { true }
job.run! let(:in_experiment_group) { false }
visit project_jobs_path(project, scope: :finished)
it 'shows the empty state control page' do
expect(page).to have_content('No jobs to show')
expect(page).to have_link('Get started with Pipelines')
end
end end
it "shows Finished tab jobs" do context 'when experiment active and user in experimental group' do
expect(page).to have_selector('.nav-links li.active', text: 'Finished') let(:experiment_active) { true }
expect(page).to have_content 'No jobs to show' let(:in_experiment_group) { true }
it 'shows the empty state experiment page' do
expect(page).to have_content('Use jobs to automate your tasks')
expect(page).to have_link('Create CI/CD configuration file')
end
end end
end end
context "All jobs" do context 'with a job' do
before do let!(:job) { create(:ci_build, pipeline: pipeline) }
project.builds.running_or_pending.each(&:success)
visit project_jobs_path(project) context "Pending scope" do
before do
visit project_jobs_path(project, scope: :pending)
end
it "shows Pending tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'Pending')
expect(page).to have_content job.short_sha
expect(page).to have_content job.ref
expect(page).to have_content job.name
end
end end
it "shows All tab jobs" do context "Running scope" do
expect(page).to have_selector('.nav-links li.active', text: 'All') before do
expect(page).to have_content job.short_sha job.run!
expect(page).to have_content job.ref visit project_jobs_path(project, scope: :running)
expect(page).to have_content job.name end
it "shows Running tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'Running')
expect(page).to have_content job.short_sha
expect(page).to have_content job.ref
expect(page).to have_content job.name
end
end end
end
context "when visiting old URL" do context "Finished scope" do
let(:jobs_url) do before do
project_jobs_path(project) job.run!
visit project_jobs_path(project, scope: :finished)
end
it "shows Finished tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'Finished')
expect(page).to have_content 'No jobs to show'
end
end end
before do context "All jobs" do
visit jobs_url.sub('/-/jobs', '/builds') before do
project.builds.running_or_pending.each(&:success)
visit project_jobs_path(project)
end
it "shows All tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'All')
expect(page).to have_content job.short_sha
expect(page).to have_content job.ref
expect(page).to have_content job.name
end
end end
it "redirects to new URL" do context "when visiting old URL" do
expect(page.current_path).to eq(jobs_url) let(:jobs_url) do
project_jobs_path(project)
end
before do
visit jobs_url.sub('/-/jobs', '/builds')
end
it "redirects to new URL" do
expect(page.current_path).to eq(jobs_url)
end
end end
end end
end end
......
...@@ -19,7 +19,7 @@ RSpec.describe "User interacts with deploy keys", :js do ...@@ -19,7 +19,7 @@ RSpec.describe "User interacts with deploy keys", :js do
click_button("Enable") click_button("Enable")
expect(page).not_to have_selector(".fa-spinner") expect(page).not_to have_selector(".gl-spinner")
expect(current_path).to eq(project_settings_repository_path(project)) expect(current_path).to eq(project_settings_repository_path(project))
find(".js-deployKeys-tab-enabled_keys").click find(".js-deployKeys-tab-enabled_keys").click
......
<div class="js-create-item-dropdown-fixture-root"> <div class="js-create-item-dropdown-fixture-root">
<input name="variable[environment]" type="hidden"> <input name="variable[environment]" type="hidden" />
<div class="dropdown "><button class="dropdown-menu-toggle js-dropdown-menu-toggle" type="button" data-toggle="dropdown"><span class="dropdown-toggle-text ">some label</span><i aria-hidden="true" data-hidden="true" class="fa fa-chevron-down"></i></button><div class="dropdown-menu dropdown-select dropdown-menu-selectable"><div class="dropdown-input"><input type="search" id="" class="dropdown-input-field" autocomplete="off" /><i aria-hidden="true" data-hidden="true" class="fa fa-search dropdown-input-search"></i><i aria-hidden="true" data-hidden="true" role="button" class="fa fa-times dropdown-input-clear js-dropdown-input-clear"></i></div><div class="dropdown-content js-dropdown-content"></div><div class="dropdown-footer"><ul class="dropdown-footer-list"> <div class="dropdown ">
<li> <button
<button class="dropdown-create-new-item-button js-dropdown-create-new-item"> class="dropdown-menu-toggle js-dropdown-menu-toggle"
Create wildcard type="button"
<code></code> data-toggle="dropdown"
</button> >
</li> <span class="dropdown-toggle-text ">some label</span
</ul> ><i aria-hidden="true" data-hidden="true" class="fa fa-chevron-down"></i>
</div><div class="dropdown-loading"><i aria-hidden="true" data-hidden="true" class="fa fa-spinner fa-spin"></i></div></div></div></div> </button>
<div class="dropdown-menu dropdown-select dropdown-menu-selectable">
<div class="dropdown-input">
<input type="search" id="" class="dropdown-input-field" autocomplete="off" /><i
aria-hidden="true"
data-hidden="true"
class="fa fa-search dropdown-input-search"
></i
><i
aria-hidden="true"
data-hidden="true"
role="button"
class="fa fa-times dropdown-input-clear js-dropdown-input-clear"
></i>
</div>
<div class="dropdown-content js-dropdown-content"></div>
<div class="dropdown-footer">
<ul class="dropdown-footer-list">
<li>
<button class="dropdown-create-new-item-button js-dropdown-create-new-item">
Create wildcard
<code></code>
</button>
</li>
</ul>
</div>
<div class="dropdown-loading">
<span aria-hidden="true" data-hidden="true" class="gl-spinner"></span>
</div>
</div>
</div>
</div>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
<div class="dropdown-content"></div> <div class="dropdown-content"></div>
<div class="dropdown-loading"> <div class="dropdown-loading">
<i class="fa fa-spinner fa-spin"></i> <span class="gl-spinner"></span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<ul></ul> <ul></ul>
</li> </li>
<li class="js-builds-dropdown-loading hidden"> <li class="js-builds-dropdown-loading hidden">
<span class="fa fa-spinner"></span> <span class="gl-spinner"></span>
</li> </li>
</ul> </ul>
</div> </div>
<div class="project-item-select-holder"> <div class="project-item-select-holder">
<input class="project-item-select" data-group-id="12345" data-relative-path="issues/new"> <input class="project-item-select" data-group-id="12345" data-relative-path="issues/new" />
<a class="new-project-item-link" data-label="New issue" data-type="issues" href=""> <a class="new-project-item-link" data-label="New issue" data-type="issues" href="">
<i class="fa fa-spinner spin"></i> <span class="gl-spinner"></span>
</a> </a>
<a class="new-project-item-select-button"> <a class="new-project-item-select-button">
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</a> </a>
</div> </div>
import Vue from 'vue'; import Vue from 'vue';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlLoadingIcon } from '@gitlab/ui';
import { setHTMLFixture } from 'helpers/fixtures'; import { setHTMLFixture } from 'helpers/fixtures';
import PipelineStore from '~/pipelines/stores/pipeline_store'; import PipelineStore from '~/pipelines/stores/pipeline_store';
import GraphComponentLegacy from '~/pipelines/components/graph/graph_component_legacy.vue'; import GraphComponentLegacy from '~/pipelines/components/graph/graph_component_legacy.vue';
...@@ -42,7 +43,7 @@ describe('graph component', () => { ...@@ -42,7 +43,7 @@ describe('graph component', () => {
}, },
}); });
expect(wrapper.find('.gl-spinner').exists()).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
}); });
...@@ -85,7 +86,7 @@ describe('graph component', () => { ...@@ -85,7 +86,7 @@ describe('graph component', () => {
}); });
it('should not include the loading icon', () => { it('should not include the loading icon', () => {
expect(wrapper.find('.fa-spinner').exists()).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
}); });
it('should include the stage column', () => { it('should include the stage column', () => {
......
...@@ -7,7 +7,8 @@ module Spec ...@@ -7,7 +7,8 @@ module Spec
module MergeRequestHelpers module MergeRequestHelpers
def preload_view_requirements(merge_request, note) def preload_view_requirements(merge_request, note)
# This will load the status fields of the author of the note and merge request # This will load the status fields of the author of the note and merge request
# to avoid queries in when rendering the view being tested. # to avoid queries when rendering the view being tested.
#
merge_request.author.status merge_request.author.status
note.author.status note.author.status
end end
......
...@@ -22,7 +22,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do ...@@ -22,7 +22,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
} }
within '.gpg-status-box' do within '.gpg-status-box' do
expect(page).not_to have_css('i.fa.fa-spinner.fa-spin') expect(page).not_to have_css('.gl-spinner')
end end
end end
end end
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_state do RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_state do
subject { described_class.new } let_it_be(:remote_mirror) { create(:remote_mirror) }
let(:remote_mirror) { create(:remote_mirror) }
let(:scheduled_time) { Time.current - 5.minutes } let(:scheduled_time) { Time.current - 5.minutes }
around do |example| around do |example|
...@@ -19,6 +18,8 @@ RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_st ...@@ -19,6 +18,8 @@ RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_st
end end
describe '#perform' do describe '#perform' do
subject { described_class.new }
it 'calls out to the service to perform the update' do it 'calls out to the service to perform the update' do
expect_mirror_service_to_return(remote_mirror, status: :success) expect_mirror_service_to_return(remote_mirror, status: :success)
...@@ -68,4 +69,8 @@ RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_st ...@@ -68,4 +69,8 @@ RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_st
subject.perform(remote_mirror.id, scheduled_time) subject.perform(remote_mirror.id, scheduled_time)
end end
end end
include_examples 'an idempotent worker' do
let(:job_args) { [remote_mirror.id, scheduled_time] }
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment