Commit c11a32bc authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'mo-enable-code-coverage-overall-activity' into 'master'

Add code coverage overall activity to group repository analytics

See merge request gitlab-org/gitlab!48155
parents 1303d369 7df790e1
---
title: Add code coverage overall activity to group repository analytics
merge_request: 48155
author:
type: added
......@@ -8677,8 +8677,7 @@ type Group {
): BoardConnection
"""
Represents the code coverage activity for this group. Available only when
feature flag `group_coverage_data_report_graph` is enabled
Represents the code coverage activity for this group
"""
codeCoverageActivities(
"""
......
......@@ -24065,7 +24065,7 @@
},
{
"name": "codeCoverageActivities",
"description": "Represents the code coverage activity for this group. Available only when feature flag `group_coverage_data_report_graph` is enabled",
"description": "Represents the code coverage activity for this group",
"args": [
{
"name": "startDate",
......@@ -1432,7 +1432,7 @@ Autogenerated return type of EpicTreeReorder.
| `avatarUrl` | String | Avatar URL of the group |
| `board` | Board | A single board of the group |
| `boards` | BoardConnection | Boards of the group |
| `codeCoverageActivities` | CodeCoverageActivityConnection | Represents the code coverage activity for this group. Available only when feature flag `group_coverage_data_report_graph` is enabled |
| `codeCoverageActivities` | CodeCoverageActivityConnection | Represents the code coverage activity for this group |
| `containerRepositories` | ContainerRepositoryConnection | Container repositories of the project |
| `containsLockedProjects` | Boolean! | Includes at least one project where the repository size exceeds the limit |
| `customEmoji` | CustomEmojiConnection | Custom emoji within this namespace. Available only when feature flag `custom_emoji` is enabled |
......
......@@ -794,10 +794,21 @@ With [GitLab Issue Analytics](issues_analytics/index.md), you can see a bar char
## Repositories analytics **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/215104) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.4.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/263478) in GitLab 13.6.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/276003) in GitLab 13.7.
With [GitLab Repositories Analytics](repositories_analytics/index.md), you can download a CSV of the latest coverage data for all the projects in your group.
### Check code coverage for all projects
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/263478) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.7.
See the overall activity of all projects with code coverage with [GitLab Repositories Analytics](repositories_analytics/index.md).
It displays the current code coverage data available for your projects:
![Group repositories analytics](img/group_code_coverage_analytics_v13_7.png)
## Dependency Proxy
Use GitLab as a [dependency proxy](../packages/dependency_proxy/index.md) for upstream Docker images.
......
......@@ -16,11 +16,6 @@ export default {
text: {
codeCoverageHeader: s__('RepositoriesAnalytics|Test Code Coverage'),
},
computed: {
shouldShowCoverageSummary() {
return this.glFeatures.groupCoverageDataReportGraph;
},
},
};
</script>
......@@ -29,7 +24,7 @@ export default {
<h4 data-testid="test-coverage-header">
{{ $options.text.codeCoverageHeader }}
</h4>
<test-coverage-summary v-if="shouldShowCoverageSummary" />
<test-coverage-summary />
<test-coverage-table class="gl-mb-5" />
<download-test-coverage />
</div>
......
......@@ -6,7 +6,6 @@ class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::Appl
before_action :load_group
before_action -> { check_feature_availability!(:group_repository_analytics) }
before_action -> { authorize_view_by_action!(:read_group_repository_analytics) }
before_action -> { push_frontend_feature_flag(:group_coverage_data_report_graph, @group, default_enabled: false) }
def show
track_event(pageview_tracker_params)
......
......@@ -71,8 +71,7 @@ module EE
::Types::Ci::CodeCoverageActivityType.connection_type,
null: true,
description: 'Represents the code coverage activity for this group',
resolver: ::Resolvers::Ci::CodeCoverageActivitiesResolver,
feature_flag: :group_coverage_data_report_graph
resolver: ::Resolvers::Ci::CodeCoverageActivitiesResolver
field :stats,
::Types::GroupStatsType,
......
---
name: group_coverage_data_report_graph
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46698
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/276003
milestone: '13.6'
type: development
group: group::testing
default_enabled: false
......@@ -71,35 +71,4 @@ RSpec.describe GitlabSchema.types['Group'] do
expect(vulnerabilities.first['severity']).to eq('CRITICAL')
end
end
describe 'codeCoverageActivities' do
let(:group) { create(:group) }
let(:user) { create(:user) }
let(:start_date) { 1.day.ago.to_date.to_s }
let(:query) do
%(
query {
group(fullPath: "#{group.full_path}") {
codeCoverageActivities(startDate: "#{start_date}") {
nodes {
averageCoverage
}
}
}
}
)
end
context 'when group_coverage_data_report flag is disabled' do
subject { GitlabSchema.execute(query, context: { current_user: user }).as_json }
it 'returns a graphQL error field does not exist' do
stub_feature_flags(group_coverage_data_report_graph: false)
expected_message = "Field 'codeCoverageActivities' doesn't exist on type 'Group'"
expect(subject.dig('errors').first.dig('message')).to eq(expected_message)
end
end
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