Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ded8ee5a
Commit
ded8ee5a
authored
Nov 01, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
deed6022
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
19 deletions
+48
-19
app/controllers/concerns/uploads_actions.rb
app/controllers/concerns/uploads_actions.rb
+1
-1
changelogs/unreleased/35337-images-stopped-loading-signed-urls-of-uploads-expire-earlier-than-r.yml
...-loading-signed-urls-of-uploads-expire-earlier-than-r.yml
+6
-0
db/migrate/20190805140353_remove_rendundant_index_from_releases.rb
...e/20190805140353_remove_rendundant_index_from_releases.rb
+1
-1
lib/gitlab/cycle_analytics/group_stage_summary.rb
lib/gitlab/cycle_analytics/group_stage_summary.rb
+3
-4
lib/gitlab/cycle_analytics/summary/group/base.rb
lib/gitlab/cycle_analytics/summary/group/base.rb
+2
-3
lib/gitlab/cycle_analytics/summary/group/deploy.rb
lib/gitlab/cycle_analytics/summary/group/deploy.rb
+2
-1
lib/gitlab/cycle_analytics/summary/group/issue.rb
lib/gitlab/cycle_analytics/summary/group/issue.rb
+12
-4
spec/controllers/uploads_controller_spec.rb
spec/controllers/uploads_controller_spec.rb
+5
-5
spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
+16
-0
No files found.
app/controllers/concerns/uploads_actions.rb
View file @
ded8ee5a
...
@@ -34,7 +34,7 @@ module UploadsActions
...
@@ -34,7 +34,7 @@ module UploadsActions
headers
[
'Pragma'
]
=
''
headers
[
'Pragma'
]
=
''
ttl
,
directives
=
*
cache_settings
ttl
,
directives
=
*
cache_settings
ttl
||=
6
.
months
ttl
||=
0
directives
||=
{
private:
true
,
must_revalidate:
true
}
directives
||=
{
private:
true
,
must_revalidate:
true
}
expires_in
ttl
,
directives
expires_in
ttl
,
directives
...
...
changelogs/unreleased/35337-images-stopped-loading-signed-urls-of-uploads-expire-earlier-than-r.yml
0 → 100644
View file @
ded8ee5a
---
title
:
Disable upload HTTP caching to fix case when object storage is enabled and
proxy_download is disabled
merge_request
:
19494
author
:
type
:
fixed
db/migrate/20190805140353_remove_rendundant_index_from_releases.rb
View file @
ded8ee5a
...
@@ -15,7 +15,7 @@ class RemoveRendundantIndexFromReleases < ActiveRecord::Migration[5.2]
...
@@ -15,7 +15,7 @@ class RemoveRendundantIndexFromReleases < ActiveRecord::Migration[5.2]
remove_concurrent_index_by_name
:releases
,
'index_releases_on_project_id'
remove_concurrent_index_by_name
:releases
,
'index_releases_on_project_id'
# This is an extra index that is not present in db/schema.rb but known to exist on some installs
# This is an extra index that is not present in db/schema.rb but known to exist on some installs
remove_concurrent_index_by_name
:releases
,
'releases_project_id_idx'
remove_concurrent_index_by_name
:releases
,
'releases_project_id_idx'
if
index_exists_by_name?
(
:releases
,
'releases_project_id_idx'
)
end
end
def
down
def
down
...
...
lib/gitlab/cycle_analytics/group_stage_summary.rb
View file @
ded8ee5a
...
@@ -3,18 +3,17 @@
...
@@ -3,18 +3,17 @@
module
Gitlab
module
Gitlab
module
CycleAnalytics
module
CycleAnalytics
class
GroupStageSummary
class
GroupStageSummary
attr_reader
:group
,
:
from
,
:
current_user
,
:options
attr_reader
:group
,
:current_user
,
:options
def
initialize
(
group
,
options
:)
def
initialize
(
group
,
options
:)
@group
=
group
@group
=
group
@from
=
options
[
:from
]
@current_user
=
options
[
:current_user
]
@current_user
=
options
[
:current_user
]
@options
=
options
@options
=
options
end
end
def
data
def
data
[
serialize
(
Summary
::
Group
::
Issue
.
new
(
group:
group
,
from:
from
,
current_user:
current_user
,
options:
options
)),
[
serialize
(
Summary
::
Group
::
Issue
.
new
(
group:
group
,
current_user:
current_user
,
options:
options
)),
serialize
(
Summary
::
Group
::
Deploy
.
new
(
group:
group
,
from:
from
,
options:
options
))]
serialize
(
Summary
::
Group
::
Deploy
.
new
(
group:
group
,
options:
options
))]
end
end
private
private
...
...
lib/gitlab/cycle_analytics/summary/group/base.rb
View file @
ded8ee5a
...
@@ -5,11 +5,10 @@ module Gitlab
...
@@ -5,11 +5,10 @@ module Gitlab
module
Summary
module
Summary
module
Group
module
Group
class
Base
class
Base
attr_reader
:group
,
:
from
,
:
options
attr_reader
:group
,
:options
def
initialize
(
group
:,
from
:,
options
:)
def
initialize
(
group
:,
options
:)
@group
=
group
@group
=
group
@from
=
from
@options
=
options
@options
=
options
end
end
...
...
lib/gitlab/cycle_analytics/summary/group/deploy.rb
View file @
ded8ee5a
...
@@ -20,7 +20,8 @@ module Gitlab
...
@@ -20,7 +20,8 @@ module Gitlab
def
find_deployments
def
find_deployments
deployments
=
Deployment
.
joins
(
:project
).
merge
(
Project
.
inside_path
(
group
.
full_path
))
deployments
=
Deployment
.
joins
(
:project
).
merge
(
Project
.
inside_path
(
group
.
full_path
))
deployments
=
deployments
.
where
(
projects:
{
id:
options
[
:projects
]
})
if
options
[
:projects
]
deployments
=
deployments
.
where
(
projects:
{
id:
options
[
:projects
]
})
if
options
[
:projects
]
deployments
=
deployments
.
where
(
"deployments.created_at > ?"
,
from
)
deployments
=
deployments
.
where
(
"deployments.created_at > ?"
,
options
[
:from
])
deployments
=
deployments
.
where
(
"deployments.created_at < ?"
,
options
[
:to
])
if
options
[
:to
]
deployments
.
success
.
count
deployments
.
success
.
count
end
end
end
end
...
...
lib/gitlab/cycle_analytics/summary/group/issue.rb
View file @
ded8ee5a
...
@@ -5,11 +5,10 @@ module Gitlab
...
@@ -5,11 +5,10 @@ module Gitlab
module
Summary
module
Summary
module
Group
module
Group
class
Issue
<
Group
::
Base
class
Issue
<
Group
::
Base
attr_reader
:group
,
:
from
,
:
current_user
,
:options
attr_reader
:group
,
:current_user
,
:options
def
initialize
(
group
:,
from
:,
current_user
:,
options
:)
def
initialize
(
group
:,
current_user
:,
options
:)
@group
=
group
@group
=
group
@from
=
from
@current_user
=
current_user
@current_user
=
current_user
@options
=
options
@options
=
options
end
end
...
@@ -25,10 +24,19 @@ module Gitlab
...
@@ -25,10 +24,19 @@ module Gitlab
private
private
def
find_issues
def
find_issues
issues
=
IssuesFinder
.
new
(
current_user
,
group_id:
group
.
id
,
include_subgroups:
true
,
created_after:
from
).
execute
issues
=
IssuesFinder
.
new
(
current_user
,
finder_params
).
execute
issues
=
issues
.
where
(
projects:
{
id:
options
[
:projects
]
})
if
options
[
:projects
]
issues
=
issues
.
where
(
projects:
{
id:
options
[
:projects
]
})
if
options
[
:projects
]
issues
.
count
issues
.
count
end
end
def
finder_params
{
group_id:
group
.
id
,
include_subgroups:
true
,
created_after:
options
[
:from
],
created_before:
options
[
:to
]
}.
compact
end
end
end
end
end
end
end
...
...
spec/controllers/uploads_controller_spec.rb
View file @
ded8ee5a
...
@@ -7,9 +7,9 @@ shared_examples 'content 5 min private cached with revalidation' do
...
@@ -7,9 +7,9 @@ shared_examples 'content 5 min private cached with revalidation' do
end
end
end
end
shared_examples
'content
long term private cached with revalidation
'
do
shared_examples
'content
not cached
'
do
it
'ensures content will not be cached without revalidation'
do
it
'ensures content will not be cached without revalidation'
do
expect
(
subject
[
'Cache-Control'
]).
to
eq
(
'max-age=
15778476
, private, must-revalidate'
)
expect
(
subject
[
'Cache-Control'
]).
to
eq
(
'max-age=
0
, private, must-revalidate'
)
end
end
end
end
...
@@ -490,7 +490,7 @@ describe UploadsController do
...
@@ -490,7 +490,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content
long term private cached with revalidation
'
do
it_behaves_like
'content
not cached
'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'note'
,
mounted_as:
'attachment'
,
id:
note
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'note'
,
mounted_as:
'attachment'
,
id:
note
.
id
,
filename:
'dk.png'
}
...
@@ -510,7 +510,7 @@ describe UploadsController do
...
@@ -510,7 +510,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content
long term private cached with revalidation
'
do
it_behaves_like
'content
not cached
'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'note'
,
mounted_as:
'attachment'
,
id:
note
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'note'
,
mounted_as:
'attachment'
,
id:
note
.
id
,
filename:
'dk.png'
}
...
@@ -563,7 +563,7 @@ describe UploadsController do
...
@@ -563,7 +563,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content
long term private cached with revalidation
'
do
it_behaves_like
'content
not cached
'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'note'
,
mounted_as:
'attachment'
,
id:
note
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'note'
,
mounted_as:
'attachment'
,
id:
note
.
id
,
filename:
'dk.png'
}
...
...
spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
View file @
ded8ee5a
...
@@ -44,6 +44,14 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
...
@@ -44,6 +44,14 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
expect
(
subject
.
first
[
:value
]).
to
eq
(
2
)
expect
(
subject
.
first
[
:value
]).
to
eq
(
2
)
end
end
end
end
context
'when `from` and `to` parameters are provided'
do
subject
{
described_class
.
new
(
group
,
options:
{
from:
10
.
days
.
ago
,
to:
Time
.
now
,
current_user:
user
}).
data
}
it
'finds issues from 5 days ago'
do
expect
(
subject
.
first
[
:value
]).
to
eq
(
2
)
end
end
end
end
context
'with other projects'
do
context
'with other projects'
do
...
@@ -97,6 +105,14 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
...
@@ -97,6 +105,14 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
expect
(
subject
.
second
[
:value
]).
to
eq
(
2
)
expect
(
subject
.
second
[
:value
]).
to
eq
(
2
)
end
end
end
end
context
'when `from` and `to` parameters are provided'
do
subject
{
described_class
.
new
(
group
,
options:
{
from:
10
.
days
.
ago
,
to:
Time
.
now
,
current_user:
user
}).
data
}
it
'finds deployments from 5 days ago'
do
expect
(
subject
.
second
[
:value
]).
to
eq
(
2
)
end
end
end
end
context
'with other projects'
do
context
'with other projects'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment