Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
a2beea8ce7
commit
3dbedd8bf6
|
|
@ -2,86 +2,6 @@
|
|||
# Cop supports --autocorrect.
|
||||
Style/PercentLiteralDelimiters:
|
||||
Exclude:
|
||||
- 'ee/spec/controllers/ee/sessions_controller_spec.rb'
|
||||
- 'ee/spec/controllers/groups/saml_providers_controller_spec.rb'
|
||||
- 'ee/spec/controllers/groups/scim_oauth_controller_spec.rb'
|
||||
- 'ee/spec/controllers/groups/sso_controller_spec.rb'
|
||||
- 'ee/spec/controllers/projects/issues_controller_spec.rb'
|
||||
- 'ee/spec/controllers/projects/pipelines_controller_spec.rb'
|
||||
- 'ee/spec/controllers/projects/security/configuration_controller_spec.rb'
|
||||
- 'ee/spec/elastic_integration/global_search_spec.rb'
|
||||
- 'ee/spec/factories/dast/profile_schedule_input_type.rb'
|
||||
- 'ee/spec/factories/dast/profile_schedules.rb'
|
||||
- 'ee/spec/features/admin/admin_reset_pipeline_minutes_spec.rb'
|
||||
- 'ee/spec/features/admin/geo/admin_geo_nodes_spec.rb'
|
||||
- 'ee/spec/features/groups/sso_spec.rb'
|
||||
- 'ee/spec/features/profiles/account_spec.rb'
|
||||
- 'ee/spec/features/projects/environments/environments_spec.rb'
|
||||
- 'ee/spec/features/projects/integrations/user_activates_jira_spec.rb'
|
||||
- 'ee/spec/features/projects/settings/protected_environments_spec.rb'
|
||||
- 'ee/spec/features/users/login_spec.rb'
|
||||
- 'ee/spec/finders/template_finder_spec.rb'
|
||||
- 'ee/spec/frontend/fixtures/saml_providers.rb'
|
||||
- 'ee/spec/graphql/ee/resolvers/board_lists_resolver_spec.rb'
|
||||
- 'ee/spec/graphql/ee/types/boards/board_issue_input_type_spec.rb'
|
||||
- 'ee/spec/graphql/mutations/boards/update_spec.rb'
|
||||
- 'ee/spec/graphql/resolvers/board_groupings/epics_resolvers_spec.rb'
|
||||
- 'ee/spec/graphql/resolvers/pipeline_security_report_findings_resolver_spec.rb'
|
||||
- 'ee/spec/graphql/types/dast/profile_cadence_enum_spec.rb'
|
||||
- 'ee/spec/graphql/types/dast/scan_method_type_enum_spec.rb'
|
||||
- 'ee/spec/graphql/types/incident_management/escalation_rule_input_type_spec.rb'
|
||||
- 'ee/spec/graphql/types/scan_type_spec.rb'
|
||||
- 'ee/spec/graphql/types/vulnerable_projects_by_grade_type_spec.rb'
|
||||
- 'ee/spec/helpers/ee/application_settings_helper_spec.rb'
|
||||
- 'ee/spec/helpers/ee/auth_helper_spec.rb'
|
||||
- 'ee/spec/helpers/ee/environments_helper_spec.rb'
|
||||
- 'ee/spec/helpers/ee/labels_helper_spec.rb'
|
||||
- 'ee/spec/helpers/ee/security_orchestration_helper_spec.rb'
|
||||
- 'ee/spec/helpers/merge_requests_helper_spec.rb'
|
||||
- 'ee/spec/helpers/subscriptions_helper_spec.rb'
|
||||
- 'ee/spec/helpers/vulnerabilities_helper_spec.rb'
|
||||
- 'ee/spec/lib/banzai/filter/references/epic_reference_filter_spec.rb'
|
||||
- 'ee/spec/lib/banzai/filter/references/iteration_reference_filter_spec.rb'
|
||||
- 'ee/spec/lib/banzai/filter/references/vulnerability_reference_filters_spec.rb'
|
||||
- 'ee/spec/lib/ee/backup/repositories_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/alert_management/payload/generic_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/auth/ldap/access_levels_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/auth/ldap/config_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/auth/ldap/group_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/auth/ldap/sync/external_users_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/auth/ldap/sync/group_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/auth/ldap/sync/groups_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/git_access_design_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/git_access_snippet_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/security/scan_configuration_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/usage_data_spec.rb'
|
||||
- 'ee/spec/lib/elastic/latest/custom_language_analyzers_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/alert_management/alert_payload_field_extractor_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/request_params_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/auth/group_saml/auth_hash_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/auth/group_saml/membership_updater_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/auth/group_saml/user_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/auth/ldap/adapter_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/auth/ldap/person_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/auth/saml/user_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/authority_analyzer_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/cache_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/reports/security/finding_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/Jobs/dast_default_branch_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/dependency_scanning_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/sast_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/sast_iac_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/sast_latest_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/secret_detection_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/ci/templates/secret_detection_latest_gitlab_ci_yaml_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/expiring_subscription_message_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/git_access_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/graphql/aggregations/epics/lazy_epic_aggregate_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/status_page/filter/image_filter_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/status_page/filter/mention_anonymization_filter_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/status_page/storage/s3_client_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/status_page/storage/s3_multipart_upload_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/vulnerabilities/parser_spec.rb'
|
||||
- 'ee/spec/mailers/ci_minutes_usage_mailer_spec.rb'
|
||||
- 'ee/spec/mailers/credentials_inventory_mailer_spec.rb'
|
||||
- 'ee/spec/mailers/ee/emails/profile_spec.rb'
|
||||
|
|
@ -414,7 +334,6 @@ Style/PercentLiteralDelimiters:
|
|||
- 'spec/lib/gitlab/popen_spec.rb'
|
||||
- 'spec/lib/gitlab/process_management_spec.rb'
|
||||
- 'spec/lib/gitlab/process_supervisor_spec.rb'
|
||||
- 'spec/lib/gitlab/prometheus/queries/matched_metric_query_spec.rb'
|
||||
- 'spec/lib/gitlab/prometheus/query_variables_spec.rb'
|
||||
- 'spec/lib/gitlab/quick_actions/extractor_spec.rb'
|
||||
- 'spec/lib/gitlab/reference_extractor_spec.rb'
|
||||
|
|
|
|||
|
|
@ -15707,6 +15707,18 @@ Represents the Geo replication and verification state of a dependency_proxy_mani
|
|||
| <a id="dependencyproxymanifestregistryverificationstate"></a>`verificationState` | [`VerificationStateEnum`](#verificationstateenum) | Verification state of the DependencyProxyManifestRegistry. |
|
||||
| <a id="dependencyproxymanifestregistryverifiedat"></a>`verifiedAt` | [`Time`](#time) | Timestamp of the most recent successful verification of the DependencyProxyManifestRegistry. |
|
||||
|
||||
### `DependencyProxyPackagesSetting`
|
||||
|
||||
Project-level Dependency Proxy for packages settings.
|
||||
|
||||
#### Fields
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="dependencyproxypackagessettingenabled"></a>`enabled` **{warning-solid}** | [`Boolean!`](#boolean) | **Introduced** in 16.5. This feature is an Experiment. It can be changed or removed at any time. Indicates whether the dependency proxy for packages is enabled for the project. |
|
||||
| <a id="dependencyproxypackagessettingmavenexternalregistryurl"></a>`mavenExternalRegistryUrl` **{warning-solid}** | [`String`](#string) | **Introduced** in 16.5. This feature is an Experiment. It can be changed or removed at any time. URL for the external Maven packages registry. |
|
||||
| <a id="dependencyproxypackagessettingmavenexternalregistryusername"></a>`mavenExternalRegistryUsername` **{warning-solid}** | [`String`](#string) | **Introduced** in 16.5. This feature is an Experiment. It can be changed or removed at any time. Username for the external Maven packages registry. |
|
||||
|
||||
### `DependencyProxySetting`
|
||||
|
||||
Group-level Dependency Proxy settings.
|
||||
|
|
@ -21929,6 +21941,7 @@ Represents vulnerability finding of a security report on the pipeline.
|
|||
| <a id="projectcreatedat"></a>`createdAt` | [`Time`](#time) | Timestamp of the project creation. |
|
||||
| <a id="projectdastscannerprofiles"></a>`dastScannerProfiles` | [`DastScannerProfileConnection`](#dastscannerprofileconnection) | DAST scanner profiles associated with the project. (see [Connections](#connections)) |
|
||||
| <a id="projectdastsiteprofiles"></a>`dastSiteProfiles` | [`DastSiteProfileConnection`](#dastsiteprofileconnection) | DAST Site Profiles associated with the project. (see [Connections](#connections)) |
|
||||
| <a id="projectdependencyproxypackagessetting"></a>`dependencyProxyPackagesSetting` **{warning-solid}** | [`DependencyProxyPackagesSetting`](#dependencyproxypackagessetting) | **Introduced** in 16.5. This feature is an Experiment. It can be changed or removed at any time. Packages Dependency Proxy settings for the project. Requires the packages and dependency proxy to be enabled in the config. Requires the packages feature to be enabled at the project level. Returns `null` if `packages_dependency_proxy_maven` feature flag is disabled. |
|
||||
| <a id="projectdescription"></a>`description` | [`String`](#string) | Short description of the project. |
|
||||
| <a id="projectdescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | GitLab Flavored Markdown rendering of `description`. |
|
||||
| <a id="projectdora"></a>`dora` | [`Dora`](#dora) | Project's DORA metrics. |
|
||||
|
|
|
|||
|
|
@ -400,12 +400,7 @@ The following is an example response:
|
|||
|
||||
### Deprecated fields
|
||||
|
||||
The fields `scopes` and `expires_in_seconds` are included in the response.
|
||||
|
||||
These fields are aliases for `scope` and `expires_in` respectively, and have been included to
|
||||
prevent breaking changes introduced in [doorkeeper 5.0.2](https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions#from-4x-to-5x).
|
||||
|
||||
Don't rely on these fields as they are slated for removal in a later release.
|
||||
The fields `scopes` and `expires_in_seconds` are included in the response but are now deprecated. The `scopes` field is an alias for `scope`, and the `expires_in_seconds` field is an alias for `expires_in`. For more information, see [Doorkeeper API changes](https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions#api-changes-5).
|
||||
|
||||
## Revoke a token
|
||||
|
||||
|
|
|
|||
|
|
@ -317,6 +317,10 @@ To publish a package by using Gradle:
|
|||
|
||||
## Publish a package
|
||||
|
||||
WARNING:
|
||||
Using the `DeployAtEnd` option can cause an upload to be rejected with `400 bad request {"message":"Validation failed: Name has already been taken"}`. For more details,
|
||||
see [issue 424238](https://gitlab.com/gitlab-org/gitlab/-/issues/424238).
|
||||
|
||||
After you have set up the [authentication](#authenticate-to-the-package-registry)
|
||||
and [chosen an endpoint for publishing](#naming-convention),
|
||||
publish a Maven package to your project.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,159 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Internal Events Tracking Monitor
|
||||
#
|
||||
# This script provides real-time monitoring of Internal Events Tracking-related metrics and Snowplow events.
|
||||
#
|
||||
# Usage:
|
||||
# Run this script in your terminal with specific event names as command-line arguments. It will continuously
|
||||
# display relevant metrics and Snowplow events associated with the provided event names.
|
||||
#
|
||||
# Example:
|
||||
# To monitor events 'g_edit_by_web_ide' and 'g_edit_by_sfe', execute:
|
||||
# ```
|
||||
# bin/rails runner scripts/internal_events/monitor.rb g_edit_by_web_ide g_edit_by_sfe
|
||||
# ```
|
||||
#
|
||||
# Exiting:
|
||||
# - To exit the script, press Ctrl+C.
|
||||
#
|
||||
|
||||
require 'terminal-table'
|
||||
require 'net/http'
|
||||
|
||||
module ExtendedTimeFrame
|
||||
def weekly_time_range
|
||||
super.tap { |h| h[:end_date] = 1.week.from_now }
|
||||
end
|
||||
|
||||
def monthly_time_range
|
||||
super.tap { |h| h[:end_date] = 1.week.from_now }
|
||||
end
|
||||
end
|
||||
Gitlab::Usage::TimeFrame.prepend(ExtendedTimeFrame)
|
||||
|
||||
def metric_definitions_from_args
|
||||
args = ARGV
|
||||
Gitlab::Usage::MetricDefinition.all.select do |metric|
|
||||
metric.available? && args.any? { |arg| metric.events.key?(arg) }
|
||||
end
|
||||
end
|
||||
|
||||
def red(text)
|
||||
"\e[31m#{text}\e[0m"
|
||||
end
|
||||
|
||||
def snowplow_data
|
||||
url = Gitlab::Tracking::Destinations::SnowplowMicro.new.uri.merge('/micro/good')
|
||||
response = Net::HTTP.get_response(url)
|
||||
|
||||
return JSON.parse(response.body) if response.is_a?(Net::HTTPSuccess)
|
||||
|
||||
raise "Request failed: #{response.code}"
|
||||
end
|
||||
|
||||
def extract_standard_context(event)
|
||||
event['event']['contexts']['data'].each do |context|
|
||||
next unless context['schema'].start_with?('iglu:com.gitlab/gitlab_standard/jsonschema')
|
||||
|
||||
return {
|
||||
user_id: context["data"]["user_id"],
|
||||
namespace_id: context["data"]["namespace_id"],
|
||||
project_id: context["data"]["project_id"],
|
||||
plan: context["data"]["plan"]
|
||||
}
|
||||
end
|
||||
{}
|
||||
end
|
||||
|
||||
def generate_snowplow_table
|
||||
events = snowplow_data.select { |d| ARGV.include?(d["event"]["se_action"]) }
|
||||
@initial_max_timestamp ||= events.map { |e| e['rawEvent']['parameters']['dtm'].to_i }.max || 0
|
||||
|
||||
rows = []
|
||||
rows << ['Event Name', 'Collector Timestamp', 'user_id', 'namespace_id', 'project_id', 'plan']
|
||||
rows << :separator
|
||||
|
||||
events.each do |event|
|
||||
standard_context = extract_standard_context(event)
|
||||
|
||||
row = [
|
||||
event['event']['se_action'],
|
||||
event['event']['collector_tstamp'],
|
||||
standard_context[:user_id],
|
||||
standard_context[:namespace_id],
|
||||
standard_context[:project_id],
|
||||
standard_context[:plan]
|
||||
]
|
||||
|
||||
row.map! { |value| red(value) } if event['rawEvent']['parameters']['dtm'].to_i > @initial_max_timestamp
|
||||
|
||||
rows << row
|
||||
end
|
||||
|
||||
Terminal::Table.new(
|
||||
title: 'SNOWPLOW EVENTS',
|
||||
rows: rows
|
||||
)
|
||||
end
|
||||
|
||||
def relevant_events_from_args(metric_definition)
|
||||
metric_definition.events.keys.intersection(ARGV).sort
|
||||
end
|
||||
|
||||
def generate_metrics_table
|
||||
metric_definitions = metric_definitions_from_args
|
||||
rows = []
|
||||
rows << ['Key Path', 'Monitored Events', 'Instrumentation Class', 'Initial Value', 'Current Value']
|
||||
rows << :separator
|
||||
|
||||
@initial_values ||= {}
|
||||
|
||||
metric_definitions.sort_by(&:key).each do |definition|
|
||||
metric = Gitlab::Usage::Metric.new(definition)
|
||||
value = metric.send(:instrumentation_object).value # rubocop:disable GitlabSecurity/PublicSend
|
||||
@initial_values[definition.key] ||= value
|
||||
|
||||
initial_value = @initial_values[definition.key]
|
||||
|
||||
value = red(value) if initial_value != value
|
||||
|
||||
rows << [
|
||||
definition.key,
|
||||
relevant_events_from_args(definition).join(', '),
|
||||
definition.instrumentation_class,
|
||||
initial_value,
|
||||
value
|
||||
]
|
||||
end
|
||||
|
||||
Terminal::Table.new(
|
||||
title: 'RELEVANT METRICS',
|
||||
rows: rows
|
||||
)
|
||||
end
|
||||
|
||||
print "\e[?1049h" # Stores the original screen buffer
|
||||
print "\e[H" # Moves the cursor home
|
||||
begin
|
||||
loop do
|
||||
metrics_table = generate_metrics_table
|
||||
events_table = generate_snowplow_table
|
||||
|
||||
print "\e[H" # Moves the cursor home
|
||||
print "\e[2J" # Clears the screen buffer
|
||||
|
||||
puts "Updated at #{Time.current}"
|
||||
puts "Monitored events: #{ARGV.join(', ')}"
|
||||
puts
|
||||
|
||||
puts metrics_table
|
||||
|
||||
puts events_table
|
||||
|
||||
sleep 1
|
||||
end
|
||||
ensure
|
||||
print "\e[?1049l" # Restores the original screen buffer
|
||||
print "\e[H" # Moves the cursor home
|
||||
end
|
||||
Loading…
Reference in New Issue