Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-10-10 15:11:46 +00:00
parent e0e89248c5
commit 8af017c180
31 changed files with 188 additions and 149 deletions

View File

@ -157,6 +157,19 @@ export default {
data-testid="pipeline-url-detached"
>{{ s__('Pipeline|merge request') }}</gl-badge
>
<gl-badge
v-if="pipeline.flags.merged_result_pipeline"
v-gl-tooltip
:title="
s__(
`Pipeline|This pipeline ran on the contents of this merge request combined with the contents of the target branch.`,
)
"
variant="info"
size="sm"
data-testid="pipeline-url-merged-results"
>{{ s__('Pipeline|merged results') }}</gl-badge
>
<gl-badge
v-if="isInFork"
v-gl-tooltip

View File

@ -65,7 +65,7 @@ export default {
</gl-badge>
</span>
<span class="gl-text-gray-400">@{{ user.username }}</span>
<span class="gl-text-gray-400 gl-word-break-all">@{{ user.username }}</span>
<span
v-if="user.status.customized"

View File

@ -61,7 +61,7 @@ class ProjectsFinder < UnionFinder
collection = Project.wrap_with_cte(collection) if use_cte
collection = filter_projects(collection)
sort(collection)
sort(collection).allow_cross_joins_across_databases(url: "https://gitlab.com/gitlab-org/gitlab/-/issues/427628")
end
private

View File

@ -80,7 +80,7 @@ module AppearancesHelper
add_gitlab_black_text = options[:add_gitlab_black_text] || false
if current_appearance&.header_logo?
image_tag current_appearance.header_logo_path, class: 'brand-header-logo'
image_tag current_appearance.header_logo_path, class: 'brand-header-logo', alt: ''
elsif add_gitlab_white_text
render partial: 'shared/logo_with_white_text', formats: :svg
elsif add_gitlab_black_text

View File

@ -1452,7 +1452,7 @@ class Project < ApplicationRecord
super(import_url.sanitized_url)
credentials = import_url.credentials.to_h.transform_values { |value| CGI.unescape(value.to_s) }
create_or_update_import_data(credentials: credentials)
build_or_assign_import_data(credentials: credentials)
else
super(value)
end
@ -1473,9 +1473,7 @@ class Project < ApplicationRecord
valid?(:import_url) || errors.messages[:import_url].nil?
end
# TODO: rename to build_or_assign_import_data as it doesn't save record
# https://gitlab.com/gitlab-org/gitlab/-/issues/377319
def create_or_update_import_data(data: nil, credentials: nil)
def build_or_assign_import_data(data: nil, credentials: nil)
return if data.nil? && credentials.nil?
project_import_data = import_data || build_import_data

View File

@ -33,7 +33,8 @@ class Ci::PipelineEntity < Grape::Entity
expose :can_cancel?, as: :cancelable
expose :failure_reason?, as: :failure_reason
expose :detached_merge_request_pipeline?, as: :detached_merge_request_pipeline
expose :merged_result_pipeline?, as: :merge_request_pipeline
expose :merged_result_pipeline?, as: :merge_request_pipeline # deprecated, use merged_result_pipeline going forward
expose :merged_result_pipeline?, as: :merged_result_pipeline
end
expose :details do

View File

@ -12,7 +12,8 @@ class MergeRequests::PipelineEntity < Grape::Entity
end
expose :flags do
expose :merged_result_pipeline?, as: :merge_request_pipeline
expose :merged_result_pipeline?, as: :merge_request_pipeline # deprecated, use merged_result_pipeline going forward
expose :merged_result_pipeline?, as: :merged_result_pipeline
end
expose :commit, using: CommitEntity

View File

@ -229,7 +229,7 @@ module Projects
%w[routes redirect_routes], url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/424281'
) do
ApplicationRecord.transaction do
@project.create_or_update_import_data(data: @import_data[:data], credentials: @import_data[:credentials]) if @import_data
@project.build_or_assign_import_data(data: @import_data[:data], credentials: @import_data[:credentials]) if @import_data
# Avoid project callbacks being triggered multiple times by saving the parent first.
# See https://github.com/rails/rails/issues/41701.

View File

@ -1,6 +1,6 @@
.title
%span.gl-sr-only GitLab
= link_to root_path, title: _('Homepage'), id: 'logo', class: 'has-tooltip', **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation_top') do
= link_to root_path, title: _('Homepage'), id: 'logo', class: 'has-tooltip', aria: { label: _('Homepage') }, **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation_top') do
= brand_header_logo
.gl-display-flex.gl-align-items-center
- if Gitlab.com_and_canary?

View File

@ -1,4 +1,4 @@
<svg role="img" class="tanuki-logo" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg aria-hidden="true" role="img" class="tanuki-logo" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="tanuki-shape tanuki" d="m24.507 9.5-.034-.09L21.082.562a.896.896 0 0 0-1.694.091l-2.29 7.01H7.825L5.535.653a.898.898 0 0 0-1.694-.09L.451 9.411.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z"
fill="#E24329"/>
<path class="tanuki-shape right-cheek" d="m24.507 9.5-.034-.09a11.44 11.44 0 0 0-4.56 2.051l-7.447 5.632 4.742 3.584 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z"

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,4 +1,4 @@
<svg class="tanuki-logo" width="111" height="24" viewBox="0 0 111 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg aria-hidden="true" class="tanuki-logo" width="111" height="24" viewBox="0 0 111 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="logo-text" d="M44.814 9.042h3.645c-.608-3.875-3.963-6.574-8.33-6.574-5.166 0-9.043 3.798-9.043 10.16 0 6.248 3.703 10.123 9.15 10.123 4.887 0 8.386-3.144 8.386-8.234v-2.37h-8.01v2.794h4.55c-.058 2.816-1.938 4.599-4.908 4.599-3.305 0-5.57-2.477-5.57-6.95 0-4.445 2.303-6.913 5.494-6.913 2.38 0 4.01 1.272 4.636 3.365Zm6.218 13.438h3.49V7.68h-3.49v14.8Zm1.76-17.151c1.109 0 2.014-.85 2.014-1.89s-.905-1.9-2.014-1.9c-1.109 0-2.024.849-2.024 1.9s.9 1.89 2.017 1.89h.007ZM64.971 7.68H62.05V4.126h-3.49v3.556h-2.1v2.699h2.1v8.233c-.018 2.786 2.007 4.16 4.628 4.079a7.089 7.089 0 0 0 2.055-.348l-.59-2.73a4.247 4.247 0 0 1-1.02.137c-.878 0-1.582-.309-1.582-1.717v-7.662h2.921V7.68Zm2.701 14.8h12.272v-2.998H71.25V2.737h-3.578V22.48Zm18.957.3c2.323 0 3.71-1.09 4.347-2.333h.115v2.033h3.36v-9.91c0-3.913-3.19-5.09-6.016-5.09-3.113 0-5.504 1.388-6.275 4.087l3.26.464c.345-1.013 1.329-1.88 3.04-1.88 1.62 0 2.506.829 2.506 2.285v.057c0 1.002-1.05 1.051-3.664 1.33-2.872.309-5.619 1.166-5.619 4.502-.01 2.912 2.12 4.455 4.946 4.455Zm1.147-2.56c-1.456 0-2.498-.666-2.498-1.948 0-1.34 1.167-1.899 2.72-2.121.917-.125 2.75-.357 3.2-.722v1.744c.01 1.643-1.321 3.042-3.422 3.042v.005Zm9.244 2.26h3.433v-2.332h.201c.551 1.08 1.698 2.593 4.244 2.593 3.489 0 6.102-2.768 6.102-7.644 0-4.936-2.69-7.616-6.112-7.616-2.613 0-3.702 1.57-4.234 2.641h-.147V2.737h-3.486V22.48Zm3.423-7.403c0-2.88 1.234-4.734 3.48-4.734 2.323 0 3.52 1.976 3.52 4.734 0 2.759-1.214 4.8-3.52 4.8-2.227 0-3.48-1.928-3.48-4.8Z"
fill="#171321"/>
<path class="tanuki-shape tanuki" d="m24.507 9.5-.034-.09L21.082.562a.896.896 0 0 0-1.694.091l-2.29 7.01H7.825L5.535.653a.898.898 0 0 0-1.694-.09L.451 9.411.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z"

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,4 +1,4 @@
<svg class="tanuki-logo" width="111" height="24" viewBox="0 0 111 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg aria-hidden="true" class="tanuki-logo" width="111" height="24" viewBox="0 0 111 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="logo-text" d="M44.814 9.042h3.645c-.608-3.875-3.963-6.574-8.33-6.574-5.166 0-9.043 3.798-9.043 10.16 0 6.248 3.703 10.123 9.15 10.123 4.887 0 8.386-3.144 8.386-8.234v-2.37h-8.01v2.794h4.55c-.058 2.816-1.938 4.599-4.908 4.599-3.305 0-5.57-2.477-5.57-6.95 0-4.445 2.303-6.913 5.494-6.913 2.38 0 4.01 1.272 4.636 3.365Zm6.218 13.438h3.49V7.68h-3.49v14.8Zm1.76-17.151c1.109 0 2.014-.85 2.014-1.89s-.905-1.9-2.014-1.9c-1.109 0-2.024.849-2.024 1.9s.9 1.89 2.017 1.89h.007ZM64.971 7.68H62.05V4.126h-3.49v3.556h-2.1v2.699h2.1v8.233c-.018 2.786 2.007 4.16 4.628 4.079a7.089 7.089 0 0 0 2.055-.348l-.59-2.73a4.247 4.247 0 0 1-1.02.137c-.878 0-1.582-.309-1.582-1.717v-7.662h2.921V7.68Zm2.701 14.8h12.272v-2.998H71.25V2.737h-3.578V22.48Zm18.957.3c2.323 0 3.71-1.09 4.347-2.333h.115v2.033h3.36v-9.91c0-3.913-3.19-5.09-6.016-5.09-3.113 0-5.504 1.388-6.275 4.087l3.26.464c.345-1.013 1.329-1.88 3.04-1.88 1.62 0 2.506.829 2.506 2.285v.057c0 1.002-1.05 1.051-3.664 1.33-2.872.309-5.619 1.166-5.619 4.502-.01 2.912 2.12 4.455 4.946 4.455Zm1.147-2.56c-1.456 0-2.498-.666-2.498-1.948 0-1.34 1.167-1.899 2.72-2.121.917-.125 2.75-.357 3.2-.722v1.744c.01 1.643-1.321 3.042-3.422 3.042v.005Zm9.244 2.26h3.433v-2.332h.201c.551 1.08 1.698 2.593 4.244 2.593 3.489 0 6.102-2.768 6.102-7.644 0-4.936-2.69-7.616-6.112-7.616-2.613 0-3.702 1.57-4.234 2.641h-.147V2.737h-3.486V22.48Zm3.423-7.403c0-2.88 1.234-4.734 3.48-4.734 2.323 0 3.52 1.976 3.52 4.734 0 2.759-1.214 4.8-3.52 4.8-2.227 0-3.48-1.928-3.48-4.8Z"
fill="#fff"/>
<path class="tanuki-shape tanuki" d="m24.507 9.5-.034-.09L21.082.562a.896.896 0 0 0-1.694.091l-2.29 7.01H7.825L5.535.653a.898.898 0 0 0-1.694-.09L.451 9.411.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z"

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,24 @@
# frozen_string_literal: true
class AddIndexForGroupVulnerabilitiesAysnc < Gitlab::Database::Migration[2.1]
# The column used with the IN query and the columns in the ORDER BY
# clause are covered with a database index. The columns in the index
# must be in the following order: column_for_the_in_query, order by
# column 1, and order by column 2.
#
# https://docs.gitlab.com/ee/development/database/efficient_in_operator_queries.html#requirements
INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id'
TABLE_NAME = :vulnerabilities
COLUMN_NAMES = [:project_id, :id]
disable_ddl_transaction!
def up
# TODO: Issue for synchronous migration https://gitlab.com/gitlab-org/gitlab/-/issues/426371
prepare_async_index :vulnerabilities, COLUMN_NAMES, name: INDEX_NAME
end
def down
unprepare_async_index :vulnerabilities, COLUMN_NAMES, name: INDEX_NAME
end
end

View File

@ -0,0 +1 @@
752365c845420a51028efdbc247745543c7bef9633921da95151e3c9495a8044

View File

@ -58,6 +58,10 @@ tier. Users can continue to access the features in a paid tier without sharing u
- [Coverage-guided fuzz testing](../../user/application_security/coverage_fuzzing/index.md).
- [Password complexity requirements](../../administration/settings/sign_up_restrictions.md#password-complexity-requirements).
### Features available in 16.6 and later
- [Group wikis](../../user/project/wiki/group.md).
NOTE:
Registration is not yet required for participation, but may be added in a future milestone.

View File

@ -38,13 +38,18 @@ However, if we count the number of page view events happening in the week before
and then compare it with the number of events for the week following the feature release,
we can derive insights about the increase in interest due to the release of the new feature.
This process leads to what we call a metric. An event-based metric always looks at counts them for a specified time frame, like a week.
This process leads to what we call a metric. An event-based metric counts the number of times an event occurred overall or in a specified time frame.
The same event can be used across different metrics and a metric can count either one or multiple events.
The count can but does not have to be based on a uniqueness criterion, such as only counting distinct users who performed an event.
Metrics do not have to be based on events. Metrics can also be observations about the state of a GitLab instance itself,
such as the value of a setting or the count of rows in a database table.
## Instrumentation
- To instrument an event-based metric, see the [internal event tracking quick start guide](internal_event_instrumentation/quick_start.md).
- To instrument a metric that observes the GitLab instances state, see [the service ping implementation](service_ping/implement.md).
## Data flow
For GitLab there is an essential difference in analytics setup between SaaS and self-managed or GitLab Dedicated instances.
@ -64,7 +69,7 @@ flowchart LR;
service_ping-->|json with metric values - weekly export|snowflake
snowplow-->|event records - continuous import|snowflake
snowflake-->vis
subgraph glb[Gitlab Application]
feature[Feature Code]
subgraph events[Internal Analytics Code]
@ -79,7 +84,7 @@ flowchart LR;
vis[Dashboards in Sisense/Tableau]
```
## Instrumentation
## Data Privacy
- To instrument an event-based metric, please look into the [internal event tracking quick start guide](internal_event_instrumentation/quick_start.md).
- To instrument a metric that observes the GitLab instances state, please start with [the service ping implementation](service_ping/implement.md).
GitLab only receives event counts or similarly aggregated information from self-managed instances. User identifiers for individual events on the SaaS version of GitLab are [pseudonymized](https://metrics.gitlab.com/identifiers).
An exact description on what kind of data is being collected through the Internal Analytics system is given in our [handbook](https://about.gitlab.com/handbook/legal/privacy/customer-product-usage-information/).

View File

@ -50,7 +50,7 @@ By default, self-managed instances do not collect event data via Snowplow. We ca
## Configure a remote event collector
On GitLab.com to a collector configured by GitLab. By default, self-managed instances do not have a collector configured and do not collect data via Snowplow.
On GitLab.com events are sent to a collector configured by GitLab. By default, self-managed instances do not have a collector configured and do not collect data with Snowplow.
You can configure your self-managed GitLab instance to use a custom Snowplow collector.

View File

@ -0,0 +1,58 @@
---
stage: Analyze
group: Analytics Instrumentation
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Internal Analytics review guidelines
This page includes introductory material for an
[Analytics Instrumentation](https://about.gitlab.com/handbook/engineering/development/analytics/analytics-instrumentation/)
review. For broader advice and general best practices for code reviews, refer to our [code review guide](../code_review.md).
## Review process
We mandate an Analytics Instrumentation review when a merge request (MR) touches or uses internal analytics code.
This includes but is not limited to:
- Metrics, for example:
- files in [`config/metrics`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/config/metrics).
- files in [`ee/config/metrics`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/ee/config/metrics).
- [`schema.json`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/schema.json).
- Internal events, for example files in [`config/events`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/config/events).
- Analytics Instrumentation tooling, for example [`InternalEventsGenerator`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/generators/gitlab/analytics/internal_events_generator.rb).
In most cases, an Analytics Instrumentation review is automatically added, but it can also be requested manually if the automations miss the relevant change.
### Roles and process
#### The merge request **author** should
- Decide whether a Analytics Instrumentation review is needed. You can skip the Analytics Instrumentation
review and remove the labels if the changes are not related to the Analytics Instrumentation domain.
- If an Analytics Instrumentation review is needed and was not assigned automatically, add the labels
`~analytics instrumentation` and `~analytics instrumentation::review pending`.
- Use reviewer roulette to assign an [Analytics Instrumentation reviewer](https://gitlab-org.gitlab.io/gitlab-roulette/?hourFormat24=true&visible=reviewer%7Canalytics+instrumentation) who is not the author.
- Assign any other reviews as appropriate.
- `~analytics instrumentation` review does not require a maintainer review.
#### The Analytics Instrumentation **reviewer** should
- Perform a first-pass review on the merge request and suggest improvements to the author.
- Make sure that no deprecated analytics methods are used.
- If a change to an event is a part of the review:
- Check that the [event definition file](internal_event_instrumentation/event_definition_guide.md) is correct.
- Check that the events are firing locally using one of the [testing tools](internal_event_instrumentation/local_setup_and_debugging.md) available.
- If a change to a metric is a part of the review:
- Add the `~database` label and ask for a [database review](../database_review.md) for
metrics that are based on Database.
- For a metric's YAML definition:
- Check the metric's `description`.
- Check the metric's `key_path`.
- Check the `product_section`, `product_stage`, and `product_group` fields.
They should correspond to the [stages file](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml).
- Check the file location. Consider the time frame, and if the file should be under `ee`.
- Check the tiers.
- If a metric was changed or removed: Make sure the MR author notified the Customer Success Ops team (`@csops-team`), Analytics Engineers (`@gitlab-data/analytics-engineers`), and Product Analysts (`@gitlab-data/product-analysts`) by `@` mentioning those groups in a comment on the issue for the MR and all of these groups have acknowledged the removal.
- Make sure that the new metric is available in Service Ping payload, by running: `Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values).dig(*'key_path'.split('.'))` with `key_path` substituted by the new metric's `key_path`.
- Approve the MR, and relabel the MR with `~"analytics instrumentation::approved"`.

View File

@ -663,7 +663,7 @@ Create a merge request for the new Service Ping metric, and do the following:
- Add the `feature` label to the merge request. A metric is a user-facing change and is part of expanding the Service Ping feature.
- Add a changelog entry that complies with the [changelog entries guide](../../changelog.md).
- Ask for an Analytics Instrumentation review.
On GitLab.com, we have DangerBot set up to monitor Analytics Instrumentation related files and recommend a [Analytics Instrumentation review](review_guidelines.md).
On GitLab.com, we have DangerBot set up to monitor Analytics Instrumentation related files and recommend a [Analytics Instrumentation review](../review_guidelines.md).
## Verify your metric

View File

@ -1,81 +1,11 @@
---
stage: Analyze
group: Analytics Instrumentation
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
redirect_to: '../review_guidelines.md'
remove_date: '2023-12-29'
---
# Service Ping review guidelines
This document was moved to [another location](../review_guidelines.md).
This page includes introductory material for a
[Analytics Instrumentation](https://about.gitlab.com/handbook/engineering/development/analytics/analytics-instrumentation/)
review, and is specific to Service Ping related reviews. For broader advice and
general best practices for code reviews, refer to our [code review guide](../../code_review.md).
## Resources for reviewers
- [Service Ping Guide](index.md)
- [Metrics Dictionary](https://metrics.gitlab.com/)
## Review process
We recommend a Analytics Instrumentation review when a merge request (MR) touches
any of the following Service Ping files:
- `usage_data*` files.
- The Metrics Dictionary, including files in:
- [`config/metrics`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/config/metrics).
- [`ee/config/metrics`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/ee/config/metrics).
- [`schema.json`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/schema.json).
- Analytics Instrumentation tooling. For example,
[`Gitlab::UsageMetricDefinitionGenerator`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/generators/gitlab/usage_metric_definition_generator.rb)
### Roles and process
#### The merge request **author** should
- Decide whether a Analytics Instrumentation review is needed. You can skip the Analytics Instrumentation
review and remove the labels if the changes are not related to the Analytics Instrumentation domain and
are regular backend changes.
- If a Analytics Instrumentation review is needed, add the labels
`~analytics instrumentation` and `~analytics instrumentation::review pending`.
- For merge requests authored by Analytics Instrumentation team members:
- Assign both the `~backend` and `~analytics instrumentation` reviews to another Analytics Instrumentation team member.
- Assign the maintainer review to someone outside of the Analytics Instrumentation group.
- Assign an
[engineer](https://gitlab.com/groups/gitlab-org/analytics-section/analytics-instrumentation/engineers/-/group_members?with_inherited_permissions=exclude) from the Analytics Instrumentation team for a review.
- Set the correct attributes in the metric's YAML definition:
- `product_section`, `product_stage`, `product_group`
- Provide a clear description of the metric.
- Add a changelog [according to guidelines](../../changelog.md).
#### The Analytics Instrumentation **reviewer** should
- Perform a first-pass review on the merge request and suggest improvements to the author.
- Check the [metric's location](../metrics/metrics_dictionary.md#metric-key_path) in
the Service Ping JSON payload.
- Add the `~database` label and ask for a [database review](../../database_review.md) for
metrics that are based on Database.
- Add `~Data Warehouse::Impact Check` for any database metric that has a query change. Changes in queries can affect [data operations](https://about.gitlab.com/handbook/business-technology/data-team/how-we-work/triage/#gitlabcom-db-structure-changes).
- For tracking using Redis HLL (HyperLogLog):
- Check if a [feature flag is needed](implement.md#recommendations).
- For a metric's YAML definition:
- Check the metric's `description`.
- Check the metric's `key_path`.
- Check the `product_section`, `product_stage`, and `product_group` fields.
Read the [stages file](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml).
- Check the file location. Consider the time frame, and if the file should be under `ee`.
- Check the tiers.
- If a metric was changed or removed: Make sure the MR author notified the Customer Success Ops team (`@csops-team`), Analytics Engineers (`@gitlab-data/analytics-engineers`), and Product Analysts (`@gitlab-data/product-analysts`) by `@` mentioning those groups in a comment on the issue for the MR and all of these groups have acknowledged the removal.
- Make sure that the new metric is available in Service Ping payload, by running: `Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values).dig(*'key_path'.split('.'))` with `key_path` substituted by the new metric's `key_path`.
- Metrics instrumentations
- Recommend using metrics instrumentation for new metrics, [if possible](metrics_instrumentation.md#support-for-instrumentation-classes).
- Approve the MR, and relabel the MR with `~"analytics instrumentation::approved"`.
## Review workload distribution
[Danger bot](../../dangerbot.md) adds the list of changed Analytics Instrumentation files
and pings the
[`@gitlab-org/analytics-section/analytics-instrumentation/engineers`](https://gitlab.com/groups/gitlab-org/analytics-section/analytics-instrumentation/engineers/-/group_members?with_inherited_permissions=exclude) group for merge requests
that are not drafts.
Any of the Analytics Instrumentation engineers can be assigned for the Analytics Instrumentation review.
<!-- This redirect file can be deleted after <2023-12-29>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->

View File

@ -1,44 +1,11 @@
---
stage: Analyze
group: Analytics Instrumentation
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
redirect_to: '../review_guidelines.md'
remove_date: '2023-12-29'
---
# Snowplow review guidelines
This document was moved to [another location](../review_guidelines.md).
This page includes introductory material for an
[Analytics Instrumentation](https://about.gitlab.com/handbook/engineering/development/analytics/analytics-instrumentation/)
review, and is specific to Snowplow related reviews. For broader advice and
general best practices for code reviews, refer to our [code review guide](../../code_review.md).
## Resources for reviewers
- [Snowplow Guide](index.md)
- [Event Dictionary](https://metrics.gitlab.com/snowplow/)
## Review process
We recommend an Analytics Instrumentation review when a merge request (MR) involves changes in
events or touches Snowplow related files.
### Roles and process
#### The merge request **author** should
- For frontend events, when relevant, add a screenshot of the event in
the [testing tool](implementation.md#develop-and-test-snowplow) used.
- For backend events, when relevant, add the output of the
[Snowplow Micro](implementation.md#test-backend-events-with-snowplow-micro) good events
`GET http://localhost:9090/micro/good` (it might be a good idea
to reset with `GET http://localhost:9090/micro/reset` first).
- Add or update the event definition file according to the [Event Dictionary Guide](event_dictionary_guide.md).
#### The Analytics Instrumentation **reviewer** should
- Check that the [event schema](index.md#event-schema) is correct.
- Check the [usage recommendations](implementation.md#usage-recommendations).
- Check that an event definition file was created or updated in accordance with the [Event Dictionary Guide](event_dictionary_guide.md).
- If needed, check that the events are firing locally using one of the
[testing tools](implementation.md#develop-and-test-snowplow) available.
- Approve the MR, and relabel the MR with `~"analytics instrumentation::approved"`.
- If the snowplow event mirrors a RedisHLL event, then tag @mdrussell to review if the payload is usable for this purpose.
<!-- This redirect file can be deleted after <2023-12-29>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->

View File

@ -143,8 +143,10 @@ module Gitlab
# rubocop:disable Rails/SquishedSQLHeredocs
sql = <<~SQL
SELECT indexname, indexdef
FROM pg_indexes
WHERE indexname NOT LIKE '%_pkey' AND schemaname IN ($1, $2);
FROM pg_indexes i
LEFT JOIN pg_constraint AS c ON i.indexname = c.conname
WHERE i.indexname NOT LIKE '%_pkey' AND schemaname IN ($1, $2)
AND c.conname IS NULL;
SQL
# rubocop:enable Rails/SquishedSQLHeredocs

View File

@ -61,7 +61,7 @@ module Gitlab
additional_access_tokens: user_settings[:additional_access_tokens]
)
import_data = project.create_or_update_import_data(
import_data = project.build_or_assign_import_data(
data: {
optional_stages: optional_stages,
timeout_strategy: user_settings[:timeout_strategy]

View File

@ -35024,6 +35024,9 @@ msgstr ""
msgid "Pipeline|This pipeline ran on the contents of this merge request combined with the contents of all other merge requests queued for merging into the target branch."
msgstr ""
msgid "Pipeline|This pipeline ran on the contents of this merge request combined with the contents of the target branch."
msgstr ""
msgid "Pipeline|This pipeline ran on the contents of this merge request's source branch, not the target branch."
msgstr ""
@ -35060,6 +35063,9 @@ msgstr ""
msgid "Pipeline|merge train"
msgstr ""
msgid "Pipeline|merged results"
msgstr ""
msgid "Pipeline|on"
msgstr ""

View File

@ -15,6 +15,7 @@ describe('Pipeline label component', () => {
const findAutoDevopsTag = () => wrapper.findByTestId('pipeline-url-autodevops');
const findAutoDevopsTagLink = () => wrapper.findByTestId('pipeline-url-autodevops-link');
const findDetachedTag = () => wrapper.findByTestId('pipeline-url-detached');
const findMergedResultsTag = () => wrapper.findByTestId('pipeline-url-merged-results');
const findFailureTag = () => wrapper.findByTestId('pipeline-url-failure');
const findForkTag = () => wrapper.findByTestId('pipeline-url-fork');
const findTrainTag = () => wrapper.findByTestId('pipeline-url-train');
@ -41,6 +42,7 @@ describe('Pipeline label component', () => {
expect(findScheduledTag().exists()).toBe(false);
expect(findForkTag().exists()).toBe(false);
expect(findTrainTag().exists()).toBe(false);
expect(findMergedResultsTag().exists()).toBe(false);
});
it('should render the stuck tag when flag is provided', () => {
@ -140,6 +142,28 @@ describe('Pipeline label component', () => {
expect(findForkTag().text()).toBe('fork');
});
it('should render the merged results badge when the pipeline is a merged results pipeline', () => {
const mergedResultsPipeline = defaultProps.pipeline;
mergedResultsPipeline.flags.merged_result_pipeline = true;
createComponent({
...mergedResultsPipeline,
});
expect(findMergedResultsTag().text()).toBe('merged results');
});
it('should not render the merged results badge when the pipeline is not a merged results pipeline', () => {
const mergedResultsPipeline = defaultProps.pipeline;
mergedResultsPipeline.flags.merged_result_pipeline = false;
createComponent({
...mergedResultsPipeline,
});
expect(findMergedResultsTag().exists()).toBe(false);
});
it('should render the train badge when the pipeline is a merge train pipeline', () => {
const mergeTrainPipeline = defaultProps.pipeline;
mergeTrainPipeline.flags.merge_train_pipeline = true;

View File

@ -240,7 +240,7 @@ RSpec.describe AppearancesHelper do
let!(:appearance) { create(:appearance, :with_header_logo) }
it 'renders image tag' do
expect(helper).to receive(:image_tag).with(appearance.header_logo_path, class: 'brand-header-logo')
expect(helper).to receive(:image_tag).with(appearance.header_logo_path, class: 'brand-header-logo', alt: '')
subject
end

View File

@ -68,7 +68,7 @@ RSpec.describe Gitlab::GithubImport::Settings, feature_category: :importers do
end
it 'puts optional steps, timeout strategy & access tokens into projects import_data' do
project.create_or_update_import_data(credentials: { user: 'token' })
project.build_or_assign_import_data(credentials: { user: 'token' })
settings.write(data_input)
@ -83,7 +83,7 @@ RSpec.describe Gitlab::GithubImport::Settings, feature_category: :importers do
describe '#enabled?' do
it 'returns is enabled or not specific optional stage' do
project.create_or_update_import_data(data: { optional_stages: optional_stages })
project.build_or_assign_import_data(data: { optional_stages: optional_stages })
expect(settings.enabled?(:single_endpoint_issue_events_import)).to eq true
expect(settings.enabled?(:single_endpoint_notes_import)).to eq false
@ -94,7 +94,7 @@ RSpec.describe Gitlab::GithubImport::Settings, feature_category: :importers do
describe '#disabled?' do
it 'returns is disabled or not specific optional stage' do
project.create_or_update_import_data(data: { optional_stages: optional_stages })
project.build_or_assign_import_data(data: { optional_stages: optional_stages })
expect(settings.disabled?(:single_endpoint_issue_events_import)).to eq false
expect(settings.disabled?(:single_endpoint_notes_import)).to eq true

View File

@ -80,7 +80,7 @@ RSpec.describe Gitlab::ImportExport::Importer do
context 'with sample_data_template' do
it 'initializes the Sample::TreeRestorer' do
project.create_or_update_import_data(data: { sample_data: true })
project.build_or_assign_import_data(data: { sample_data: true })
expect(Gitlab::ImportExport::Project::Sample::TreeRestorer).to receive(:new).and_call_original
@ -112,7 +112,7 @@ RSpec.describe Gitlab::ImportExport::Importer do
end
it 'sets the correct visibility_level when visibility level is a string' do
project.create_or_update_import_data(
project.build_or_assign_import_data(
data: { override_params: { visibility_level: Gitlab::VisibilityLevel::PRIVATE.to_s } }
)

View File

@ -154,6 +154,11 @@ module StubConfiguration
stub_application_setting(maintenance_mode: value)
end
def stub_usage_ping_features(value)
stub_application_setting(usage_ping_enabled: value)
stub_application_setting(usage_ping_features_enabled: value)
end
private
# Modifies stubbed messages to also stub possible predicate versions

View File

@ -100,7 +100,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:|
context 'with an optimistic strategy' do
before do
project.create_or_update_import_data(data: { timeout_strategy: "optimistic" })
project.build_or_assign_import_data(data: { timeout_strategy: "optimistic" })
project.save!
end

View File

@ -11,7 +11,7 @@ module Tooling
For the following files, a review from the [Data team and Analytics Instrumentation team](https://gitlab.com/groups/gitlab-org/analytics-section/analytics-instrumentation/engineers/-/group_members?with_inherited_permissions=exclude) is recommended
Please check the ~"analytics instrumentation" [Service Ping guide](https://docs.gitlab.com/ee/development/service_ping/) or the [Snowplow guide](https://docs.gitlab.com/ee/development/snowplow/).
For MR review guidelines, see the [Service Ping review guidelines](https://docs.gitlab.com/ee/development/service_ping/review_guidelines.html) or the [Snowplow review guidelines](https://docs.gitlab.com/ee/development/snowplow/review_guidelines.html).
For MR review guidelines, see the [Internal Analytics review guidelines](https://docs.gitlab.com/ee/development/internal_analytics/review_guidelines.html).
%<changed_files>s