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
461878bf
Commit
461878bf
authored
Apr 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
413bce27
a55dc72f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
12 deletions
+60
-12
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
changelogs/unreleased/53138-add-metrics-usage-ping.yml
changelogs/unreleased/53138-add-metrics-usage-ping.yml
+5
-0
changelogs/unreleased/downloading-expired-artifacts.yml
changelogs/unreleased/downloading-expired-artifacts.yml
+5
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+8
-7
spec/views/projects/tags/index.html.haml_spec.rb
spec/views/projects/tags/index.html.haml_spec.rb
+37
-4
No files found.
app/models/ci/pipeline.rb
View file @
461878bf
...
...
@@ -686,7 +686,7 @@ module Ci
# We purposely cast the builds to an Array here. Because we always use the
# rows if there are more than 0 this prevents us from having to run two
# queries: one to get the count and one to get the rows.
@latest_builds_with_artifacts
||=
builds
.
latest
.
with_artifacts_
archive
.
to_a
@latest_builds_with_artifacts
||=
builds
.
latest
.
with_artifacts_
not_expired
.
to_a
end
def
has_test_reports?
...
...
changelogs/unreleased/53138-add-metrics-usage-ping.yml
0 → 100644
View file @
461878bf
---
title
:
Adds if InfluxDB and Prometheus metrics are enabled to usage ping data
merge_request
:
27238
author
:
type
:
added
changelogs/unreleased/downloading-expired-artifacts.yml
0 → 100644
View file @
461878bf
---
title
:
stop rendering download links for expired artifacts on the project tags page
merge_request
:
26753
author
:
Drew Cimino
type
:
fixed
lib/gitlab/usage_data.rb
View file @
461878bf
...
...
@@ -117,9 +117,11 @@ module Gitlab
container_registry_enabled:
Gitlab
.
config
.
registry
.
enabled
,
gitlab_shared_runners_enabled:
Gitlab
.
config
.
gitlab_ci
.
shared_runners_enabled
,
gravatar_enabled:
Gitlab
::
CurrentSettings
.
gravatar_enabled?
,
influxdb_metrics_enabled:
Gitlab
::
Metrics
.
influx_metrics_enabled?
,
ldap_enabled:
Gitlab
.
config
.
ldap
.
enabled
,
mattermost_enabled:
Gitlab
.
config
.
mattermost
.
enabled
,
omniauth_enabled:
Gitlab
::
Auth
.
omniauth_enabled?
,
prometheus_metrics_enabled:
Gitlab
::
Metrics
.
prometheus_metrics_enabled?
,
reply_by_email_enabled:
Gitlab
::
IncomingEmail
.
enabled?
,
signup_enabled:
Gitlab
::
CurrentSettings
.
allow_signup?
}
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
461878bf
...
...
@@ -58,6 +58,8 @@ describe Gitlab::UsageData do
database
avg_cycle_analytics
web_ide_commits
influxdb_metrics_enabled
prometheus_metrics_enabled
)
)
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
461878bf
...
...
@@ -2705,18 +2705,19 @@ describe Ci::Pipeline, :mailer do
end
describe
'#latest_builds_with_artifacts'
do
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
:success
)
}
let!
(
:build
)
do
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
end
let!
(
:fresh_build
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
let!
(
:stale_build
)
{
create
(
:ci_build
,
:success
,
:expired
,
:artifacts
,
pipeline:
pipeline
)
}
it
'returns an Array'
do
expect
(
pipeline
.
latest_builds_with_artifacts
).
to
be_an_instance_of
(
Array
)
end
it
'returns the latest builds'
do
expect
(
pipeline
.
latest_builds_with_artifacts
).
to
eq
([
build
])
it
'returns the latest builds with non-expired artifacts'
do
expect
(
pipeline
.
latest_builds_with_artifacts
).
to
contain_exactly
(
fresh_build
)
end
it
'does not return builds with expired artifacts'
do
expect
(
pipeline
.
latest_builds_with_artifacts
).
not_to
include
(
stale_build
)
end
it
'memoizes the returned relation'
do
...
...
spec/views/projects/tags/index.html.haml_spec.rb
View file @
461878bf
require
'spec_helper'
describe
'projects/tags/index'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:tags
)
{
TagsFinder
.
new
(
project
.
repository
,
{}).
execute
}
let
(
:git_tag
)
{
project
.
repository
.
tags
.
last
}
let
(
:release
)
{
create
(
:release
,
project:
project
,
sha:
git_tag
.
target_commit
.
sha
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:success
,
project:
project
,
ref:
git_tag
.
name
,
sha:
release
.
sha
)
}
before
do
assign
(
:project
,
project
)
assign
(
:repository
,
project
.
repository
)
assign
(
:tags
,
[])
assign
(
:releases
,
project
.
releases
)
assign
(
:tags
,
Kaminari
.
paginate_array
(
tags
).
page
(
0
))
assign
(
:tags_pipelines
,
{
git_tag
.
name
=>
pipeline
})
allow
(
view
).
to
receive
(
:current_ref
).
and_return
(
'master'
)
allow
(
view
).
to
receive
(
:c
an?
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:c
urrent_user
).
and_return
(
project
.
namespace
.
owner
)
end
it
'defaults sort dropdown toggle to last updated'
do
render
expect
(
rendered
).
to
have_button
(
'Last updated'
)
end
context
'when the most recent build for a tag has artifacts'
do
let!
(
:build
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
it
'renders the Artifacts section in the download list'
do
render
expect
(
rendered
).
to
have_selector
(
'li'
,
text:
'Artifacts'
)
end
it
'renders artifact download links'
do
render
expect
(
rendered
).
to
have_link
(
href:
latest_succeeded_project_artifacts_path
(
project
,
"
#{
pipeline
.
ref
}
/download"
,
job:
'test'
))
end
end
context
'when the most recent build for a tag has expired artifacts'
do
let!
(
:build
)
{
create
(
:ci_build
,
:success
,
:expired
,
:artifacts
,
pipeline:
pipeline
)
}
it
'does not render the Artifacts section in the download list'
do
render
expect
(
rendered
).
not_to
have_selector
(
'li'
,
text:
'Artifacts'
)
end
it
'does not render artifact download links'
do
render
expect
(
rendered
).
not_to
have_link
(
href:
latest_succeeded_project_artifacts_path
(
project
,
"
#{
pipeline
.
ref
}
/download"
,
job:
'test'
))
end
end
end
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