Skip to content
Snippets Groups Projects
Commit 2a3be6ad authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 3f588195
No related branches found
No related tags found
No related merge requests found
Showing
with 132 additions and 40 deletions
include:
- component: $CI_SERVER_FQDN/security-products/experiments/libbehave/libbehave@v0.1.0
inputs:
stage: lint
token: $BEHAVE_TOKEN
libbehave-experiment:
extends:
- .appsec-libbehave:rules
needs: []
......@@ -797,21 +797,9 @@
- "qa/gems/gitlab-orchestrator/{Gemfile,Gemfile.lock}"
.observability-code-patterns: &observability-code-patterns
# backend
- "ee/app/helpers/observability/**/*"
- "ee/app/helpers/projects/observability_helper.rb"
- "lib/gitlab/observability.rb"
- "ee/lib/ee/gitlab/observability.rb"
- "ee/lib/api/internal/observability.rb"
- "ee/app/controllers/projects/tracing_controller.rb"
- "ee/app/controllers/projects/metrics_controller.rb"
- "ee/app/controllers/projects/logs_controller.rb"
- "ee/app/services/observability/**/*"
# frontend
- "app/assets/javascripts/observability/**/*"
- "ee/app/assets/javascripts/logs/**/*"
- "ee/app/assets/javascripts/metrics/**/*"
- "ee/app/assets/javascripts/tracing/**/*"
##################
# Conditions set #
......@@ -2773,15 +2761,6 @@
- <<: *if-merge-request
changes: *dependency-patterns
.appsec-libbehave:rules:
rules:
# Requiring $DEPENDENCY_REVIEW_PAT prevents the bot from running on forks or CE
# Without it the script would fail too.
# Run only when the merge request have dependency file modifications
- <<: *if-merge-request
changes: *dependency-patterns
##################
# Releases rules #
##################
......
......@@ -12,7 +12,6 @@
BROWSERSLIST_IGNORE_OLD_DATA: "true"
GRAPHQL_SCHEMA_APOLLO_FILE: "tmp/tests/graphql/gitlab_schema_apollo.graphql"
update-static-analysis-cache:
extends:
- .static-analysis-base
......
......@@ -16,7 +16,7 @@ export default {
configuredText: s__(
'ClusterAgents|You can connect to your cluster from the command line. Configure %{linkStart}kubectl%{linkEnd} command-line access by running the following command:',
),
learMoreText: s__('ClusterAgents|Learn more about user access.'),
learnMoreText: s__('ClusterAgents|Learn more about user access'),
buttonClose: __('Close'),
},
learnMoreDocsLink: helpPagePath('user/clusters/agent/user_access'),
......@@ -134,7 +134,8 @@ export default {
</p>
<p>
<gl-link :href="$options.learnMoreDocsLink"> {{ $options.i18n.learMoreText }} </gl-link>
<gl-link :href="$options.learnMoreDocsLink">{{ $options.i18n.learnMoreText }}</gl-link
>.
</p>
<template #modal-footer>
......
......@@ -247,7 +247,8 @@ export default {
<p class="gl-mb-0">
{{ $options.i18n.modalBody }}
<gl-link :href="$options.registerAgentPath"> {{ $options.i18n.learMore }}</gl-link>
<gl-link :href="$options.registerAgentPath">{{ $options.i18n.learnMore }}</gl-link
>.
</p>
<gl-form @submit.prevent="submit">
......
......@@ -113,7 +113,7 @@ export const I18N_AGENT_MODAL = {
registerAgentButton: s__('ClusterAgents|Create and register'),
close: __('Close'),
cancel: __('Cancel'),
learMore: __('Learn more.'),
learnMore: __('Learn more'),
modalTitle: s__('ClusterAgents|Connect a Kubernetes cluster'),
modalBody: s__('ClusterAgents|Create a new agent to register with GitLab.'),
......
......@@ -5,8 +5,9 @@ import {
GlDisclosureDropdownGroup,
GlDisclosureDropdownItem,
} from '@gitlab/ui';
import { visitUrl } from '~/lib/utils/url_utility';
import InviteMembersTrigger from '~/invite_members/components/invite_members_trigger.vue';
import { __ } from '~/locale';
import { __, s__ } from '~/locale';
import {
TOP_NAV_INVITE_MEMBERS_COMPONENT,
TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN,
......@@ -15,6 +16,8 @@ import {
WORK_ITEM_TYPE_NAME_EPIC,
CREATE_NEW_WORK_ITEM_MODAL,
CREATE_NEW_GROUP_WORK_ITEM_MODAL,
NAME_TO_TEXT_LOWERCASE_MAP,
sprintfWorkItem,
} from '~/work_items/constants';
import { DROPDOWN_Y_OFFSET, IMPERSONATING_OFFSET } from '../constants';
......@@ -75,6 +78,28 @@ export default {
this.showCreateGroupWorkItemModal = true;
}
},
handleWorkItemCreated(workItem) {
// Triggering the toast at this component, because we want to lazy load the modal
// with `v-if` and by doing that the modal is destroyed before the toast
// from the modal component can be triggered
// Hide the modal first to prevent the component from being destroyed
// before we can capture the event data
this.showCreateGroupWorkItemModal = false;
this.showCreateWorkItemModal = false;
const workItemType = NAME_TO_TEXT_LOWERCASE_MAP[workItem?.workItemType?.name];
const message = sprintfWorkItem(s__('WorkItem|%{workItemType} created'), workItemType);
// Display the toast
this.$toast.show(message, {
autoHideDelay: 10000,
action: {
text: __('View details'),
onClick: () => visitUrl(workItem?.webUrl),
},
});
},
},
toggleId: 'create-menu-toggle',
TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN,
......@@ -134,6 +159,7 @@ export default {
data-testid="new-group-work-item-modal"
:preselected-work-item-type="$options.WORK_ITEM_TYPE_NAME_EPIC"
@hideModal="showCreateGroupWorkItemModal = false"
@workItemCreated="handleWorkItemCreated"
/>
<create-work-item-modal
v-if="showCreateWorkItemModal"
......@@ -142,6 +168,7 @@ export default {
data-testid="new-work-item-modal"
:full-path="fullPath"
@hideModal="showCreateWorkItemModal = false"
@workItemCreated="handleWorkItemCreated"
/>
</gl-disclosure-dropdown>
</template>
......@@ -69,6 +69,13 @@ export default {
: undefined;
},
},
watch: {
value(newVal) {
if (newVal) {
this.tzValue = this.initialTimezone(this.timezoneData, newVal);
}
},
},
methods: {
selectTimezone(formattedTimezone) {
const selectedTimezone = this.timezones.find(
......
......@@ -5,7 +5,9 @@ module PermissionTypes
class Group < BasePermissionType
graphql_name 'GroupPermissions'
abilities :read_group, :create_projects, :create_custom_emoji, :remove_group, :view_edit_page
abilities :read_group, :create_projects, :create_custom_emoji, :remove_group, :view_edit_page,
:admin_issue, :read_crm_contact, :read_crm_organization
permission_field :can_leave,
description: 'If `true`, the user can leave this group.'
......
......@@ -6,6 +6,8 @@ module Namespaces
class Base < BasePermissionType
graphql_name 'NamespacePermissions'
abilities :admin_label
ability_field :read_namespace
end
end
......
......@@ -18,7 +18,8 @@ class Project < BasePermissionType
:admin_remote_mirror, :create_label, :update_wiki, :destroy_wiki,
:create_pages, :destroy_pages, :read_pages_content, :admin_operations,
:read_merge_request, :read_design, :create_design, :update_design, :destroy_design,
:move_design, :read_environment, :view_edit_page
:move_design, :read_environment, :view_edit_page, :admin_issue, :create_work_item,
:import_issues, :read_crm_contact, :read_crm_organization
permission_field :create_snippet
......
......@@ -8,6 +8,8 @@ module Transactions
# transaction. Handles special cases when running inside a test environment,
# where tests may be wrapped in transactions
def inside_transaction?
return false unless connected?
base = Rails.env.test? ? open_transactions_baseline.to_i : 0
connection.open_transactions > base
......
......@@ -70,7 +70,6 @@ class Issue < ApplicationRecord
ignore_column :project_id_convert_to_bigint, remove_with: '17.8', remove_after: '2024-12-13'
ignore_column :promoted_to_epic_id_convert_to_bigint, remove_with: '17.8', remove_after: '2024-12-13'
ignore_column :updated_by_id_convert_to_bigint, remove_with: '17.8', remove_after: '2024-12-13'
ignore_column :correct_work_item_type_id, remove_with: '18.0', remove_after: '2025-04-17'
belongs_to :project
belongs_to :namespace, inverse_of: :issues
......
......@@ -15,6 +15,7 @@ module OrchestrationConfigurationBotManagementForNamespaces
def perform(namespace_id, current_user_id)
namespace = Namespace.find_by_id(namespace_id)
return unless namespace
return unless namespace.security_orchestration_policy_configuration
return unless User.id_exists?(current_user_id)
......
# frozen_string_literal: true
class CreateAsyncIssuesNamespaceIdCreatedAtIdStateIdIndex < Gitlab::Database::Migration[2.3]
milestone '18.1'
INDEX_NAME = 'index_issues_on_namespace_id_created_at_id_state_id'
def up
# To be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/541363
prepare_async_index :issues, [:namespace_id, :created_at, :id, :state_id], name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation -- https://gitlab.com/gitlab-org/database-team/team-tasks/-/issues/510
end
def down
unprepare_async_index :issues, INDEX_NAME
end
end
# frozen_string_literal: true
class CreateAsyncIssuesWorkItemTypeIdNamespaceIdCreatedAtStateIndex < Gitlab::Database::Migration[2.3]
milestone '18.1'
INDEX_NAME = 'index_issues_on_work_item_type_id_namespace_id_created_at_state'
def up
# To be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/541363
prepare_async_index :issues, [:work_item_type_id, :namespace_id, :created_at, :state_id], name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation -- https://gitlab.com/gitlab-org/database-team/team-tasks/-/issues/510
end
def down
unprepare_async_index :issues, INDEX_NAME
end
end
# frozen_string_literal: true
class CreateAsyncIssuesNamespaceIdRelativePositionIdStateIdIndex < Gitlab::Database::Migration[2.3]
milestone '18.1'
INDEX_NAME = 'index_issues_on_namespace_id_relative_position_id_state_id'
def up
# To be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/541363
prepare_async_index :issues, [:namespace_id, :relative_position, :id, :state_id], name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation -- https://gitlab.com/gitlab-org/database-team/team-tasks/-/issues/510
end
def down
unprepare_async_index :issues, INDEX_NAME
end
end
# frozen_string_literal: true
class CreateAsyncOpenIssuesNamespaceIdConfidentialAuthorIdIdIndex < Gitlab::Database::Migration[2.3]
milestone '18.1'
INDEX_NAME = 'index_open_issues_on_namespace_id_confidential_author_id_id'
def up
# To be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/541363
prepare_async_index :issues, [:namespace_id, :confidential, :author_id, :id], where: 'state_id = 1', name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation -- https://gitlab.com/gitlab-org/database-team/team-tasks/-/issues/510
end
def down
unprepare_async_index :issues, INDEX_NAME
end
end
# frozen_string_literal: true
class CreateAsyncClosedIncidentsNamespaceIdClosedAtIndex < Gitlab::Database::Migration[2.3]
milestone '18.1'
INDEX_NAME = 'index_closed_incidents_on_namespace_id_closed_at'
def up
# To be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/541363
prepare_async_index :issues, [:namespace_id, :closed_at], where: 'state_id = 2 AND work_item_type_id = 2', name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation -- https://gitlab.com/gitlab-org/database-team/team-tasks/-/issues/510
end
def down
unprepare_async_index :issues, INDEX_NAME
end
end
3d71ed716a8c1b591f55feeee8cecabced3eb448f898639a3713757741e9f556
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment