From 958f41148d08b03a9bbe37adecd6e3b0b10a7219 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 6 Sep 2022 18:10:28 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../ci/package-and-test/main.gitlab-ci.yml | 54 +++- .../package-and-test/variables.gitlab-ci.yml | 2 +- .../subscriptions/components/app.vue | 6 +- .../components/sign_in_oauth_button.vue | 26 +- .../jira_connect/subscriptions/constants.js | 4 + .../sign_in_gitlab_multiversion/index.vue | 2 + .../version_select_form.vue | 3 +- .../jira_connect/subscriptions/store/state.js | 8 +- .../jira_connect/subscriptions/utils.js | 41 +++- app/controllers/groups_controller.rb | 1 + app/finders/projects_finder.rb | 4 +- .../ci/runner_owner_project_resolver.rb | 15 +- .../resolvers/ci/runner_projects_resolver.rb | 63 +++++ .../concerns/project_search_arguments.rb | 36 +++ app/graphql/resolvers/projects_resolver.rb | 32 +-- app/graphql/types/ci/runner_type.rb | 20 +- app/models/concerns/enums/internal_id.rb | 3 +- app/models/group.rb | 16 ++ app/models/ml/experiment.rb | 26 +- app/models/namespace.rb | 2 + app/models/namespace_setting.rb | 10 + app/models/project.rb | 3 + app/models/project_setting.rb | 11 + app/policies/group_policy.rb | 1 + app/policies/project_policy.rb | 1 + app/views/projects/blob/_header.html.haml | 11 +- .../development/ml_experiment_tracking.yml | 8 + .../usage_quotas_for_all_editions.yml | 8 + .../use_gitaly_pagination_for_refs.yml | 2 +- config/initializers/postgres_partitioning.rb | 3 +- ...ode_review_total_unique_counts_monthly.yml | 144 +++++++---- ...unt_notes_in_ipynb_diff_commit_monthly.yml | 27 ++ ...0641_count_notes_in_ipynb_diff_monthly.yml | 27 ++ ...1_count_notes_in_ipynb_diff_mr_monthly.yml | 27 ++ ...ith_notes_in_ipynb_diff_commit_monthly.yml | 27 ++ ...users_with_notes_in_ipynb_diff_monthly.yml | 27 ++ ...rs_with_notes_in_ipynb_diff_mr_monthly.yml | 27 ++ ...code_review_total_unique_counts_weekly.yml | 166 ++++++++----- ...ount_notes_in_ipynb_diff_commit_weekly.yml | 27 ++ ...41_count_notes_in_ipynb_diff_mr_weekly.yml | 27 ++ ...50641_count_notes_in_ipynb_diff_weekly.yml | 27 ++ ...with_notes_in_ipynb_diff_commit_weekly.yml | 27 ++ ...ers_with_notes_in_ipynb_diff_mr_weekly.yml | 27 ++ ..._users_with_notes_in_ipynb_diff_weekly.yml | 27 ++ ..._preview_in_email_to_namespace_settings.rb | 9 + ...ff_preview_in_email_to_project_settings.rb | 9 + ...132108_add_deleted_on_to_ml_experiments.rb | 7 + ...chedule_destroy_invalid_project_members.rb | 0 ...ble_to_gitlab_partitions_dynamic_schema.rb | 232 ++++++++++++++++++ ...c_index_to_todos_to_cover_pending_query.rb | 16 ++ db/schema_migrations/20220603125200 | 1 + db/schema_migrations/20220817122907 | 1 + db/schema_migrations/20220818132108 | 1 + db/schema_migrations/20220902204048 | 1 + db/schema_migrations/20220905112710 | 1 + db/structure.sql | 67 ++--- doc/administration/repository_checks.md | 2 +- doc/api/graphql/reference/index.md | 31 ++- doc/cloud_seed/index.md | 47 ++++ lib/api/api.rb | 1 + lib/api/entities/ml/mlflow/get_experiment.rb | 28 +++ lib/api/entities/ml/mlflow/new_experiment.rb | 19 ++ lib/api/helpers/projects_helpers.rb | 2 + lib/api/ml/mlflow.rb | 94 +++++++ .../partitioning/partition_manager.rb | 14 ++ .../single_numeric_list_partition.rb | 2 +- lib/gitlab/sidekiq_versioning.rb | 6 +- .../usage_data_counters/hll_redis_counter.rb | 2 +- .../known_events/code_review_events.yml | 98 ++------ locale/gitlab.pot | 3 + scripts/generate-e2e-pipeline | 17 +- scripts/trigger-build.rb | 5 +- .../aggregates/aggregated_metrics_spec.rb | 4 +- spec/factories/ml/experiments.rb | 8 + spec/features/projects/blobs/blame_spec.rb | 18 ++ .../api/schemas/ml/get_experiment.json | 23 ++ .../subscriptions/components/app_spec.js | 21 +- .../components/sign_in_oauth_button_spec.js | 15 ++ .../sign_in_gitlab_multiversion/index_spec.js | 7 +- .../ci/runner_projects_resolver_spec.rb | 69 ++++++ .../partitioning/partition_manager_spec.rb | 75 ++++-- spec/lib/gitlab/sidekiq_versioning_spec.rb | 25 +- ...o_gitlab_partitions_dynamic_schema_spec.rb | 108 ++++++++ spec/models/group_spec.rb | 37 ++- spec/models/ml/experiment_spec.rb | 51 ++++ spec/models/namespace_setting_spec.rb | 46 ++++ spec/models/project_setting_spec.rb | 47 ++++ spec/requests/api/graphql/ci/runner_spec.rb | 103 +++++++- spec/requests/api/ml/mlflow_spec.rb | 188 ++++++++++++++ spec/requests/api/project_attributes.yml | 2 + spec/scripts/trigger-build_spec.rb | 34 ++- .../lsif_transformer/parser/code_hover.go | 28 +++ .../parser/code_hover_test.go | 48 ++++ 93 files changed, 2324 insertions(+), 405 deletions(-) create mode 100644 app/graphql/resolvers/ci/runner_projects_resolver.rb create mode 100644 app/graphql/resolvers/concerns/project_search_arguments.rb create mode 100644 config/feature_flags/development/ml_experiment_tracking.yml create mode 100644 config/feature_flags/development/usage_quotas_for_all_editions.yml create mode 100644 config/metrics/counts_28d/20220504150641_count_notes_in_ipynb_diff_commit_monthly.yml create mode 100644 config/metrics/counts_28d/20220504150641_count_notes_in_ipynb_diff_monthly.yml create mode 100644 config/metrics/counts_28d/20220504150641_count_notes_in_ipynb_diff_mr_monthly.yml create mode 100644 config/metrics/counts_28d/20220504150641_count_users_with_notes_in_ipynb_diff_commit_monthly.yml create mode 100644 config/metrics/counts_28d/20220504150641_count_users_with_notes_in_ipynb_diff_monthly.yml create mode 100644 config/metrics/counts_28d/20220504150641_count_users_with_notes_in_ipynb_diff_mr_monthly.yml create mode 100644 config/metrics/counts_7d/20220504150641_count_notes_in_ipynb_diff_commit_weekly.yml create mode 100644 config/metrics/counts_7d/20220504150641_count_notes_in_ipynb_diff_mr_weekly.yml create mode 100644 config/metrics/counts_7d/20220504150641_count_notes_in_ipynb_diff_weekly.yml create mode 100644 config/metrics/counts_7d/20220504150641_count_users_with_notes_in_ipynb_diff_commit_weekly.yml create mode 100644 config/metrics/counts_7d/20220504150641_count_users_with_notes_in_ipynb_diff_mr_weekly.yml create mode 100644 config/metrics/counts_7d/20220504150641_count_users_with_notes_in_ipynb_diff_weekly.yml create mode 100644 db/migrate/20220603125200_add_show_diff_preview_in_email_to_namespace_settings.rb create mode 100644 db/migrate/20220817122907_re_add_show_diff_preview_in_email_to_project_settings.rb create mode 100644 db/migrate/20220818132108_add_deleted_on_to_ml_experiments.rb rename db/{migrate => post_migrate}/20220901035725_schedule_destroy_invalid_project_members.rb (100%) create mode 100644 db/post_migrate/20220902204048_move_security_findings_table_to_gitlab_partitions_dynamic_schema.rb create mode 100644 db/post_migrate/20220905112710_add_async_index_to_todos_to_cover_pending_query.rb create mode 100644 db/schema_migrations/20220603125200 create mode 100644 db/schema_migrations/20220817122907 create mode 100644 db/schema_migrations/20220818132108 create mode 100644 db/schema_migrations/20220902204048 create mode 100644 db/schema_migrations/20220905112710 create mode 100644 lib/api/entities/ml/mlflow/get_experiment.rb create mode 100644 lib/api/entities/ml/mlflow/new_experiment.rb create mode 100644 lib/api/ml/mlflow.rb create mode 100644 spec/factories/ml/experiments.rb create mode 100644 spec/fixtures/api/schemas/ml/get_experiment.json create mode 100644 spec/graphql/resolvers/ci/runner_projects_resolver_spec.rb create mode 100644 spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb create mode 100644 spec/requests/api/ml/mlflow_spec.rb diff --git a/.gitlab/ci/package-and-test/main.gitlab-ci.yml b/.gitlab/ci/package-and-test/main.gitlab-ci.yml index d1280c43903..bfccdce80ec 100644 --- a/.gitlab/ci/package-and-test/main.gitlab-ci.yml +++ b/.gitlab/ci/package-and-test/main.gitlab-ci.yml @@ -35,10 +35,24 @@ stages: RUN_WITH_BUNDLE: "true" # installs and runs gitlab-qa via bundler QA_PATH: qa +.omnibus-env: + variables: + BUILD_ENV: build.env + script: + - | + SECURITY_SOURCES=$([[ ! "$CI_PROJECT_NAMESPACE" =~ ^gitlab-org\/security ]] || echo "true") + echo "SECURITY_SOURCES=${SECURITY_SOURCES:-false}" > $BUILD_ENV + echo "OMNIBUS_GITLAB_CACHE_UPDATE=${OMNIBUS_GITLAB_CACHE_UPDATE:-false}" >> $BUILD_ENV + for version_file in *_VERSION; do echo "$version_file=$(cat $version_file)" >> $BUILD_ENV; done + echo "Built environment file for omnibus build:" + cat $BUILD_ENV + artifacts: + reports: + dotenv: $BUILD_ENV + .update-script: script: - - export CURRENT_VERSION="$(cat ../VERSION)" - - export QA_COMMAND="bundle exec gitlab-qa Test::Omnibus::UpdateFromPrevious $RELEASE $CURRENT_VERSION $UPDATE_TYPE -- $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS" + - export QA_COMMAND="bundle exec gitlab-qa Test::Omnibus::UpdateFromPrevious $RELEASE $GITLAB_VERSION $UPDATE_TYPE -- $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS" - echo "Running - '$QA_COMMAND'" - eval "$QA_COMMAND" @@ -65,16 +79,38 @@ stages: # ========================================== # Prepare stage # ========================================== -trigger-omnibus: +trigger-omnibus-env: extends: - - .ruby-image + - .omnibus-env - .rules:prepare stage: .pre - before_script: - - source scripts/utils.sh - - install_gitlab_gem - script: - - ./scripts/trigger-build.rb omnibus + +trigger-omnibus: + extends: .rules:prepare + stage: .pre + needs: + - trigger-omnibus-env + inherit: + variables: false + variables: + GITALY_SERVER_VERSION: $GITALY_SERVER_VERSION + GITLAB_ELASTICSEARCH_INDEXER_VERSION: $GITLAB_ELASTICSEARCH_INDEXER_VERSION + GITLAB_KAS_VERSION: $GITLAB_KAS_VERSION + GITLAB_METRICS_EXPORTER_VERSION: $GITLAB_METRICS_EXPORTER_VERSION + GITLAB_PAGES_VERSION: $GITLAB_PAGES_VERSION + GITLAB_SHELL_VERSION: $GITLAB_SHELL_VERSION + GITLAB_WORKHORSE_VERSION: $GITLAB_WORKHORSE_VERSION + GITLAB_VERSION: $CI_COMMIT_SHA + IMAGE_TAG: $CI_COMMIT_SHA + TOP_UPSTREAM_SOURCE_PROJECT: $CI_PROJECT_PATH + SECURITY_SOURCES: $SECURITY_SOURCES + CACHE_UPDATE: $OMNIBUS_GITLAB_CACHE_UPDATE + SKIP_QA_DOCKER: "true" + SKIP_QA_TEST: "true" + ee: "true" + trigger: + project: gitlab-org/build/omnibus-gitlab-mirror + strategy: depend download-knapsack-report: extends: diff --git a/.gitlab/ci/package-and-test/variables.gitlab-ci.yml b/.gitlab/ci/package-and-test/variables.gitlab-ci.yml index 545a494eee3..36bb2f8d5f6 100644 --- a/.gitlab/ci/package-and-test/variables.gitlab-ci.yml +++ b/.gitlab/ci/package-and-test/variables.gitlab-ci.yml @@ -1,7 +1,7 @@ # Default variables for package-and-test variables: - RELEASE: "gitlab/gitlab-ee:nightly" + RELEASE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/build/omnibus-gitlab-mirror/gitlab-ee:${CI_COMMIT_SHA}" SKIP_REPORT_IN_ISSUES: "true" OMNIBUS_GITLAB_CACHE_UPDATE: "false" COLORIZED_LOGS: "true" diff --git a/app/assets/javascripts/jira_connect/subscriptions/components/app.vue b/app/assets/javascripts/jira_connect/subscriptions/components/app.vue index 66aea60c5b5..22a6c0751f4 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/components/app.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/components/app.vue @@ -83,7 +83,7 @@ export default { * if the jiraConnectOauth flag is enabled. */ fetchSubscriptionsOauth() { - if (!this.isOauthEnabled) return; + if (!this.isOauthEnabled || !this.userSignedIn) return; this.fetchSubscriptions(this.subscriptionsPath); }, @@ -146,12 +146,12 @@ export default {
- +
diff --git a/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue b/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue index ad3e70bcb5f..d2528e61f21 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue @@ -2,8 +2,10 @@ import { mapActions, mapMutations } from 'vuex'; import { GlButton } from '@gitlab/ui'; import axios from '~/lib/utils/axios_utils'; +import { sprintf } from '~/locale'; import { I18N_DEFAULT_SIGN_IN_BUTTON_TEXT, + I18N_CUSTOM_SIGN_IN_BUTTON_TEXT, OAUTH_WINDOW_OPTIONS, PKCE_CODE_CHALLENGE_DIGEST_ALGORITHM, } from '~/jira_connect/subscriptions/constants'; @@ -17,14 +19,29 @@ export default { GlButton, }, inject: ['oauthMetadata'], + props: { + gitlabBasePath: { + type: String, + required: false, + default: undefined, + }, + }, data() { return { - token: null, loading: false, codeVerifier: null, canUseCrypto: AccessorUtilities.canUseCrypto(), }; }, + computed: { + buttonText() { + if (!this.gitlabBasePath) { + return I18N_DEFAULT_SIGN_IN_BUTTON_TEXT; + } + + return sprintf(I18N_CUSTOM_SIGN_IN_BUTTON_TEXT, { url: this.gitlabBasePath }); + }, + }, created() { window.addEventListener('message', this.handleWindowMessage); }, @@ -56,7 +73,7 @@ export default { window.open( oauthAuthorizeURLWithChallenge, - this.$options.i18n.defaultButtonText, + I18N_DEFAULT_SIGN_IN_BUTTON_TEXT, OAUTH_WINDOW_OPTIONS, ); }, @@ -105,9 +122,6 @@ export default { return data.access_token; }, }, - i18n: { - defaultButtonText: I18N_DEFAULT_SIGN_IN_BUTTON_TEXT, - }, }; diff --git a/app/assets/javascripts/jira_connect/subscriptions/constants.js b/app/assets/javascripts/jira_connect/subscriptions/constants.js index 8faafb1b0d0..2a7d96f24eb 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/constants.js +++ b/app/assets/javascripts/jira_connect/subscriptions/constants.js @@ -3,11 +3,13 @@ import { helpPagePath } from '~/helpers/help_page_helper'; export const DEFAULT_GROUPS_PER_PAGE = 10; export const ALERT_LOCALSTORAGE_KEY = 'gitlab_alert'; +export const BASE_URL_LOCALSTORAGE_KEY = 'gitlab_base_url'; export const MINIMUM_SEARCH_TERM_LENGTH = 3; export const ADD_NAMESPACE_MODAL_ID = 'add-namespace-modal'; export const I18N_DEFAULT_SIGN_IN_BUTTON_TEXT = s__('Integrations|Sign in to GitLab'); +export const I18N_CUSTOM_SIGN_IN_BUTTON_TEXT = s__('Integrations|Sign in to %{url}'); export const I18N_DEFAULT_SIGN_IN_ERROR_MESSAGE = s__('Integrations|Failed to sign in to GitLab.'); export const I18N_DEFAULT_SUBSCRIPTIONS_ERROR_MESSAGE = s__( 'Integrations|Failed to load subscriptions.', @@ -26,6 +28,8 @@ export const I18N_ADD_SUBSCRIPTIONS_ERROR_MESSAGE = s__( 'Integrations|Failed to link namespace. Please try again.', ); +export const GITLAB_COM_BASE_PATH = 'https://gitlab.com'; + const OAUTH_WINDOW_SIZE = 800; export const OAUTH_WINDOW_OPTIONS = [ 'resizable=yes', diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/index.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/index.vue index 4f5aa4c255c..64cd7793925 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/index.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion/index.vue @@ -1,6 +1,7 @@