From 24d67ec55454fc6f4e8e80bf7c8dc5bc677e8514 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 1 Jul 2022 18:08:33 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- Gemfile | 2 +- Gemfile.lock | 12 +- .../included_in_trial_indicator.vue | 15 + .../learn_gitlab/components/learn_gitlab.vue | 8 +- .../components/learn_gitlab_info_card.vue | 70 ----- .../components/learn_gitlab_section_link.vue | 73 +++-- .../projects/learn_gitlab/constants/index.js | 58 +++- .../components/test_reports/test_reports.vue | 17 +- .../test_reports/test_suite_table.vue | 10 +- .../test_reports/test_summary_table.vue | 2 +- .../pipelines/pipeline_test_details.js | 13 +- .../pipelines/stores/test_reports/index.js | 12 +- .../security_configuration/components/app.vue | 1 + .../components/constants.js | 2 + .../oauth/applications_controller.rb | 4 +- ...ctions_continuous_onboarding_experiment.rb | 9 + app/helpers/integrations_helper.rb | 2 +- app/helpers/learn_gitlab_helper.rb | 20 +- app/models/ci/build.rb | 4 - app/models/ci/pipeline.rb | 2 - app/models/integration.rb | 4 +- .../integrations/base_chat_notification.rb | 4 +- app/models/integrations/jira.rb | 3 +- app/models/oauth_access_token.rb | 2 + app/models/user.rb | 2 +- .../create_pipeline_service.rb | 14 +- .../ci/job_artifacts/create_service.rb | 6 - ...security_actions_continuous_onboarding.yml | 8 + ...uth_access_tokens_revoked_at_with_order.rb | 20 ++ db/schema_migrations/20220630202329 | 1 + db/structure.sql | 4 +- doc/development/integrations/index.md | 1 + .../licensed_feature_availability.md | 10 + doc/integration/oauth_provider.md | 9 +- .../monitoring/background_migrations.md | 3 + doc/user/analytics/value_stream_analytics.md | 2 +- .../group/value_stream_analytics/index.md | 2 +- lib/learn_gitlab/onboarding.rb | 22 +- .../projects/menus/learn_gitlab_menu.rb | 5 +- locale/gitlab.pot | 34 +-- .../gitlab_migration_large_project_spec.rb | 11 +- .../import/bitbucket_controller_spec.rb | 2 +- .../profiles/oauth_applications_spec.rb | 2 + .../__snapshots__/learn_gitlab_spec.js.snap | 258 +++++++++--------- .../components/learn_gitlab_info_card_spec.js | 57 ---- .../learn_gitlab_section_link_spec.js | 6 +- .../learn_gitlab_trial_card_spec.js | 12 + .../test_reports/test_reports_spec.js | 26 +- .../test_reports/test_suite_table_spec.js | 30 +- .../test_reports/test_summary_table_spec.js | 16 +- spec/helpers/learn_gitlab_helper_spec.rb | 85 +++--- .../lib/gitlab/gitlab_import/importer_spec.rb | 4 +- spec/lib/learn_gitlab/onboarding_spec.rb | 35 ++- spec/models/integration_spec.rb | 14 +- spec/models/integrations/jira_spec.rb | 2 +- spec/models/oauth_access_token_spec.rb | 48 +++- spec/requests/api/integrations_spec.rb | 25 ++ .../integrations/field_entity_spec.rb | 2 +- .../integrations/integration_settings_form.rb | 5 + workhorse/go.mod | 6 +- workhorse/go.sum | 43 ++- 61 files changed, 680 insertions(+), 501 deletions(-) create mode 100644 app/assets/javascripts/pages/projects/learn_gitlab/components/included_in_trial_indicator.vue delete mode 100644 app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_info_card.vue create mode 100644 app/experiments/security_actions_continuous_onboarding_experiment.rb create mode 100644 config/feature_flags/experiment/security_actions_continuous_onboarding.yml create mode 100644 db/migrate/20220630202329_add_partial_index_on_oauth_access_tokens_revoked_at_with_order.rb create mode 100644 db/schema_migrations/20220630202329 delete mode 100644 spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_info_card_spec.js create mode 100644 spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_trial_card_spec.js diff --git a/Gemfile b/Gemfile index a0f83cc93dd..e4e871039cc 100644 --- a/Gemfile +++ b/Gemfile @@ -466,7 +466,7 @@ gem 'benchmark-memory', '~> 0.1', require: false gem 'activerecord-explain-analyze', '~> 0.1', require: false # OAuth -gem 'oauth2', '~> 1.4' +gem 'oauth2', '~> 2.0' # Health check gem 'health_check', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 02068c3a243..53cb0789513 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -826,12 +826,13 @@ GEM shellany (~> 0.0) numerizer (0.2.0) oauth (0.5.6) - oauth2 (1.4.7) - faraday (>= 0.8, < 2.0) + oauth2 (2.0.3) + faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) - multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) + rash_alt (>= 0.4, < 1) + version_gem (~> 1.0) octokit (4.20.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) @@ -1050,6 +1051,8 @@ GEM rainbow (3.1.1) rake (13.0.6) randexp (0.1.7) + rash_alt (0.4.12) + hashie (>= 3.4) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) @@ -1408,6 +1411,7 @@ GEM validates_hostname (1.0.11) activerecord (>= 3.0) activesupport (>= 3.0) + version_gem (1.0.0) version_sorter (2.2.4) view_component (2.50.0) activesupport (>= 5.0.0, < 8.0) @@ -1612,7 +1616,7 @@ DEPENDENCIES net-ldap (~> 0.16.3) net-ntp nokogiri (~> 1.13.6) - oauth2 (~> 1.4) + oauth2 (~> 2.0) octokit (~> 4.15) ohai (~> 16.10) oj (~> 3.10.6) diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/included_in_trial_indicator.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/included_in_trial_indicator.vue new file mode 100644 index 00000000000..693dc6a15ad --- /dev/null +++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/included_in_trial_indicator.vue @@ -0,0 +1,15 @@ + + diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue index db9ef4df8af..54e15b6552c 100644 --- a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue +++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue @@ -38,14 +38,16 @@ export default { actionsData: this.actions, }; }, - maxValue: Object.keys(ACTION_LABELS).length, actionSections: Object.keys(ACTION_SECTIONS), computed: { + maxValue() { + return Object.keys(this.actionsData).length; + }, progressValue() { return Object.values(this.actionsData).filter((a) => a.completed).length; }, progressPercentage() { - return Math.round((this.progressValue / this.$options.maxValue) * 100); + return Math.round((this.progressValue / this.maxValue) * 100); }, }, mounted() { @@ -125,7 +127,7 @@ export default {

- +
-import { GlLink, GlCard, GlIcon } from '@gitlab/ui'; -import { s__ } from '~/locale'; - -export default { - name: 'LearnGitlabInfoCard', - components: { GlLink, GlCard, GlIcon }, - i18n: { - trial: s__('Learn GitLab|Trial only'), - }, - props: { - title: { - required: true, - type: String, - }, - description: { - required: true, - type: String, - }, - actionLabel: { - required: true, - type: String, - }, - url: { - required: true, - type: String, - }, - completed: { - required: true, - type: Boolean, - }, - svg: { - required: true, - type: String, - }, - trialRequired: { - default: false, - required: false, - type: Boolean, - }, - }, -}; - - diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue index 1912477758b..4eab0cccb06 100644 --- a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue +++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue @@ -6,6 +6,7 @@ import { isExperimentVariant } from '~/experimentation/utils'; import eventHub from '~/invite_members/event_hub'; import { s__, __ } from '~/locale'; import { ACTION_LABELS } from '../constants'; +import IncludedInTrialIndicator from './included_in_trial_indicator.vue'; export default { name: 'LearnGitlabSectionLink', @@ -15,12 +16,12 @@ export default { GlButton, GlPopover, GitlabExperiment, + IncludedInTrialIndicator, }, directives: { GlTooltip, }, i18n: { - trialOnly: s__('LearnGitlab|Trial only'), contactAdmin: s__('LearnGitlab|Contact your administrator to start a free Ultimate trial.'), viewAdminList: s__('LearnGitlab|View administrator list'), watchHow: __('Watch how'), @@ -41,12 +42,6 @@ export default { }; }, computed: { - linkTitle() { - return ACTION_LABELS[this.action].title; - }, - trialOnly() { - return ACTION_LABELS[this.action].trialRequired; - }, showInviteModalLink() { return ( this.action === 'userAdded' && isExperimentVariant('invite_for_help_continuous_onboarding') @@ -55,49 +50,51 @@ export default { openInNewTab() { return ACTION_LABELS[this.action]?.openInNewTab === true || this.value.openInNewTab === true; }, - linkToVideoTutorial() { - return ACTION_LABELS[this.action].videoTutorial; - }, }, methods: { openModal() { eventHub.$emit('openModal', { source: 'learn_gitlab' }); }, + actionLabelValue(value) { + return ACTION_LABELS[this.action][value]; + }, }, };