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
8f7510cc
Commit
8f7510cc
authored
Jan 27, 2021
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature flag definition
parent
025a5b42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
app/services/ci/create_job_artifacts_service.rb
app/services/ci/create_job_artifacts_service.rb
+2
-1
config/feature_flags/development/usage_data_i_testing_metrics_report_artifact_uploaders.yml
...sage_data_i_testing_metrics_report_artifact_uploaders.yml
+8
-0
spec/services/ci/create_job_artifacts_service_spec.rb
spec/services/ci/create_job_artifacts_service_spec.rb
+12
-4
No files found.
app/services/ci/create_job_artifacts_service.rb
View file @
8f7510cc
...
...
@@ -7,6 +7,7 @@ module Ci
ArtifactsExistError
=
Class
.
new
(
StandardError
)
LSIF_ARTIFACT_TYPE
=
'lsif'
METRICS_REPORT_UPLOAD_EVENT_NAME
=
'i_testing_metrics_report_artifact_uploaders'
OBJECT_STORAGE_ERRORS
=
[
Errno
::
EIO
,
...
...
@@ -157,7 +158,7 @@ module Ci
def
track_artifact_uploader
(
artifact
)
return
unless
artifact
.
file_type
==
'metrics'
track_usage_event
(
'i_metrics_report_artifact_uploaders'
,
@job
.
user_id
)
track_usage_event
(
METRICS_REPORT_UPLOAD_EVENT_NAME
,
@job
.
user_id
)
end
def
parse_dotenv_artifact
(
artifact
)
...
...
config/feature_flags/development/usage_data_i_testing_metrics_report_artifact_uploaders.yml
0 → 100644
View file @
8f7510cc
---
name
:
usage_data_i_testing_metrics_report_artifact_uploaders
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51670
rollout_issue_url
:
milestone
:
'
13.9'
type
:
development
group
:
group::testing
default_enabled
:
true
spec/services/ci/create_job_artifacts_service_spec.rb
View file @
8f7510cc
...
...
@@ -27,6 +27,14 @@ RSpec.describe Ci::CreateJobArtifactsService do
UploadedFile
.
new
(
upload
.
path
,
**
params
)
end
def
unique_metrics_report_uploaders
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
event_names:
described_class
::
METRICS_REPORT_UPLOAD_EVENT_NAME
,
start_date:
2
.
weeks
.
ago
,
end_date:
2
.
weeks
.
from_now
)
end
describe
'#execute'
do
subject
{
service
.
execute
(
artifacts_file
,
params
,
metadata_file:
metadata_file
)
}
...
...
@@ -43,9 +51,9 @@ RSpec.describe Ci::CreateJobArtifactsService do
end
it
'does not track the job user_id'
do
expect
(
service
).
not_to
receive
(
:track_usage_event
)
subject
expect
(
unique_metrics_report_uploaders
).
to
eq
(
0
)
end
context
'when metadata file is also uploaded'
do
...
...
@@ -188,9 +196,9 @@ RSpec.describe Ci::CreateJobArtifactsService do
let
(
:params
)
{
{
'artifact_type'
=>
'metrics'
,
'artifact_format'
=>
'gzip'
}.
with_indifferent_access
}
it
'tracks the job user_id'
do
expect
(
service
).
to
receive
(
:track_usage_event
).
with
(
'i_metrics_report_artifact_uploaders'
,
123
)
subject
expect
(
unique_metrics_report_uploaders
).
to
eq
(
1
)
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