summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--README.md2
-rw-r--r--app/assets/javascripts/monitoring/components/embeds/embed_group.vue11
-rw-r--r--app/assets/javascripts/packages/details/components/package_title.vue10
-rw-r--r--app/assets/javascripts/packages/shared/components/package_tags.vue2
-rw-r--r--app/assets/javascripts/vue_shared/components/markdown/field.vue2
-rw-r--r--app/assets/javascripts/vue_shared/components/markdown/header.vue2
-rw-r--r--app/assets/stylesheets/framework/lists.scss6
-rw-r--r--app/assets/stylesheets/pages/members.scss4
-rw-r--r--app/controllers/graphql_controller.rb2
-rw-r--r--app/controllers/projects/merge_requests/content_controller.rb6
-rw-r--r--app/graphql/mutations/base_mutation.rb4
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/views/shared/_zen.html.haml2
-rw-r--r--app/views/shared/blob/_markdown_buttons.html.haml2
-rw-r--r--app/views/shared/members/_member.html.haml2
-rw-r--r--changelogs/unreleased/225656-package-detail-view-update-the-order-of-the-header-metadata-to-imp.yml5
-rw-r--r--changelogs/unreleased/238723-migrate-instances-of-expand-and-compress-icons-to-maximize-and-min.yml6
-rw-r--r--changelogs/unreleased/id-increase-poll-interval-for-merged-mrs.yml5
-rw-r--r--doc/administration/geo/replication/database.md4
-rw-r--r--doc/administration/geo/replication/geo_validation_tests.md12
-rw-r--r--doc/development/api_graphql_styleguide.md44
-rw-r--r--lib/gitlab/ci/templates/npm.gitlab-ci.yml2
-rw-r--r--locale/gitlab.pot3
-rwxr-xr-xscripts/trigger-build6
-rw-r--r--spec/controllers/graphql_controller_spec.rb22
-rw-r--r--spec/controllers/projects/merge_requests/content_controller_spec.rb3
-rw-r--r--spec/frontend/monitoring/components/embeds/embed_group_spec.js8
-rw-r--r--spec/frontend/packages/details/components/__snapshots__/package_title_spec.js.snap39
-rw-r--r--spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap2
-rw-r--r--spec/models/repository_spec.rb1
31 files changed, 167 insertions, 56 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index 9a336d1b698..4d339815e2f 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-56251315578cd17c0ceebcb911e8d3ddb159afca
+78d2b0cdb08b0e45de5324e2ac992282b7ecf691
diff --git a/README.md b/README.md
index 51a54c3bbff..3e6ac1bf689 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,7 @@ GitLab is a Ruby on Rails application that runs on the following software:
- Ubuntu/Debian/CentOS/RHEL/OpenSUSE
- Ruby (MRI) 2.6.5
- Git 2.8.4+
-- Redis 2.8+
+- Redis 4.0+
- PostgreSQL 11+
For more information please see the [architecture](https://docs.gitlab.com/ee/development/architecture.html) and [requirements](https://docs.gitlab.com/ee/install/requirements.html) documentation.
diff --git a/app/assets/javascripts/monitoring/components/embeds/embed_group.vue b/app/assets/javascripts/monitoring/components/embeds/embed_group.vue
index b60c87fee82..f07483c34b8 100644
--- a/app/assets/javascripts/monitoring/components/embeds/embed_group.vue
+++ b/app/assets/javascripts/monitoring/components/embeds/embed_group.vue
@@ -1,14 +1,14 @@
<script>
import { mapState, mapActions, mapGetters } from 'vuex';
import sum from 'lodash/sum';
-import { GlDeprecatedButton, GlCard, GlIcon } from '@gitlab/ui';
+import { GlButton, GlCard, GlIcon } from '@gitlab/ui';
import { n__ } from '~/locale';
import { monitoringDashboard } from '~/monitoring/stores';
import MetricEmbed from './metric_embed.vue';
export default {
components: {
- GlDeprecatedButton,
+ GlButton,
GlCard,
GlIcon,
MetricEmbed,
@@ -78,15 +78,16 @@ export default {
:body-class="bodyClass"
>
<template #header>
- <gl-deprecated-button
- class="collapsible-card-btn d-flex text-decoration-none"
+ <gl-button
+ class="collapsible-card-btn gl-display-flex gl-text-decoration-none gl-reset-color! gl-hover-text-blue-800! gl-shadow-none!"
:aria-label="buttonLabel"
variant="link"
+ category="tertiary"
@click="toggleCollapsed"
>
<gl-icon class="mr-1" :name="arrowIconName" />
{{ buttonLabel }}
- </gl-deprecated-button>
+ </gl-button>
</template>
<div class="d-flex flex-wrap">
<metric-embed
diff --git a/app/assets/javascripts/packages/details/components/package_title.vue b/app/assets/javascripts/packages/details/components/package_title.vue
index d07883e3e7a..9a7b86a4c25 100644
--- a/app/assets/javascripts/packages/details/components/package_title.vue
+++ b/app/assets/javascripts/packages/details/components/package_title.vue
@@ -74,8 +74,9 @@ export default {
<span data-testid="package-type" class="gl-font-weight-bold">{{ packageTypeDisplay }}</span>
</div>
- <div v-if="hasTagsToDisplay" class="gl-display-flex gl-align-items-center gl-mr-5">
- <package-tags :tag-display-limit="1" :tags="packageEntity.tags" />
+ <div class="gl-display-flex gl-align-items-center gl-mr-5">
+ <gl-icon name="disk" class="gl-text-gray-500 gl-mr-3" />
+ <span data-testid="package-size" class="gl-font-weight-bold">{{ totalSize }}</span>
</div>
<div v-if="packagePipeline" class="gl-display-flex gl-align-items-center gl-mr-5">
@@ -103,9 +104,8 @@ export default {
>
</div>
- <div class="gl-display-flex gl-align-items-center gl-mr-5">
- <gl-icon name="disk" class="gl-text-gray-500 gl-mr-3" />
- <span data-testid="package-size" class="gl-font-weight-bold">{{ totalSize }}</span>
+ <div v-if="hasTagsToDisplay" class="gl-display-flex gl-align-items-center gl-mr-5">
+ <package-tags :tag-display-limit="2" :tags="packageEntity.tags" hide-label />
</div>
</div>
</div>
diff --git a/app/assets/javascripts/packages/shared/components/package_tags.vue b/app/assets/javascripts/packages/shared/components/package_tags.vue
index 391f53c225b..f51ca26abf2 100644
--- a/app/assets/javascripts/packages/shared/components/package_tags.vue
+++ b/app/assets/javascripts/packages/shared/components/package_tags.vue
@@ -80,6 +80,7 @@ export default {
data-testid="tagBadge"
:class="tagBadgeClass(index)"
variant="info"
+ size="sm"
>{{ tag.name }}</gl-badge
>
@@ -89,6 +90,7 @@ export default {
data-testid="moreBadge"
variant="muted"
:title="moreTagsTooltip"
+ size="sm"
class="gl-display-none d-md-flex gl-ml-2"
><gl-sprintf :message="__('+%{tags} more')">
<template #tags>
diff --git a/app/assets/javascripts/vue_shared/components/markdown/field.vue b/app/assets/javascripts/vue_shared/components/markdown/field.vue
index 6df0119c3db..f6b8b57f944 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/field.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/field.vue
@@ -254,7 +254,7 @@ export default {
href="#"
:aria-label="__('Leave zen mode')"
>
- <icon :size="16" name="screen-normal" />
+ <icon :size="16" name="minimize" />
</a>
<markdown-toolbar
:markdown-docs-path="markdownDocsPath"
diff --git a/app/assets/javascripts/vue_shared/components/markdown/header.vue b/app/assets/javascripts/vue_shared/components/markdown/header.vue
index 7e6edcfbd25..77443d6301e 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/header.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/header.vue
@@ -221,7 +221,7 @@ export default {
:title="__('Go full screen')"
type="button"
>
- <icon name="screen-full" />
+ <icon name="maximize" />
</button>
</div>
</li>
diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss
index 9d67b175294..738150dbd2e 100644
--- a/app/assets/stylesheets/framework/lists.scss
+++ b/app/assets/stylesheets/framework/lists.scss
@@ -132,10 +132,10 @@ ul.content-list {
a {
color: $gl-text-color;
+ }
- &.inline-link {
- color: $blue-600;
- }
+ .member-group-link {
+ color: $blue-600;
}
.description {
diff --git a/app/assets/stylesheets/pages/members.scss b/app/assets/stylesheets/pages/members.scss
index 2d9a9f3029f..54bca80194f 100644
--- a/app/assets/stylesheets/pages/members.scss
+++ b/app/assets/stylesheets/pages/members.scss
@@ -180,6 +180,10 @@
word-break: break-all;
}
+ .member-group-link {
+ display: inline-block;
+ }
+
.form-control {
width: inherit;
}
diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb
index a1348e4d858..eb26073a53c 100644
--- a/app/controllers/graphql_controller.rb
+++ b/app/controllers/graphql_controller.rb
@@ -81,7 +81,7 @@ class GraphqlController < ApplicationController
end
def context
- @context ||= { current_user: current_user }
+ @context ||= { current_user: current_user, is_sessionless_user: !!sessionless_user? }
end
def build_variables(variable_info)
diff --git a/app/controllers/projects/merge_requests/content_controller.rb b/app/controllers/projects/merge_requests/content_controller.rb
index eec5c1a4355..399745151b1 100644
--- a/app/controllers/projects/merge_requests/content_controller.rb
+++ b/app/controllers/projects/merge_requests/content_controller.rb
@@ -10,6 +10,9 @@ class Projects::MergeRequests::ContentController < Projects::MergeRequests::Appl
before_action :set_polling_header
around_action :allow_gitaly_ref_name_caching
+ FAST_POLLING_INTERVAL = 10.seconds.in_milliseconds
+ SLOW_POLLING_INTERVAL = 5.minutes.in_milliseconds
+
def widget
respond_to do |format|
format.json do
@@ -29,7 +32,8 @@ class Projects::MergeRequests::ContentController < Projects::MergeRequests::Appl
private
def set_polling_header
- Gitlab::PollingInterval.set_header(response, interval: 10_000)
+ interval = merge_request.open? ? FAST_POLLING_INTERVAL : SLOW_POLLING_INTERVAL
+ Gitlab::PollingInterval.set_header(response, interval: interval)
end
def serializer(entity)
diff --git a/app/graphql/mutations/base_mutation.rb b/app/graphql/mutations/base_mutation.rb
index 68e7853a9b1..577f10545b3 100644
--- a/app/graphql/mutations/base_mutation.rb
+++ b/app/graphql/mutations/base_mutation.rb
@@ -17,6 +17,10 @@ module Mutations
context[:current_user]
end
+ def api_user?
+ context[:is_sessionless_user]
+ end
+
# Returns Array of errors on an ActiveRecord object
def errors_on_object(record)
record.errors.full_messages
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 07122db36b3..ef17e010ba8 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -214,7 +214,7 @@ class Repository
return false if with_slash.empty?
prefixes = no_slash.map { |ref| Regexp.escape(ref) }.join('|')
- prefix_regex = %r{^#{prefixes}/}
+ prefix_regex = %r{^(#{prefixes})/}
with_slash.any? do |ref|
prefix_regex.match?(ref)
diff --git a/app/views/shared/_zen.html.haml b/app/views/shared/_zen.html.haml
index 66e0ecadb65..9cf189e8120 100644
--- a/app/views/shared/_zen.html.haml
+++ b/app/views/shared/_zen.html.haml
@@ -16,4 +16,4 @@
- else
= text_area_tag attr, current_text, data: { qa_selector: qa_selector }, class: classes, placeholder: placeholder
%a.zen-control.zen-control-leave.js-zen-leave.gl-text-gray-500{ href: "#" }
- = sprite_icon('compress')
+ = sprite_icon('minimize')
diff --git a/app/views/shared/blob/_markdown_buttons.html.haml b/app/views/shared/blob/_markdown_buttons.html.haml
index c1ffdc7184a..32fd732cda9 100644
--- a/app/views/shared/blob/_markdown_buttons.html.haml
+++ b/app/views/shared/blob/_markdown_buttons.html.haml
@@ -10,4 +10,4 @@
= markdown_toolbar_button({ icon: "table", data: { "md-tag" => "| header | header |\n| ------ | ------ |\n| cell | cell |\n| cell | cell |", "md-prepend" => true }, title: _("Add a table") })
- if show_fullscreen_button
%button.toolbar-btn.toolbar-fullscreen-btn.js-zen-enter.has-tooltip{ type: "button", tabindex: -1, "aria-label": "Go full screen", title: _("Go full screen"), data: { container: "body" } }
- = sprite_icon("screen-full")
+ = sprite_icon("maximize")
diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml
index fa71f4dc9b9..20473b47484 100644
--- a/app/views/shared/members/_member.html.haml
+++ b/app/views/shared/members/_member.html.haml
@@ -33,7 +33,7 @@
- if source.instance_of?(Group) && source != @group
&middot;
- = link_to source.full_name, source, class: "gl-display-inline-block inline-link"
+ = link_to source.full_name, source, class: "member-group-link"
.cgray
- if member.request?
diff --git a/changelogs/unreleased/225656-package-detail-view-update-the-order-of-the-header-metadata-to-imp.yml b/changelogs/unreleased/225656-package-detail-view-update-the-order-of-the-header-metadata-to-imp.yml
new file mode 100644
index 00000000000..8f025d6f7de
--- /dev/null
+++ b/changelogs/unreleased/225656-package-detail-view-update-the-order-of-the-header-metadata-to-imp.yml
@@ -0,0 +1,5 @@
+---
+title: Update order of the Header Metadata in Package details
+merge_request: 39585
+author:
+type: changed
diff --git a/changelogs/unreleased/238723-migrate-instances-of-expand-and-compress-icons-to-maximize-and-min.yml b/changelogs/unreleased/238723-migrate-instances-of-expand-and-compress-icons-to-maximize-and-min.yml
new file mode 100644
index 00000000000..d8075078c26
--- /dev/null
+++ b/changelogs/unreleased/238723-migrate-instances-of-expand-and-compress-icons-to-maximize-and-min.yml
@@ -0,0 +1,6 @@
+---
+title: Syncronize use of maximize and minimize icons in order to deprecate duplicates
+ with different names
+merge_request: 39889
+author:
+type: other
diff --git a/changelogs/unreleased/id-increase-poll-interval-for-merged-mrs.yml b/changelogs/unreleased/id-increase-poll-interval-for-merged-mrs.yml
new file mode 100644
index 00000000000..381243fbd68
--- /dev/null
+++ b/changelogs/unreleased/id-increase-poll-interval-for-merged-mrs.yml
@@ -0,0 +1,5 @@
+---
+title: Increase poll interval for merged MRs widget
+merge_request: 39961
+author:
+type: performance
diff --git a/doc/administration/geo/replication/database.md b/doc/administration/geo/replication/database.md
index 0bc37ce6438..dd4bbafa54c 100644
--- a/doc/administration/geo/replication/database.md
+++ b/doc/administration/geo/replication/database.md
@@ -78,6 +78,10 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
1. GitLab 10.4 and up only: Do the following to make sure the `gitlab` database user has a password defined:
+ NOTE: **Note:**
+ Until FDW settings are removed in GitLab version 14.0, avoid using single or double quotes in the
+ password for PostgreSQL as that will lead to errors when reconfiguring.
+
Generate a MD5 hash of the desired password:
```shell
diff --git a/doc/administration/geo/replication/geo_validation_tests.md b/doc/administration/geo/replication/geo_validation_tests.md
index 323f6f367b1..8247b8c6336 100644
--- a/doc/administration/geo/replication/geo_validation_tests.md
+++ b/doc/administration/geo/replication/geo_validation_tests.md
@@ -158,3 +158,15 @@ The following are PostgreSQL upgrade validation tests we performed.
- [`gitlab-ctl` reconfigure fails on Redis node in multi-node Geo setup](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4706).
- [Geo multi-node upgrade from 12.0.9 to 12.1.9 does not upgrade PostgreSQL](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4705).
- [Refresh foreign tables fails on app server in multi-node setup after upgrade to 12.1.9](https://gitlab.com/gitlab-org/gitlab/-/issues/32119).
+
+## Other tests
+
+The following are additional validation tests we performed.
+
+### August 2020
+
+[Test Gitaly Cluster on a Geo Deployment](https://gitlab.com/gitlab-org/gitlab/-/issues/223210):
+
+- Description: Tested a Geo deployment with Gitaly clusters configured on both the primary and secondary Geo sites. Triggered automatic Gitaly cluster failover on the primary Geo site, and ran end-to-end Geo tests. Then triggered Gitaly cluster failover on the secondary Geo site, and re-ran the end-to-end Geo tests.
+
+- Outcome: Successful end-to-end tests before and after Gitaly cluster failover on the primary site, and before and after Gitaly cluster failover on the secondary site.
diff --git a/doc/development/api_graphql_styleguide.md b/doc/development/api_graphql_styleguide.md
index bf2d6400f56..65ee46ac804 100644
--- a/doc/development/api_graphql_styleguide.md
+++ b/doc/development/api_graphql_styleguide.md
@@ -14,7 +14,7 @@ which is exposed as an API endpoint at `/api/graphql`.
In March 2019, Nick Thomas hosted a Deep Dive (GitLab team members only: `https://gitlab.com/gitlab-org/create-stage/issues/1`)
on GitLab's [GraphQL API](../api/graphql/index.md) to share his domain specific knowledge
-with anyone who may work in this part of the code base in the future. You can find the
+with anyone who may work in this part of the codebase in the future. You can find the
[recording on YouTube](https://www.youtube.com/watch?v=-9L_1MWrjkg), and the slides on
[Google Slides](https://docs.google.com/presentation/d/1qOTxpkTdHIp1CRjuTvO-aXg0_rUtzE3ETfLUdnBB5uQ/edit)
and in [PDF](https://gitlab.com/gitlab-org/create-stage/uploads/8e78ea7f326b2ef649e7d7d569c26d56/GraphQL_Deep_Dive__Create_.pdf).
@@ -33,7 +33,7 @@ Authentication happens through the `GraphqlController`, right now this
uses the same authentication as the Rails application. So the session
can be shared.
-It is also possible to add a `private_token` to the querystring, or
+It's also possible to add a `private_token` to the query string, or
add a `HTTP_PRIVATE_TOKEN` header.
## Global IDs
@@ -75,7 +75,7 @@ The `iid`, `title` and `description` are _scalar_ GraphQL types.
When exposing a model through the GraphQL API, we do so by creating a
new type in `app/graphql/types`. You can also declare custom GraphQL data types
-for scalar data types (e.g. `TimeType`).
+for scalar data types (for example `TimeType`).
When exposing properties in a type, make sure to keep the logic inside
the definition as minimal as possible. Instead, consider moving any
@@ -760,6 +760,44 @@ to advertise the need for lookahead:
For an example of real world use, please
see [`ResolvesMergeRequests`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/graphql/resolvers/concerns/resolves_merge_requests.rb).
+## Pass a parent object into a child Presenter
+
+Sometimes you need to access the resolved query parent in a child context to compute fields. Usually the parent is only
+available in the `Resolver` class as `parent`.
+
+To find the parent object in your `Presenter` class:
+
+1. Add the parent object to the GraphQL `context` from within your resolver's `resolve` method:
+
+ ```ruby
+ def resolve(**args)
+ context[:parent_object] = parent
+ end
+ ```
+
+1. Declare that your fields require the `parent` field context. For example:
+
+ ```ruby
+ # in ChildType
+ field :computed_field, SomeType, null: true,
+ method: :my_computing_method,
+ extras: [:parent], # Necessary
+ description: 'My field description'
+ ```
+
+1. Declare your field's method in your Presenter class and have it accept the `parent` keyword argument.
+This argument contains the parent **GraphQL context**, so you have to access the parent object with
+`parent[:parent_object]` or whatever key you used in your `Resolver`:
+
+ ```ruby
+ # in ChildPresenter
+ def my_computing_method(parent:)
+ # do something with `parent[:parent_object]` here
+ end
+ ```
+
+For an example of real-world use, check [this MR that added `scopedPath` and `scopedUrl` to `IterationPresenter`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39543)
+
## Mutations
Mutations are used to change any stored values, or to trigger
diff --git a/lib/gitlab/ci/templates/npm.gitlab-ci.yml b/lib/gitlab/ci/templates/npm.gitlab-ci.yml
index 035ba52da84..0a739cf122d 100644
--- a/lib/gitlab/ci/templates/npm.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/npm.gitlab-ci.yml
@@ -55,5 +55,5 @@ publish_package:
npm publish &&
echo "Successfully published version ${NPM_PACKAGE_VERSION} of ${NPM_PACKAGE_NAME} to GitLab's NPM registry: ${CI_PROJECT_URL}/-/packages"
} || {
- echo "No new version of ${NPM_PACKAGE_NAME} published. This is most likely because version ${NPM_PACKAGE_VERSION} already exists in GitLab's NPM registry."
+ echo "No new version of ${NPM_PACKAGE_NAME} published. This is most likely because version ${NPM_PACKAGE_VERSION} already exists in GitLab's NPM registry."; exit 1
}
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index a80a35e3f7b..050b08dc32f 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -12587,9 +12587,6 @@ msgstr ""
msgid "How many users will be evaluating the trial?"
msgstr ""
-msgid "How to upgrade"
-msgstr ""
-
msgid "However, you are already a member of this %{member_source}. Sign in using a different account to accept the invitation."
msgstr ""
diff --git a/scripts/trigger-build b/scripts/trigger-build
index 7fc550d86ee..633e4dda808 100755
--- a/scripts/trigger-build
+++ b/scripts/trigger-build
@@ -138,8 +138,12 @@ module Trigger
def extra_variables
# Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for omnibus checkouts due to pipeline for merged results
# and fallback to CI_COMMIT_SHA for the `detached` pipelines.
+ # We also set IMAGE_TAG so the GitLab and QA docker images are tagged with
+ # that SHA.
+ source_sha = Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
{
- 'GITLAB_VERSION' => Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA'],
+ 'GITLAB_VERSION' => source_sha,
+ 'IMAGE_TAG' => source_sha,
'ALTERNATIVE_SOURCES' => 'true',
'SECURITY_SOURCES' => Trigger.security? ? 'true' : 'false',
'ee' => Trigger.ee? ? 'true' : 'false',
diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb
index c5643f96b7a..645bb3f8d77 100644
--- a/spec/controllers/graphql_controller_spec.rb
+++ b/spec/controllers/graphql_controller_spec.rb
@@ -60,14 +60,28 @@ RSpec.describe GraphqlController do
it 'updates the users last_activity_on field' do
expect { post :execute }.to change { user.reload.last_activity_on }
end
+
+ it "sets context's sessionless value as false" do
+ post :execute
+
+ expect(assigns(:context)[:is_sessionless_user]).to be false
+ end
end
context 'when user uses an API token' do
let(:user) { create(:user, last_activity_on: Date.yesterday) }
let(:token) { create(:personal_access_token, user: user, scopes: [:api]) }
+ subject { post :execute, params: { access_token: token.token } }
+
it 'updates the users last_activity_on field' do
- expect { post :execute, params: { access_token: token.token } }.to change { user.reload.last_activity_on }
+ expect { subject }.to change { user.reload.last_activity_on }
+ end
+
+ it "sets context's sessionless value as true" do
+ subject
+
+ expect(assigns(:context)[:is_sessionless_user]).to be true
end
end
@@ -77,6 +91,12 @@ RSpec.describe GraphqlController do
expect(response).to have_gitlab_http_status(:ok)
end
+
+ it "sets context's sessionless value as false" do
+ post :execute
+
+ expect(assigns(:context)[:is_sessionless_user]).to be false
+ end
end
end
diff --git a/spec/controllers/projects/merge_requests/content_controller_spec.rb b/spec/controllers/projects/merge_requests/content_controller_spec.rb
index 7fb20b4666a..af1682759cf 100644
--- a/spec/controllers/projects/merge_requests/content_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests/content_controller_spec.rb
@@ -48,6 +48,8 @@ RSpec.describe Projects::MergeRequests::ContentController do
expect(merge_request).to receive(:check_mergeability)
do_request(:widget)
+
+ expect(response.headers['Poll-Interval']).to eq('10000')
end
context 'merged merge request' do
@@ -59,6 +61,7 @@ RSpec.describe Projects::MergeRequests::ContentController do
do_request(:widget)
expect(response).to match_response_schema('entities/merge_request_poll_widget')
+ expect(response.headers['Poll-Interval']).to eq('300000')
end
end
end
diff --git a/spec/frontend/monitoring/components/embeds/embed_group_spec.js b/spec/frontend/monitoring/components/embeds/embed_group_spec.js
index 49c10483c45..54d21def603 100644
--- a/spec/frontend/monitoring/components/embeds/embed_group_spec.js
+++ b/spec/frontend/monitoring/components/embeds/embed_group_spec.js
@@ -1,6 +1,6 @@
import { createLocalVue, mount, shallowMount } from '@vue/test-utils';
import Vuex from 'vuex';
-import { GlDeprecatedButton, GlCard } from '@gitlab/ui';
+import { GlButton, GlCard } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import EmbedGroup from '~/monitoring/components/embeds/embed_group.vue';
import MetricEmbed from '~/monitoring/components/embeds/metric_embed.vue';
@@ -80,7 +80,7 @@ describe('Embed Group', () => {
metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
- wrapper.find(GlDeprecatedButton).trigger('click');
+ wrapper.find(GlButton).trigger('click');
wrapper.vm.$nextTick(() => {
expect(wrapper.find('.card-body').classes()).toContain('d-none');
@@ -150,14 +150,14 @@ describe('Embed Group', () => {
metricsWithDataGetter.mockReturnValue([1]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
- expect(wrapper.find(GlDeprecatedButton).text()).toBe('Hide chart');
+ expect(wrapper.find(GlButton).text()).toBe('Hide chart');
});
it('has a plural label when there are multiple embeds', () => {
metricsWithDataGetter.mockReturnValue([2]);
mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } });
- expect(wrapper.find(GlDeprecatedButton).text()).toBe('Hide charts');
+ expect(wrapper.find(GlButton).text()).toBe('Hide charts');
});
});
});
diff --git a/spec/frontend/packages/details/components/__snapshots__/package_title_spec.js.snap b/spec/frontend/packages/details/components/__snapshots__/package_title_spec.js.snap
index bdcd4a9e077..313de1dfbe7 100644
--- a/spec/frontend/packages/details/components/__snapshots__/package_title_spec.js.snap
+++ b/spec/frontend/packages/details/components/__snapshots__/package_title_spec.js.snap
@@ -59,19 +59,6 @@ exports[`PackageTitle renders with tags 1`] = `
<div
class="gl-display-flex gl-align-items-center gl-mr-5"
>
- <package-tags-stub
- tagdisplaylimit="1"
- tags="[object Object],[object Object],[object Object],[object Object]"
- />
- </div>
-
- <!---->
-
- <!---->
-
- <div
- class="gl-display-flex gl-align-items-center gl-mr-5"
- >
<gl-icon-stub
class="gl-text-gray-500 gl-mr-3"
name="disk"
@@ -85,6 +72,20 @@ exports[`PackageTitle renders with tags 1`] = `
300 bytes
</span>
</div>
+
+ <!---->
+
+ <!---->
+
+ <div
+ class="gl-display-flex gl-align-items-center gl-mr-5"
+ >
+ <package-tags-stub
+ hidelabel="true"
+ tagdisplaylimit="2"
+ tags="[object Object],[object Object],[object Object],[object Object]"
+ />
+ </div>
</div>
</div>
`;
@@ -145,12 +146,6 @@ exports[`PackageTitle renders without tags 1`] = `
</span>
</div>
- <!---->
-
- <!---->
-
- <!---->
-
<div
class="gl-display-flex gl-align-items-center gl-mr-5"
>
@@ -167,6 +162,12 @@ exports[`PackageTitle renders without tags 1`] = `
300 bytes
</span>
</div>
+
+ <!---->
+
+ <!---->
+
+ <!---->
</div>
</div>
`;
diff --git a/spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap b/spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap
index 6020d595e3f..82d0c87082f 100644
--- a/spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap
+++ b/spec/frontend/snippets/components/__snapshots__/snippet_description_edit_spec.js.snap
@@ -64,7 +64,7 @@ exports[`Snippet Description Edit component rendering matches the snapshot 1`] =
href="#"
>
<icon-stub
- name="screen-normal"
+ name="minimize"
size="16"
/>
</a>
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index a6b79e55f02..a3042d619eb 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -1263,6 +1263,7 @@ RSpec.describe Repository do
%w(a b c/z) | %w(c d) | true
%w(a/b/z) | %w(a/b) | false # we only consider refs ambiguous before the first slash
%w(a/b/z) | %w(a/b a) | true
+ %w(ab) | %w(abc/d a b) | false
end
with_them do