diff options
-rw-r--r-- | GITLAB_KAS_VERSION | 1 | ||||
-rw-r--r-- | app/assets/javascripts/sidebar/queries/sidebarDetailsForHealthStatusFeatureFlag.query.graphql | 7 | ||||
-rw-r--r-- | app/assets/javascripts/sidebar/services/sidebar_service.js | 7 | ||||
-rw-r--r-- | app/models/merge_request.rb | 1 | ||||
-rw-r--r-- | changelogs/unreleased/CI_MERGE_REQUEST_DESCRIPTION.yml | 5 | ||||
-rw-r--r-- | changelogs/unreleased/usage_ping_agent_token.yml | 5 | ||||
-rw-r--r-- | config/feature_flags/development/expose_mr_description_predefined_variable.yml | 7 | ||||
-rw-r--r-- | doc/ci/variables/predefined_variables.md | 3 | ||||
-rw-r--r-- | lib/gitlab/ci/features.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/usage_data.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/known_events.yml | 5 | ||||
-rw-r--r-- | locale/gitlab.pot | 3 | ||||
-rw-r--r-- | rubocop/rubocop-usage-data.yml | 1 | ||||
-rw-r--r-- | spec/factories/usage_data.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/usage_data_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 1 |
16 files changed, 35 insertions, 21 deletions
diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION new file mode 100644 index 00000000000..bcab45af15a --- /dev/null +++ b/GITLAB_KAS_VERSION @@ -0,0 +1 @@ +0.0.3 diff --git a/app/assets/javascripts/sidebar/queries/sidebarDetailsForHealthStatusFeatureFlag.query.graphql b/app/assets/javascripts/sidebar/queries/sidebarDetailsForHealthStatusFeatureFlag.query.graphql deleted file mode 100644 index 2aff7da4605..00000000000 --- a/app/assets/javascripts/sidebar/queries/sidebarDetailsForHealthStatusFeatureFlag.query.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query($fullPath: ID!, $iid: String!) { - project(fullPath: $fullPath) { - issue(iid: $iid) { - iid - } - } -} diff --git a/app/assets/javascripts/sidebar/services/sidebar_service.js b/app/assets/javascripts/sidebar/services/sidebar_service.js index 8714bea1729..a61af631661 100644 --- a/app/assets/javascripts/sidebar/services/sidebar_service.js +++ b/app/assets/javascripts/sidebar/services/sidebar_service.js @@ -1,5 +1,4 @@ import sidebarDetailsQuery from 'ee_else_ce/sidebar/queries/sidebarDetails.query.graphql'; -import sidebarDetailsForHealthStatusFeatureFlagQuery from 'ee_else_ce/sidebar/queries/sidebarDetailsForHealthStatusFeatureFlag.query.graphql'; import axios from '~/lib/utils/axios_utils'; import createGqClient, { fetchPolicies } from '~/lib/graphql'; @@ -27,14 +26,10 @@ export default class SidebarService { } get() { - const hasHealthStatusFeatureFlag = gon.features && gon.features.saveIssuableHealthStatus; - return Promise.all([ axios.get(this.endpoint), gqClient.query({ - query: hasHealthStatusFeatureFlag - ? sidebarDetailsForHealthStatusFeatureFlagQuery - : sidebarDetailsQuery, + query: sidebarDetailsQuery, variables: { fullPath: this.fullPath, iid: this.iid.toString(), diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 31d81679c35..9588c678a3a 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -1324,6 +1324,7 @@ class MergeRequest < ApplicationRecord variables.append(key: 'CI_MERGE_REQUEST_PROJECT_URL', value: project.web_url) variables.append(key: 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME', value: target_branch.to_s) variables.append(key: 'CI_MERGE_REQUEST_TITLE', value: title) + variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION', value: description) if Gitlab::Ci::Features.expose_mr_description_predefined_variable? variables.append(key: 'CI_MERGE_REQUEST_ASSIGNEES', value: assignee_username_list) if assignees.present? variables.append(key: 'CI_MERGE_REQUEST_MILESTONE', value: milestone.title) if milestone variables.append(key: 'CI_MERGE_REQUEST_LABELS', value: label_names.join(',')) if labels.present? diff --git a/changelogs/unreleased/CI_MERGE_REQUEST_DESCRIPTION.yml b/changelogs/unreleased/CI_MERGE_REQUEST_DESCRIPTION.yml new file mode 100644 index 00000000000..8099b2b6a8a --- /dev/null +++ b/changelogs/unreleased/CI_MERGE_REQUEST_DESCRIPTION.yml @@ -0,0 +1,5 @@ +--- +title: Add CI_MERGE_REQUEST_DESCRIPTION env variable +merge_request: 40771 +author: Paul Spooren @aparcar +type: added diff --git a/changelogs/unreleased/usage_ping_agent_token.yml b/changelogs/unreleased/usage_ping_agent_token.yml new file mode 100644 index 00000000000..604d50994d8 --- /dev/null +++ b/changelogs/unreleased/usage_ping_agent_token.yml @@ -0,0 +1,5 @@ +--- +title: Add usage ping for distinct count for kubernetes agents for at least one token +merge_request: 40563 +author: +type: other diff --git a/config/feature_flags/development/expose_mr_description_predefined_variable.yml b/config/feature_flags/development/expose_mr_description_predefined_variable.yml new file mode 100644 index 00000000000..8338b2937ae --- /dev/null +++ b/config/feature_flags/development/expose_mr_description_predefined_variable.yml @@ -0,0 +1,7 @@ +--- +name: expose_mr_description_predefined_variable +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40771 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/243556 +group: group::continuous integration +type: development +default_enabled: true diff --git a/doc/ci/variables/predefined_variables.md b/doc/ci/variables/predefined_variables.md index 0a2f7f9f6e5..42ae9e97d8a 100644 --- a/doc/ci/variables/predefined_variables.md +++ b/doc/ci/variables/predefined_variables.md @@ -88,7 +88,8 @@ Kubernetes-specific environment variables are detailed in the | `CI_MERGE_REQUEST_SOURCE_PROJECT_URL` | 11.6 | all | The URL of the source project of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. | | `CI_MERGE_REQUEST_TARGET_BRANCH_NAME` | 11.6 | all | The target branch name of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. | | `CI_MERGE_REQUEST_TARGET_BRANCH_SHA` | 11.9 | all | The HEAD SHA of the target branch of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used, the merge request is created, and the pipeline is a [merged result pipeline](../merge_request_pipelines/pipelines_for_merged_results/index.md). **(PREMIUM)** | -| `CI_MERGE_REQUEST_TITLE` | 11.9 | all | The title of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. | +| `CI_MERGE_REQUEST_TITLE` | 11.9 | all | The title of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. | +| `CI_MERGE_REQUEST_DESCRIPTION` | 13.3 | all | The description of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. | | `CI_MERGE_REQUEST_EVENT_TYPE` | 12.3 | all | The event type of the merge request, if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Can be `detached`, `merged_result` or `merge_train`. | | `CI_NODE_INDEX` | 11.5 | all | Index of the job in the job set. If the job is not parallelized, this variable is not set. | | `CI_NODE_TOTAL` | 11.5 | all | Total number of instances of this job running in parallel. If the job is not parallelized, this variable is set to `1`. | diff --git a/lib/gitlab/ci/features.rb b/lib/gitlab/ci/features.rb index da66cec935c..7e7fa88c73b 100644 --- a/lib/gitlab/ci/features.rb +++ b/lib/gitlab/ci/features.rb @@ -83,6 +83,10 @@ module Gitlab def self.coverage_report_view?(project) ::Feature.enabled?(:coverage_report_view, project) end + + def self.expose_mr_description_predefined_variable? + ::Feature.enabled?(:ci_expose_mr_description_predefined_variable, default_enabled: true) + end end end end diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 55e717bdb16..f959a4accac 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -112,6 +112,7 @@ module Gitlab clusters_applications_cilium: count(::Clusters::Applications::Cilium.available), clusters_management_project: count(::Clusters::Cluster.with_management_project), kubernetes_agents: count(::Clusters::Agent), + kubernetes_agents_with_token: distinct_count(::Clusters::AgentToken, :agent_id), in_review_folder: count(::Environment.in_review_folder), grafana_integrated_projects: count(GrafanaIntegration.enabled), groups: count(Group), diff --git a/lib/gitlab/usage_data_counters/known_events.yml b/lib/gitlab/usage_data_counters/known_events.yml index 4d5910d2a41..dc9d025edcd 100644 --- a/lib/gitlab/usage_data_counters/known_events.yml +++ b/lib/gitlab/usage_data_counters/known_events.yml @@ -16,11 +16,6 @@ category: compliance redis_slot: compliance aggregation: weekly -- name: i_compliance_audit_events_api - category: compliance - redis_slot: compliance - expiry: 42 - aggregation: weekly # Analytics category - name: g_analytics_contribution category: analytics diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 9ed5691de91..f79b82446e8 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -16278,6 +16278,9 @@ msgstr "" msgid "NetworkPolicies|Rule mode" msgstr "" +msgid "NetworkPolicies|Rule mode is unavailable for this policy. In some cases, we cannot parse the YAML file back into the rules editor." +msgstr "" + msgid "NetworkPolicies|Rules" msgstr "" diff --git a/rubocop/rubocop-usage-data.yml b/rubocop/rubocop-usage-data.yml index 479d8620717..34f838e4692 100644 --- a/rubocop/rubocop-usage-data.yml +++ b/rubocop/rubocop-usage-data.yml @@ -45,3 +45,4 @@ UsageData/DistinctCountByLargeForeignKey: - :issue_id - :merge_request_id - :merge_requests.target_project_id + - :agent_id diff --git a/spec/factories/usage_data.rb b/spec/factories/usage_data.rb index 1057074e1f4..f6514b9b973 100644 --- a/spec/factories/usage_data.rb +++ b/spec/factories/usage_data.rb @@ -67,6 +67,7 @@ FactoryBot.define do # Kubernetes agents create(:cluster_agent, project: projects[0]) + create(:cluster_agent_token, agent: create(:cluster_agent, project: projects[1]) ) # Enabled clusters gcp_cluster = create(:cluster_provider_gcp, :created).cluster diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index f54c4724d74..3444fe54cd6 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -460,7 +460,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do expect(count_data[:clusters_applications_jupyter]).to eq(1) expect(count_data[:clusters_applications_cilium]).to eq(1) expect(count_data[:clusters_management_project]).to eq(1) - expect(count_data[:kubernetes_agents]).to eq(1) + expect(count_data[:kubernetes_agents]).to eq(2) + expect(count_data[:kubernetes_agents_with_token]).to eq(1) expect(count_data[:deployments]).to eq(4) expect(count_data[:successful_deployments]).to eq(2) @@ -1069,7 +1070,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do 'g_compliance_audit_events' => 123, 'i_compliance_credential_inventory' => 123, 'i_compliance_audit_events' => 123, - 'i_compliance_audit_events_api' => 123, 'compliance_unique_visits_for_any_target' => 543, 'compliance_unique_visits_for_any_target_monthly' => 987 } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index bd0e4633da0..c5ec218ee65 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -759,6 +759,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do 'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' => merge_request.source_branch.to_s, 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA' => pipeline.source_sha.to_s, 'CI_MERGE_REQUEST_TITLE' => merge_request.title, + 'CI_MERGE_REQUEST_DESCRIPTION' => merge_request.description, 'CI_MERGE_REQUEST_ASSIGNEES' => merge_request.assignee_username_list, 'CI_MERGE_REQUEST_MILESTONE' => milestone.title, 'CI_MERGE_REQUEST_LABELS' => labels.map(&:title).sort.join(','), |