diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-06 15:09:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-06 15:09:33 +0300 |
commit | a661ba47633234590e88004462212e63cc1f658d (patch) | |
tree | 1830f68d21041584dbb88f82a0489d0165d68e96 | |
parent | aaa09b5617829fac7e7499aaf53d7d705dbb7baf (diff) |
Add latest changes from gitlab-org/gitlab@master
8 files changed, 41 insertions, 5 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index df2e09026db..24ec740c910 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -15,6 +15,7 @@ import { isEmpty, isNil } from 'lodash'; import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge'; import readyToMergeQuery from 'ee_else_ce/vue_merge_request_widget/queries/states/ready_to_merge.query.graphql'; import { createAlert } from '~/alert'; +import { fetchPolicies } from '~/lib/graphql'; import { TYPENAME_MERGE_REQUEST } from '~/graphql_shared/constants'; import { STATUS_CLOSED, STATUS_MERGED } from '~/issues/constants'; import { secondsToMilliseconds } from '~/lib/utils/datetime_utility'; @@ -25,6 +26,7 @@ import { helpPagePath } from '~/helpers/help_page_helper'; import { convertToGraphQLId } from '~/graphql_shared/utils'; import readyToMergeSubscription from '~/vue_merge_request_widget/queries/states/ready_to_merge.subscription.graphql'; import HelpPopover from '~/vue_shared/components/help_popover.vue'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { AUTO_MERGE_STRATEGIES, MT_MERGE_STRATEGY, @@ -148,7 +150,7 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, - mixins: [readyToMergeMixin, mergeRequestQueryVariablesMixin], + mixins: [readyToMergeMixin, mergeRequestQueryVariablesMixin, glFeatureFlagsMixin()], props: { mr: { type: Object, required: true }, service: { type: Object, required: true }, @@ -329,6 +331,12 @@ export default { eventHub.$on('ApprovalUpdated', this.updateGraphqlState); eventHub.$on('MRWidgetUpdateRequested', this.updateGraphqlState); eventHub.$on('mr.discussion.updated', this.updateGraphqlState); + + if (this.glFeatures.widgetPipelinePassSubscriptionUpdate) { + this.$apollo.queries.state.setOptions({ + fetchPolicy: fetchPolicies.NO_CACHE, + }); + } }, beforeDestroy() { eventHub.$off('ApprovalUpdated', this.updateGraphqlState); diff --git a/app/assets/javascripts/vue_merge_request_widget/constants.js b/app/assets/javascripts/vue_merge_request_widget/constants.js index 1a469f9b7bb..2c4cd97092f 100644 --- a/app/assets/javascripts/vue_merge_request_widget/constants.js +++ b/app/assets/javascripts/vue_merge_request_widget/constants.js @@ -6,7 +6,7 @@ import { stateToComponentMap as classStateMap, stateKey } from './stores/state_m export const FOUR_MINUTES_IN_MS = 1000 * 60 * 4; export const STATE_QUERY_POLLING_INTERVAL_DEFAULT = 5000; -export const STATE_QUERY_POLLING_INTERVAL_BACKOFF = 2; +export const STATE_QUERY_POLLING_INTERVAL_BACKOFF = 1.2; export const SUCCESS = 'success'; export const WARNING = 'warning'; diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index d02db2789f7..1fe312269e5 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -45,6 +45,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo push_frontend_feature_flag(:ci_job_failures_in_mr, project) push_frontend_feature_flag(:mr_pipelines_graphql, project) push_frontend_feature_flag(:notifications_todos_buttons, current_user) + push_frontend_feature_flag(:widget_pipeline_pass_subscription_update, project) end before_action only: [:edit] do diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index c4af5aad94e..cf3efc5998f 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -413,7 +413,7 @@ module Ci pipeline.run_after_commit do next if pipeline.child? - next unless project.only_allow_merge_if_pipeline_succeeds?(inherit_group_setting: true) + next unless Feature.enabled?(:widget_pipeline_pass_subscription_update, project) || project.only_allow_merge_if_pipeline_succeeds?(inherit_group_setting: true) pipeline.all_merge_requests.opened.each do |merge_request| GraphqlTriggers.merge_request_merge_status_updated(merge_request) diff --git a/config/feature_flags/development/widget_pipeline_pass_subscription_update.yml b/config/feature_flags/development/widget_pipeline_pass_subscription_update.yml new file mode 100644 index 00000000000..764b0a59291 --- /dev/null +++ b/config/feature_flags/development/widget_pipeline_pass_subscription_update.yml @@ -0,0 +1,8 @@ +--- +name: widget_pipeline_pass_subscription_update +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132353 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/428633 +milestone: '16.6' +type: development +group: group::code review +default_enabled: false diff --git a/doc/administration/auth/ldap/index.md b/doc/administration/auth/ldap/index.md index bf2b3d7e53e..0c42ce90346 100644 --- a/doc/administration/auth/ldap/index.md +++ b/doc/administration/auth/ldap/index.md @@ -448,7 +448,7 @@ These LDAP sync configuration settings are available: | Setting | Description | Required | Examples | |-------------------|-------------|----------|----------| -| `group_base` | Base used to search for groups. | **{dotted-circle}** No (required when `external_groups` is configured) | `'ou=groups,dc=gitlab,dc=example'` | +| `group_base` | Base used to search for groups. All valid groups have this base as part of their DN. | **{dotted-circle}** No (required when `external_groups` is configured) | `'ou=groups,dc=gitlab,dc=example'` | | `admin_group` | The CN of a group containing GitLab administrators. Not `cn=administrators` or the full DN. | **{dotted-circle}** No | `'administrators'` | | `external_groups` | An array of CNs of groups containing users that should be considered external. Not `cn=interns` or the full DN. | **{dotted-circle}** No | `['interns', 'contractors']` | | `sync_ssh_keys` | The LDAP attribute containing a user's public SSH key. | **{dotted-circle}** No | `'sshPublicKey'` or false if not set | diff --git a/doc/user/group/access_and_permissions.md b/doc/user/group/access_and_permissions.md index 4396450eb85..53a62a60157 100644 --- a/doc/user/group/access_and_permissions.md +++ b/doc/user/group/access_and_permissions.md @@ -260,6 +260,13 @@ Group syncing allows LDAP groups to be mapped to GitLab groups. This provides mo Group links can be created by using either a CN or a filter. To create these group links, go to the group's **Settings > LDAP Synchronization** page. After configuring the link, it may take more than an hour for the users to sync with the GitLab group. +If a user is a member of two configured LDAP groups for the same GitLab group, they are granted the higher of the roles associated with the two LDAP groups. +For example: + +- User is a member of LDAP groups `Owner` and `Dev`. +- The GitLab Group is configured with these two LDAP groups. +- When group sync is completed, the user is granted the Owner role as this is the higher of the two LDAP group roles. + For more information on the administration of LDAP and group sync, refer to the [main LDAP documentation](../../administration/auth/ldap/ldap_synchronization.md#group-sync). NOTE: diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index c3d3ccfea44..7b3a0124675 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -2028,11 +2028,23 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep, feature_category: end end - context 'when only_allow_merge_if_pipeline_succeeds? returns false' do + context 'when only_allow_merge_if_pipeline_succeeds? returns false and widget_pipeline_pass_subscription_update disabled' do let(:only_allow_merge_if_pipeline_succeeds?) { false } + before do + stub_feature_flags(widget_pipeline_pass_subscription_update: false) + end + it_behaves_like 'state transition not triggering GraphQL subscription mergeRequestMergeStatusUpdated' end + + context 'when only_allow_merge_if_pipeline_succeeds? returns false and widget_pipeline_pass_subscription_update enabled' do + let(:only_allow_merge_if_pipeline_succeeds?) { false } + + it_behaves_like 'triggers GraphQL subscription mergeRequestMergeStatusUpdated' do + let(:action) { pipeline.succeed } + end + end end context 'when pipeline has merge requests' do |