Commit bba525d0 authored by Clement Ho's avatar Clement Ho

Merge branch 'ce-to-ee-2018-02-21' into 'master'

CE upstream - 2018-02-21 18:26 UTC

See merge request gitlab-org/gitlab-ee!4657
parents 24ad9469 da55884c
...@@ -686,7 +686,9 @@ codequality: ...@@ -686,7 +686,9 @@ codequality:
cache: {} cache: {}
dependencies: [] dependencies: []
script: script:
- ./scripts/codequality analyze -f json > codeclimate.json || true - ./scripts/codequality analyze -f json > raw_codeclimate.json || true
# The following line keeps only the fields used in the MR widget, reducing the JSON artifact size
- cat raw_codeclimate.json | docker run -i stedolan/jq -c 'map({check_name,description,fingerprint,location})' > codeclimate.json
artifacts: artifacts:
paths: [codeclimate.json] paths: [codeclimate.json]
expire_in: 1 week expire_in: 1 week
......
...@@ -84,7 +84,7 @@ gem 'gollum-lib', '~> 4.2', require: false ...@@ -84,7 +84,7 @@ gem 'gollum-lib', '~> 4.2', require: false
gem 'gollum-rugged_adapter', '~> 0.4.4', require: false gem 'gollum-rugged_adapter', '~> 0.4.4', require: false
# Language detection # Language detection
gem 'github-linguist', '~> 4.7.0', require: 'linguist' gem 'github-linguist', '~> 5.3.3', require: 'linguist'
# API # API
gem 'grape', '~> 1.0' gem 'grape', '~> 1.0'
...@@ -430,7 +430,7 @@ gem 'gitaly-proto', '~> 0.84.0', require: 'gitaly' ...@@ -430,7 +430,7 @@ gem 'gitaly-proto', '~> 0.84.0', require: 'gitaly'
# Locked until https://github.com/google/protobuf/issues/4210 is closed # Locked until https://github.com/google/protobuf/issues/4210 is closed
gem 'google-protobuf', '= 3.5.1' gem 'google-protobuf', '= 3.5.1'
gem 'toml-rb', '~> 0.3.15', require: false gem 'toml-rb', '~> 1.0.0', require: false
# Feature toggles # Feature toggles
gem 'flipper', '~> 0.11.0' gem 'flipper', '~> 0.11.0'
......
...@@ -312,11 +312,11 @@ GEM ...@@ -312,11 +312,11 @@ GEM
gitaly-proto (0.84.0) gitaly-proto (0.84.0)
google-protobuf (~> 3.1) google-protobuf (~> 3.1)
grpc (~> 1.0) grpc (~> 1.0)
github-linguist (4.7.6) github-linguist (5.3.3)
charlock_holmes (~> 0.7.3) charlock_holmes (~> 0.7.5)
escape_utils (~> 1.1.0) escape_utils (~> 1.1.0)
mime-types (>= 1.19) mime-types (>= 1.19)
rugged (>= 0.23.0b) rugged (>= 0.25.1)
github-markup (1.6.1) github-markup (1.6.1)
gitlab-flowdock-git-hook (1.0.1) gitlab-flowdock-git-hook (1.0.1)
flowdock (~> 0.7) flowdock (~> 0.7)
...@@ -953,7 +953,7 @@ GEM ...@@ -953,7 +953,7 @@ GEM
timfel-krb5-auth (0.8.3) timfel-krb5-auth (0.8.3)
toml (0.1.2) toml (0.1.2)
parslet (~> 1.5.0) parslet (~> 1.5.0)
toml-rb (0.3.15) toml-rb (1.0.0)
citrus (~> 3.0, > 3.0) citrus (~> 3.0, > 3.0)
truncato (0.7.10) truncato (0.7.10)
htmlentities (~> 4.3.1) htmlentities (~> 4.3.1)
...@@ -1092,7 +1092,7 @@ DEPENDENCIES ...@@ -1092,7 +1092,7 @@ DEPENDENCIES
gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.2.0) gettext_i18n_rails_js (~> 1.2.0)
gitaly-proto (~> 0.84.0) gitaly-proto (~> 0.84.0)
github-linguist (~> 4.7.0) github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1) gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-license (~> 1.0) gitlab-license (~> 1.0)
gitlab-markup (~> 1.6.2) gitlab-markup (~> 1.6.2)
...@@ -1238,7 +1238,7 @@ DEPENDENCIES ...@@ -1238,7 +1238,7 @@ DEPENDENCIES
test_after_commit (~> 1.1) test_after_commit (~> 1.1)
thin (~> 1.7.0) thin (~> 1.7.0)
timecop (~> 0.8.0) timecop (~> 0.8.0)
toml-rb (~> 0.3.15) toml-rb (~> 1.0.0)
truncato (~> 0.7.9) truncato (~> 0.7.9)
u2f (~> 0.2.1) u2f (~> 0.2.1)
uglifier (~> 2.7.2) uglifier (~> 2.7.2)
......
...@@ -167,7 +167,7 @@ label { ...@@ -167,7 +167,7 @@ label {
.input-group { .input-group {
.select2-container { .select2-container {
display: table-cell; display: table-cell;
width: 200px !important; max-width: 180px;
} }
.input-group-addon { .input-group-addon {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
.select2-choice { .select2-choice {
background: $white-light; background: $white-light;
border-color: $input-border; border-color: $input-border;
height: 35px; height: 34px;
padding: $gl-vert-padding $gl-input-padding; padding: $gl-vert-padding $gl-input-padding;
font-size: $gl-font-size; font-size: $gl-font-size;
line-height: 1.42857143; line-height: 1.42857143;
......
...@@ -565,6 +565,7 @@ $jq-ui-default-color: #777; ...@@ -565,6 +565,7 @@ $jq-ui-default-color: #777;
/* /*
* Label * Label
*/ */
$label-font-size: 12px;
$label-padding: 7px; $label-padding: 7px;
$label-padding-modal: 10px; $label-padding-modal: 10px;
$label-gray-bg: #f8fafc; $label-gray-bg: #f8fafc;
......
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
.label { .label {
color: $gl-text-color; color: $gl-text-color;
font-size: inherit;
} }
iframe.twitter-share-button { iframe.twitter-share-button {
......
...@@ -102,12 +102,11 @@ ...@@ -102,12 +102,11 @@
.issuable-show-labels { .issuable-show-labels {
a { a {
margin-right: 5px;
margin-bottom: 5px; margin-bottom: 5px;
display: inline-block; display: inline-block;
.color-label { .color-label {
padding: 6px 10px; padding: 4px $grid-size;
border-radius: $label-border-radius; border-radius: $label-border-radius;
} }
......
...@@ -105,13 +105,16 @@ ...@@ -105,13 +105,16 @@
} }
.label { .label {
padding: 8px 12px; padding: 4px $grid-size;
font-size: 14px; font-size: $label-font-size;
position: relative;
top: ($grid-size / 2);
} }
} }
.color-label { .color-label {
padding: 3px $label-padding; padding: 0 $grid-size;
line-height: 16px;
border-radius: $label-border-radius; border-radius: $label-border-radius;
} }
...@@ -302,10 +305,11 @@ ...@@ -302,10 +305,11 @@
} }
.label-link { .label-link {
display: inline-block; display: inline-flex;
vertical-align: top; vertical-align: top;
.label { .label {
vertical-align: inherit; vertical-align: inherit;
font-size: $label-font-size;
} }
} }
...@@ -115,6 +115,10 @@ ...@@ -115,6 +115,10 @@
display: block; display: block;
margin-top: 7px; margin-top: 7px;
.issue-link {
display: inline-block;
}
.issuable-number { .issuable-number {
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
margin-right: 5px; margin-right: 5px;
......
...@@ -128,7 +128,6 @@ ...@@ -128,7 +128,6 @@
.label { .label {
color: $gl-text-color; color: $gl-text-color;
font-size: inherit;
} }
p { p {
......
...@@ -160,7 +160,7 @@ class Blob < SimpleDelegator ...@@ -160,7 +160,7 @@ class Blob < SimpleDelegator
if stored_externally? if stored_externally?
if rich_viewer if rich_viewer
rich_viewer.binary? rich_viewer.binary?
elsif Linguist::Language.find_by_filename(name).any? elsif Linguist::Language.find_by_extension(name).any?
false false
elsif _mime_type elsif _mime_type
_mime_type.binary? _mime_type.binary?
......
...@@ -687,8 +687,11 @@ ...@@ -687,8 +687,11 @@
= f.label :version_check_enabled do = f.label :version_check_enabled do
= f.check_box :version_check_enabled = f.check_box :version_check_enabled
Version check enabled Version check enabled
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/usage_statistics", anchor: "version-check")
.help-block .help-block
Let GitLab inform you when an update is available. Let GitLab inform you when an update is available. When
enabled, GitLab Inc. will collect info about your hostname
and version.
.form-group .form-group
.col-sm-offset-2.col-sm-10 .col-sm-offset-2.col-sm-10
- can_be_configured = @application_setting.usage_ping_can_be_configured? - can_be_configured = @application_setting.usage_ping_can_be_configured?
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
= confidential_icon(issuable) = confidential_icon(issuable)
= link_to issuable.title, issuable_url_args, title: issuable.title = link_to issuable.title, issuable_url_args, title: issuable.title
.issuable-detail .issuable-detail
= link_to [namespace, project, issuable] do = link_to [namespace, project, issuable], class: 'issue-link' do
%span.issuable-number= issuable.to_reference %span.issuable-number= issuable.to_reference
- labels.each do |label| - labels.each do |label|
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
// Fallback while content is loading // Fallback while content is loading
.title.hide-collapsed .title.hide-collapsed
= _('Time tracking') = _('Time tracking')
= icon('spinner spin', 'aria-hidden': 'true') = icon('spinner spin')
= render 'shared/milestones/weight', milestone: milestone = render 'shared/milestones/weight', milestone: milestone
......
---
title: Add missing pagination on the commit diff endpoint
merge_request: 17203
author: Maxime Roussin-Bélanger
type: fixed
---
title: Update to github-linguist 5.3.x
merge_request: 17241
author: Ken Ding
type: other
---
title: remove avater underline
merge_request: 17219
author: Ken Ding
type: fixed
---
title: update toml-rb to 1.0.0
merge_request: 17259
author: Ken Ding
type: other
---
title: Fix get a single pages domain when project path contains a period
merge_request: 17206
author: Travis Miller
type: fixed
---
title: Allow to call PUT /projects/:id API with only ci_config_path specified
merge_request: 17105
author: Laszlo Karpati
type: fixed
---
title: "#28481: Display time tracking totals on milestone page"
merge_request: 16753
author: Riccardo Padovani
type: added
---
title: Apply new default and inline label design
merge_request: 16956
author: George Tsiolis
type: changed
---
title: Fix new project path input overlapping
merge_request: 16755
author: George Tsiolis
type: fixed
---
title: Add more info about data collected when version check is enabled
merge_request: 17257
author:
type: changed
...@@ -5,5 +5,5 @@ Explore our features to monitor your GitLab instance: ...@@ -5,5 +5,5 @@ Explore our features to monitor your GitLab instance:
- [Performance monitoring](performance/index.md): GitLab Performance Monitoring makes it possible to measure a wide variety of statistics of your instance. - [Performance monitoring](performance/index.md): GitLab Performance Monitoring makes it possible to measure a wide variety of statistics of your instance.
- [Prometheus](prometheus/index.md): Prometheus is a powerful time-series monitoring service, providing a flexible platform for monitoring GitLab and other software products. - [Prometheus](prometheus/index.md): Prometheus is a powerful time-series monitoring service, providing a flexible platform for monitoring GitLab and other software products.
- [GitHub imports](github_imports.md): Monitor the health and progress of GitLab's GitHub importer with various Prometheus metrics. - [GitHub imports](github_imports.md): Monitor the health and progress of GitLab's GitHub importer with various Prometheus metrics.
- [Monitoring uptime](../user/admin_area/monitoring/health_check.md): Check the server status using the health check endpoint. - [Monitoring uptime](../../user/admin_area/monitoring/health_check.md): Check the server status using the health check endpoint.
- [IP whitelists](ip_whitelist.md): Configure GitLab for monitoring endpoints that provide health check information when probed. - [IP whitelists](ip_whitelist.md): Configure GitLab for monitoring endpoints that provide health check information when probed.
...@@ -276,7 +276,7 @@ To enable per-branch caching: ...@@ -276,7 +276,7 @@ To enable per-branch caching:
```yaml ```yaml
cache: cache:
key: "$CI_COMMIT_REF_NAME" key: "$CI_COMMIT_REF_SLUG"
untracked: true untracked: true
``` ```
...@@ -284,7 +284,7 @@ To enable per-job and per-branch caching: ...@@ -284,7 +284,7 @@ To enable per-job and per-branch caching:
```yaml ```yaml
cache: cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
untracked: true untracked: true
``` ```
...@@ -292,7 +292,7 @@ To enable per-branch and per-stage caching: ...@@ -292,7 +292,7 @@ To enable per-branch and per-stage caching:
```yaml ```yaml
cache: cache:
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME" key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
untracked: true untracked: true
``` ```
...@@ -301,7 +301,7 @@ If you use **Windows Batch** to run your shell scripts you need to replace ...@@ -301,7 +301,7 @@ If you use **Windows Batch** to run your shell scripts you need to replace
```yaml ```yaml
cache: cache:
key: "%CI_JOB_STAGE%-%CI_COMMIT_REF_NAME%" key: "%CI_JOB_STAGE%-%CI_COMMIT_REF_SLUG%"
untracked: true untracked: true
``` ```
...@@ -310,7 +310,7 @@ If you use **Windows PowerShell** to run your shell scripts you need to replace ...@@ -310,7 +310,7 @@ If you use **Windows PowerShell** to run your shell scripts you need to replace
```yaml ```yaml
cache: cache:
key: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME" key: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_SLUG"
untracked: true untracked: true
``` ```
......
...@@ -10,8 +10,9 @@ under **Admin area > Settings > Usage statistics**. ...@@ -10,8 +10,9 @@ under **Admin area > Settings > Usage statistics**.
GitLab can inform you when an update is available and the importance of it. GitLab can inform you when an update is available and the importance of it.
No information other than the GitLab version and the instance's hostname (through the HTTP referer) GitLab Inc. collects version statistics, but no information other than
are collected. the GitLab version and the instance's hostname (through the HTTP
referer) is collected.
In the **Overview** tab you can see if your GitLab version is up to date. There In the **Overview** tab you can see if your GitLab version is up to date. There
are three cases: 1) you are up to date (green), 2) there is an update available are three cases: 1) you are up to date (green), 2) there is an update available
......
...@@ -227,7 +227,7 @@ https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/user/markdown.md#emoji ...@@ -227,7 +227,7 @@ https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/user/markdown.md#emoji
If you are new to this, don't be :fearful:. You can easily join the emoji :family:. All you need to do is to look up on the supported codes. If you are new to this, don't be :fearful:. You can easily join the emoji :family:. All you need to do is to look up on the supported codes.
Consult the [Emoji Cheat Sheet](http://emoji.codes) for a list of all supported emoji codes. :thumbsup: Consult the [Emoji Cheat Sheet](https://www.emojicopy.com) for a list of all supported emoji codes. :thumbsup:
Sometimes you want to :monkey: around a bit and add some :star2: to your :speech_balloon:. Well we have a gift for you: Sometimes you want to :monkey: around a bit and add some :star2: to your :speech_balloon:. Well we have a gift for you:
...@@ -237,7 +237,7 @@ You can use it to point out a :bug: or warn about :speak_no_evil: patches. And i ...@@ -237,7 +237,7 @@ You can use it to point out a :bug: or warn about :speak_no_evil: patches. And i
If you are new to this, don't be :fearful:. You can easily join the emoji :family:. All you need to do is to look up on the supported codes. If you are new to this, don't be :fearful:. You can easily join the emoji :family:. All you need to do is to look up on the supported codes.
Consult the [Emoji Cheat Sheet](http://emoji.codes) for a list of all supported emoji codes. :thumbsup: Consult the [Emoji Cheat Sheet](https://www.emojicopy.com) for a list of all supported emoji codes. :thumbsup:
### Special GitLab References ### Special GitLab References
......
...@@ -102,13 +102,16 @@ module API ...@@ -102,13 +102,16 @@ module API
end end
params do params do
requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag' requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag'
use :pagination
end end
get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do
commit = user_project.commit(params[:sha]) commit = user_project.commit(params[:sha])
not_found! 'Commit' unless commit not_found! 'Commit' unless commit
present commit.raw_diffs.to_a, with: Entities::Diff raw_diffs = ::Kaminari.paginate_array(commit.raw_diffs.to_a)
present paginate(raw_diffs), with: Entities::Diff
end end
desc "Get a commit's comments" do desc "Get a commit's comments" do
......
...@@ -2,6 +2,8 @@ module API ...@@ -2,6 +2,8 @@ module API
class PagesDomains < Grape::API class PagesDomains < Grape::API
include PaginationParams include PaginationParams
PAGES_DOMAINS_ENDPOINT_REQUIREMENTS = API::PROJECT_ENDPOINT_REQUIREMENTS.merge(domain: API::NO_SLASH_URL_PART_REGEX)
before do before do
authenticate! authenticate!
end end
...@@ -48,7 +50,7 @@ module API ...@@ -48,7 +50,7 @@ module API
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: { id: %r{[^/]+} } do resource :projects, requirements: API::PROJECT_ENDPOINT_REQUIREMENTS do
before do before do
require_pages_enabled! require_pages_enabled!
end end
...@@ -71,7 +73,7 @@ module API ...@@ -71,7 +73,7 @@ module API
params do params do
requires :domain, type: String, desc: 'The domain' requires :domain, type: String, desc: 'The domain'
end end
get ":id/pages/domains/:domain", requirements: { domain: %r{[^/]+} } do get ":id/pages/domains/:domain", requirements: PAGES_DOMAINS_ENDPOINT_REQUIREMENTS do
authorize! :read_pages, user_project authorize! :read_pages, user_project
present pages_domain, with: Entities::PagesDomain present pages_domain, with: Entities::PagesDomain
...@@ -105,7 +107,7 @@ module API ...@@ -105,7 +107,7 @@ module API
optional :certificate, allow_blank: false, types: [File, String], desc: 'The certificate' optional :certificate, allow_blank: false, types: [File, String], desc: 'The certificate'
optional :key, allow_blank: false, types: [File, String], desc: 'The key' optional :key, allow_blank: false, types: [File, String], desc: 'The key'
end end
put ":id/pages/domains/:domain", requirements: { domain: %r{[^/]+} } do put ":id/pages/domains/:domain", requirements: PAGES_DOMAINS_ENDPOINT_REQUIREMENTS do
authorize! :update_pages, user_project authorize! :update_pages, user_project
pages_domain_params = declared(params, include_parent_namespaces: false) pages_domain_params = declared(params, include_parent_namespaces: false)
...@@ -126,7 +128,7 @@ module API ...@@ -126,7 +128,7 @@ module API
params do params do
requires :domain, type: String, desc: 'The domain' requires :domain, type: String, desc: 'The domain'
end end
delete ":id/pages/domains/:domain", requirements: { domain: %r{[^/]+} } do delete ":id/pages/domains/:domain", requirements: PAGES_DOMAINS_ENDPOINT_REQUIREMENTS do
authorize! :update_pages, user_project authorize! :update_pages, user_project
status 204 status 204
......
...@@ -277,6 +277,7 @@ module API ...@@ -277,6 +277,7 @@ module API
[ [
:jobs_enabled, :jobs_enabled,
:resolve_outdated_diff_discussions, :resolve_outdated_diff_discussions,
:ci_config_path,
:container_registry_enabled, :container_registry_enabled,
:default_branch, :default_branch,
:description, :description,
......
...@@ -23,7 +23,7 @@ module Gitlab ...@@ -23,7 +23,7 @@ module Gitlab
end end
def stop_working def stop_working
server.shutdown server.shutdown if server
@server = nil @server = nil
end end
......
...@@ -37,7 +37,7 @@ module Gitlab ...@@ -37,7 +37,7 @@ module Gitlab
config[:'gitlab-shell'] = { dir: Gitlab.config.gitlab_shell.path } config[:'gitlab-shell'] = { dir: Gitlab.config.gitlab_shell.path }
config[:bin_dir] = Gitlab.config.gitaly.client_path config[:bin_dir] = Gitlab.config.gitaly.client_path
TOML.dump(config) TomlRB.dump(config)
end end
# rubocop:disable Rails/Output # rubocop:disable Rails/Output
......
...@@ -2,7 +2,7 @@ namespace :gitlab do ...@@ -2,7 +2,7 @@ namespace :gitlab do
namespace :gitaly do namespace :gitaly do
desc "GitLab | Install or upgrade gitaly" desc "GitLab | Install or upgrade gitaly"
task :install, [:dir, :repo] => :gitlab_environment do |t, args| task :install, [:dir, :repo] => :gitlab_environment do |t, args|
require 'toml' require 'toml-rb'
warn_user_is_not_gitlab warn_user_is_not_gitlab
...@@ -38,7 +38,7 @@ namespace :gitlab do ...@@ -38,7 +38,7 @@ namespace :gitlab do
desc "GitLab | Print storage configuration in TOML format" desc "GitLab | Print storage configuration in TOML format"
task storage_config: :environment do task storage_config: :environment do
require 'toml' require 'toml-rb'
puts "# Gitaly storage configuration generated from #{Gitlab.config.source} on #{Time.current.to_s(:long)}" puts "# Gitaly storage configuration generated from #{Gitlab.config.source} on #{Time.current.to_s(:long)}"
puts "# This is in TOML format suitable for use in Gitaly's config.toml file." puts "# This is in TOML format suitable for use in Gitaly's config.toml file."
......
...@@ -8,6 +8,7 @@ code_path=$(pwd) ...@@ -8,6 +8,7 @@ code_path=$(pwd)
# it will break codequality json file # it will break codequality json file
[ "$CI" != "" ] || docker_tty="--tty" [ "$CI" != "" ] || docker_tty="--tty"
# The codebase and instructions for the following image can be found at https://gitlab.com/gitlab-org/codeclimate-rubocop/wikis/home
docker pull dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1 > /dev/null docker pull dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1 > /dev/null
docker tag dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1 codeclimate/codeclimate-rubocop:gitlab-codeclimate-rubocop-0-52-1 > /dev/null docker tag dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1 codeclimate/codeclimate-rubocop:gitlab-codeclimate-rubocop-0-52-1 > /dev/null
......
...@@ -1590,7 +1590,7 @@ describe Gitlab::Git::Repository, seed_helper: true do ...@@ -1590,7 +1590,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
expected_languages = [ expected_languages = [
{ value: 66.63, label: "Ruby", color: "#701516", highlight: "#701516" }, { value: 66.63, label: "Ruby", color: "#701516", highlight: "#701516" },
{ value: 22.96, label: "JavaScript", color: "#f1e05a", highlight: "#f1e05a" }, { value: 22.96, label: "JavaScript", color: "#f1e05a", highlight: "#f1e05a" },
{ value: 7.9, label: "HTML", color: "#e44b23", highlight: "#e44b23" }, { value: 7.9, label: "HTML", color: "#e34c26", highlight: "#e34c26" },
{ value: 2.51, label: "CoffeeScript", color: "#244776", highlight: "#244776" } { value: 2.51, label: "CoffeeScript", color: "#244776", highlight: "#244776" }
] ]
......
...@@ -706,6 +706,7 @@ describe API::Commits do ...@@ -706,6 +706,7 @@ describe API::Commits do
get api(route, current_user) get api(route, current_user)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response.size).to be >= 1 expect(json_response.size).to be >= 1
expect(json_response.first.keys).to include 'diff' expect(json_response.first.keys).to include 'diff'
end end
......
require 'rails_helper' require 'rails_helper'
describe API::PagesDomains do describe API::PagesDomains do
set(:project) { create(:project) } set(:project) { create(:project, path: 'my.project') }
set(:user) { create(:user) } set(:user) { create(:user) }
set(:admin) { create(:admin) } set(:admin) { create(:admin) }
...@@ -16,6 +16,7 @@ describe API::PagesDomains do ...@@ -16,6 +16,7 @@ describe API::PagesDomains do
let(:route) { "/projects/#{project.id}/pages/domains" } let(:route) { "/projects/#{project.id}/pages/domains" }
let(:route_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain.domain}" } let(:route_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain.domain}" }
let(:route_domain_path) { "/projects/#{project.path_with_namespace.gsub('/', '%2F')}/pages/domains/#{pages_domain.domain}" }
let(:route_secure_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_secure.domain}" } let(:route_secure_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_secure.domain}" }
let(:route_expired_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_expired.domain}" } let(:route_expired_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_expired.domain}" }
let(:route_vacant_domain) { "/projects/#{project.id}/pages/domains/www.vacant-domain.test" } let(:route_vacant_domain) { "/projects/#{project.id}/pages/domains/www.vacant-domain.test" }
...@@ -144,6 +145,16 @@ describe API::PagesDomains do ...@@ -144,6 +145,16 @@ describe API::PagesDomains do
expect(json_response['certificate']).to be_nil expect(json_response['certificate']).to be_nil
end end
it 'returns pages domain with project path' do
get api(route_domain_path, user)
expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/pages_domain/detail')
expect(json_response['domain']).to eq(pages_domain.domain)
expect(json_response['url']).to eq(pages_domain.url)
expect(json_response['certificate']).to be_nil
end
it 'returns pages domain with a certificate' do it 'returns pages domain with a certificate' do
get api(route_secure_domain, user) get api(route_secure_domain, user)
......
require 'rspec/mocks' require 'rspec/mocks'
require 'toml' require 'toml-rb'
module TestEnv module TestEnv
extend self extend self
......
...@@ -132,7 +132,7 @@ describe 'gitlab:gitaly namespace rake task' do ...@@ -132,7 +132,7 @@ describe 'gitlab:gitaly namespace rake task' do
expect { run_rake_task('gitlab:gitaly:storage_config')} expect { run_rake_task('gitlab:gitaly:storage_config')}
.to output(expected_output).to_stdout .to output(expected_output).to_stdout
parsed_output = TOML.parse(expected_output) parsed_output = TomlRB.parse(expected_output)
config.each do |name, params| config.each do |name, params|
expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params['path'] }) expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params['path'] })
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