diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 12:11:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 12:11:27 +0300 |
commit | 31522c5182bf14886900131c12d17d004ce28534 (patch) | |
tree | 9878537b8db031e4525b1993c1d54f267b3d8fe0 /lib | |
parent | ad3b511ba360c7fc09fe519396c6d15f09845d66 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
5 files changed, 106 insertions, 19 deletions
diff --git a/lib/gitlab/import_export/group/import_export.yml b/lib/gitlab/import_export/group/import_export.yml index 8df5d52bf77..7e81112796f 100644 --- a/lib/gitlab/import_export/group/import_export.yml +++ b/lib/gitlab/import_export/group/import_export.yml @@ -27,6 +27,29 @@ included_attributes: - :name namespace_settings: - :prevent_sharing_groups_outside_hierarchy + iterations_cadence: &iterations_cadence_definition + - :group_id + - :created_at + - :updated_at + - :start_date + - :last_run_date + - :duration_in_weeks + - :iterations_in_advance + - :active + - :automatic + - :roll_over + - :title + - :description + iterations_cadences: *iterations_cadence_definition + iteration: &iteration_definition + - :iid + - :created_at + - :updated_at + - :start_date + - :due_date + - :group_id + - :description + iterations: *iteration_definition excluded_attributes: group: @@ -44,6 +67,19 @@ excluded_attributes: - :max_pages_size epics: - :state_id + iterations_cadence: &iterations_cadence_definition + - :id + iterations_cadences: *iterations_cadence_definition + iteration: &iteration_excluded_definition + - :id + - :title + - :title_html + - :project_id + - :description_html + - :cached_markdown_version + - :iterations_cadence_id + - :sequence + iterations: *iteration_excluded_definition methods: labels: @@ -92,3 +128,5 @@ ee: - milestone: - events: - :push_event_payload + - iterations_cadences: + - :iterations diff --git a/lib/gitlab/import_export/group/legacy_import_export.yml b/lib/gitlab/import_export/group/legacy_import_export.yml index 082d2346f3d..985e3af1e0c 100644 --- a/lib/gitlab/import_export/group/legacy_import_export.yml +++ b/lib/gitlab/import_export/group/legacy_import_export.yml @@ -24,6 +24,29 @@ included_attributes: - :username author: - :name + iterations_cadence: &iterations_cadence_definition + - :group_id + - :created_at + - :updated_at + - :start_date + - :last_run_date + - :duration_in_weeks + - :iterations_in_advance + - :active + - :automatic + - :roll_over + - :title + - :description + iterations_cadences: *iterations_cadence_definition + iteration: &iteration_definition + - :iid + - :created_at + - :updated_at + - :start_date + - :due_date + - :group_id + - :description + iterations: *iteration_definition excluded_attributes: group: @@ -41,6 +64,18 @@ excluded_attributes: - :extra_shared_runners_minutes_limit epics: - :state_id + iterations_cadence: &iterations_cadence_definition + - :id + iterations_cadences: *iterations_cadence_definition + iteration: &iteration_excluded_definition + - :id + - :title + - :title_html + - :project_id + - :description_html + - :cached_markdown_version + - :iterations_cadence_id + iterations: *iteration_excluded_definition methods: labels: @@ -88,3 +123,5 @@ ee: - milestone: - events: - :push_event_payload + - iterations_cadences: + - :iterations diff --git a/lib/gitlab/import_export/group/relation_factory.rb b/lib/gitlab/import_export/group/relation_factory.rb index 258078d595b..e4195e014b3 100644 --- a/lib/gitlab/import_export/group/relation_factory.rb +++ b/lib/gitlab/import_export/group/relation_factory.rb @@ -8,7 +8,8 @@ module Gitlab labels: :group_labels, priorities: :label_priorities, label: :group_label, - parent: :epic + parent: :epic, + iterations_cadences: 'Iterations::Cadence' }.freeze EXISTING_OBJECT_RELATIONS = %i[ diff --git a/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb b/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb index 316d9bb3dc1..872e100f6e3 100644 --- a/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb +++ b/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb @@ -68,15 +68,18 @@ module Gitlab track_unique_action(ISSUE_REOPENED, author) end - def track_issue_label_changed_action(author:) + def track_issue_label_changed_action(author:, project:) + track_snowplow_action(ISSUE_LABEL_CHANGED, author, project) track_unique_action(ISSUE_LABEL_CHANGED, author) end - def track_issue_milestone_changed_action(author:) + def track_issue_milestone_changed_action(author:, project:) + track_snowplow_action(ISSUE_MILESTONE_CHANGED, author, project) track_unique_action(ISSUE_MILESTONE_CHANGED, author) end - def track_issue_cross_referenced_action(author:) + def track_issue_cross_referenced_action(author:, project:) + track_snowplow_action(ISSUE_CROSS_REFERENCED, author, project) track_unique_action(ISSUE_CROSS_REFERENCED, author) end @@ -116,15 +119,18 @@ module Gitlab track_unique_action(ISSUE_DESIGNS_REMOVED, author) end - def track_issue_due_date_changed_action(author:) + def track_issue_due_date_changed_action(author:, project:) + track_snowplow_action(ISSUE_DUE_DATE_CHANGED, author, project) track_unique_action(ISSUE_DUE_DATE_CHANGED, author) end - def track_issue_time_estimate_changed_action(author:) + def track_issue_time_estimate_changed_action(author:, project:) + track_snowplow_action(ISSUE_TIME_ESTIMATE_CHANGED, author, project) track_unique_action(ISSUE_TIME_ESTIMATE_CHANGED, author) end - def track_issue_time_spent_changed_action(author:) + def track_issue_time_spent_changed_action(author:, project:) + track_snowplow_action(ISSUE_TIME_SPENT_CHANGED, author, project) track_unique_action(ISSUE_TIME_SPENT_CHANGED, author) end diff --git a/lib/sidebars/groups/menus/settings_menu.rb b/lib/sidebars/groups/menus/settings_menu.rb index 18ff3ebc714..9d27f09146f 100644 --- a/lib/sidebars/groups/menus/settings_menu.rb +++ b/lib/sidebars/groups/menus/settings_menu.rb @@ -6,18 +6,23 @@ module Sidebars class SettingsMenu < ::Sidebars::Menu override :configure_menu_items def configure_menu_items - return false unless can?(context.current_user, :admin_group, context.group) - - add_item(general_menu_item) - add_item(integrations_menu_item) - add_item(access_tokens_menu_item) - add_item(group_projects_menu_item) - add_item(repository_menu_item) - add_item(ci_cd_menu_item) - add_item(applications_menu_item) - add_item(packages_and_registries_menu_item) - - true + if can?(context.current_user, :admin_group, context.group) + add_item(general_menu_item) + add_item(integrations_menu_item) + add_item(access_tokens_menu_item) + add_item(group_projects_menu_item) + add_item(repository_menu_item) + add_item(ci_cd_menu_item) + add_item(applications_menu_item) + add_item(packages_and_registries_menu_item) + return true + elsif Gitlab.ee? && can?(context.current_user, :change_push_rules, context.group) + # Push Rules are the only group setting that can also be edited by maintainers. + # Create an empty sub-menu here and EE adds Repository menu item (with only Push Rules). + return true + end + + false end override :title |