From 8f9307985ea047abb5b8a7c6c56bb644e0b7c363 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 3 Feb 2023 18:08:55 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- GITALY_SERVER_VERSION | 2 +- Gemfile | 2 +- Gemfile.checksum | 2 +- Gemfile.lock | 4 +- app/assets/javascripts/api/groups_api.js | 9 ++ app/assets/javascripts/api/projects_api.js | 9 ++ .../popover/components/issue_popover.vue | 4 +- app/assets/javascripts/issues/constants.js | 14 +- .../components/issues_dashboard_app.vue | 6 +- .../list/components/issue_card_time_info.vue | 5 +- .../list/components/issues_list_app.vue | 6 +- .../issues/show/components/app.vue | 9 +- .../issues/show/components/header_actions.vue | 4 +- .../show/components/incidents/constants.js | 4 + .../pipelines/components/parsing_utils.js | 4 +- .../commit_box_pipeline_mini_graph.vue | 4 +- .../search/sidebar/components/app.vue | 14 +- .../sidebar/components/checkbox_filter.vue | 81 ++++++++++ .../sidebar/components/language_filter.vue | 125 ++++++++++++++ .../javascripts/search/sidebar/utils.js | 20 +++ .../stylesheets/framework/variables.scss | 5 +- .../stylesheets/page_bundles/profile.scss | 4 + .../stylesheets/page_bundles/search.scss | 11 ++ app/controllers/admin/users_controller.rb | 1 + app/controllers/profiles_controller.rb | 1 + app/controllers/search_controller.rb | 3 + app/helpers/application_helper.rb | 6 + app/models/user.rb | 1 + app/models/user_detail.rb | 19 ++- app/models/wiki_directory.rb | 2 +- app/models/wiki_page.rb | 2 +- app/policies/project_policy.rb | 2 + .../settings/deploy_keys_presenter.rb | 4 - app/services/ci/register_job_service.rb | 2 +- app/views/profiles/show.html.haml | 9 ++ .../settings/repository/show.html.haml | 2 +- app/views/shared/wikis/_sidebar.html.haml | 3 +- .../shared/wikis/_wiki_directory.html.haml | 3 +- app/views/shared/wikis/pages.html.haml | 3 +- app/views/users/show.html.haml | 4 + .../ci_register_job_temporary_lock.yml | 4 +- ...21128155738_add_discord_to_user_details.rb | 12 ++ ...add_discord_field_limit_to_user_details.rb | 15 ++ ...045406_sanitize_confidential_note_todos.rb | 24 +-- db/schema_migrations/20221128155738 | 1 + db/schema_migrations/20221128165833 | 1 + db/structure.sql | 2 + doc/api/features.md | 2 +- doc/api/freeze_periods.md | 5 +- doc/api/packages/debian.md | 4 + .../packages/debian_group_distributions.md | 16 +- .../packages/debian_project_distributions.md | 4 + doc/api/projects.md | 2 +- .../blueprints/runner_tokens/index.md | 26 ++- doc/development/feature_flags/controls.md | 17 +- doc/development/feature_flags/index.md | 12 ++ doc/operations/error_tracking.md | 8 +- doc/update/index.md | 4 + .../settings/account_and_limit_settings.md | 3 + doc/user/clusters/agent/work_with_agent.md | 1 + doc/user/okrs.md | 4 +- doc/user/packages/debian_repository/index.md | 67 ++++++-- doc/user/profile/index.md | 3 +- doc/user/project/quick_actions.md | 2 +- doc/user/usage_quotas.md | 6 + haml_lint/linter/documentation_links.rb | 7 +- .../sanitize_confidential_todos.rb | 37 +---- lib/gitlab/git/repository.rb | 5 +- lib/gitlab/gitaly_client/ref_service.rb | 7 +- locale/gitlab.pot | 51 +++++- spec/controllers/profiles_controller_spec.rb | 10 ++ spec/finders/ci/freeze_periods_finder_spec.rb | 2 +- spec/frontend/api/groups_api_spec.js | 28 +++- spec/frontend/api/projects_api_spec.js | 26 +++ .../commit_box_pipeline_mini_graph_spec.js | 10 ++ spec/frontend/commit/mock_data.js | 42 +++++ .../components/issue_card_time_info_spec.js | 6 +- .../issues/show/components/app_spec.js | 24 +-- .../show/components/header_actions_spec.js | 10 +- .../incidents/timeline_events_form_spec.js | 2 +- spec/frontend/search/mock_data.js | 31 ++++ .../search/sidebar/components/app_spec.js | 69 ++++---- .../components/checkbox_filter_spec.js | 85 ++++++++++ .../components/language_filters_spec.js | 152 ++++++++++++++++++ spec/frontend/search/sidebar/utils_spec.js | 10 ++ .../linter/documentation_links_spec.rb | 13 +- spec/helpers/application_helper_spec.rb | 17 ++ .../sanitize_confidential_todos_spec.rb | 102 ------------ spec/lib/gitlab/git/repository_spec.rb | 47 ++++++ .../gitlab/gitaly_client/ref_service_spec.rb | 27 +++- .../sanitize_confidential_note_todos_spec.rb | 33 ---- spec/models/user_detail_spec.rb | 31 +++- spec/models/user_spec.rb | 3 + spec/models/wiki_directory_spec.rb | 2 +- spec/models/wiki_page_spec.rb | 2 +- ...ement_with_disable_ddl_transaction_spec.rb | 2 +- .../shared/wikis/_sidebar.html.haml_spec.rb | 6 +- 97 files changed, 1190 insertions(+), 369 deletions(-) create mode 100644 app/assets/javascripts/search/sidebar/components/checkbox_filter.vue create mode 100644 app/assets/javascripts/search/sidebar/components/language_filter.vue create mode 100644 app/assets/javascripts/search/sidebar/utils.js rename config/feature_flags/{development => ops}/ci_register_job_temporary_lock.yml (85%) create mode 100644 db/migrate/20221128155738_add_discord_to_user_details.rb create mode 100644 db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb create mode 100644 db/schema_migrations/20221128155738 create mode 100644 db/schema_migrations/20221128165833 create mode 100644 spec/frontend/search/sidebar/components/checkbox_filter_spec.js create mode 100644 spec/frontend/search/sidebar/components/language_filters_spec.js create mode 100644 spec/frontend/search/sidebar/utils_spec.js delete mode 100644 spec/lib/gitlab/background_migration/sanitize_confidential_todos_spec.rb delete mode 100644 spec/migrations/sanitize_confidential_note_todos_spec.rb diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 3dc57cea50f..65023816ad5 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -ac201ee33b2c7b2974945fb15ba9b1aec4794017 +57e11eb9431c93a6349ffc0222cf447705c0fada diff --git a/Gemfile b/Gemfile index 5ef62e60226..03461fbd72e 100644 --- a/Gemfile +++ b/Gemfile @@ -512,7 +512,7 @@ gem 'ssh_data', '~> 1.3' gem 'spamcheck', '~> 1.0.0' # Gitaly GRPC protocol definitions -gem 'gitaly', '~> 15.8.0-rc1' +gem 'gitaly', '~> 15.9.0-rc1' # KAS GRPC protocol definitions gem 'kas-grpc', '~> 0.0.2' diff --git a/Gemfile.checksum b/Gemfile.checksum index 1c299c12ae1..5f710e42d29 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -197,7 +197,7 @@ {"name":"gettext_i18n_rails","version":"1.8.0","platform":"ruby","checksum":"95e5cf8440b1e08705b27f2bccb56143272c5a7a0dabcf54ea1bd701140a496f"}, {"name":"gettext_i18n_rails_js","version":"1.3.0","platform":"ruby","checksum":"5d10afe4be3639bff78c50a56768c20f39aecdabc580c08aa45573911c2bd687"}, {"name":"git","version":"1.11.0","platform":"ruby","checksum":"7e95ba4da8298a0373ef1a6862aa22007d761f3c8274b675aa787966fecea0f1"}, -{"name":"gitaly","version":"15.8.0.pre.rc1","platform":"ruby","checksum":"9244245b602c6c903eb0e3b3629b51e888af179cbbe339269095a1ab9113dbb5"}, +{"name":"gitaly","version":"15.9.0.pre.rc1","platform":"ruby","checksum":"c5ebbe6b1f2770020b0857a6a03bf1f52cd0be9ae05dbbb296316b3e7d75b42b"}, {"name":"gitlab","version":"4.19.0","platform":"ruby","checksum":"3f645e3e195dbc24f0834fbf83e8ccfb2056d8e9712b01a640aad418a6949679"}, {"name":"gitlab-chronic","version":"0.10.5","platform":"ruby","checksum":"f80f18dc699b708870a80685243331290bc10cfeedb6b99c92219722f729c875"}, {"name":"gitlab-dangerfiles","version":"3.6.6","platform":"ruby","checksum":"cabfe23490120188a653c827a32121bdd4abf4e9e91d1754bf170dd7e93781f1"}, diff --git a/Gemfile.lock b/Gemfile.lock index b65ff44c9f4..d51c3f226d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -563,7 +563,7 @@ GEM rails (>= 3.2.0) git (1.11.0) rchardet (~> 1.8) - gitaly (15.8.0.pre.rc1) + gitaly (15.9.0.pre.rc1) grpc (~> 1.0) gitlab (4.19.0) httparty (~> 0.20) @@ -1677,7 +1677,7 @@ DEPENDENCIES gettext (~> 3.3) gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails_js (~> 1.3) - gitaly (~> 15.8.0.pre.rc1) + gitaly (~> 15.9.0.pre.rc1) gitlab-chronic (~> 0.10.5) gitlab-dangerfiles (~> 3.6.6) gitlab-experiment (~> 0.7.1) diff --git a/app/assets/javascripts/api/groups_api.js b/app/assets/javascripts/api/groups_api.js index e859160c2e7..1b216e6f721 100644 --- a/app/assets/javascripts/api/groups_api.js +++ b/app/assets/javascripts/api/groups_api.js @@ -4,6 +4,8 @@ import { buildApiUrl } from './api_utils'; const GROUP_PATH = '/api/:version/groups/:id'; const GROUPS_PATH = '/api/:version/groups.json'; +const GROUP_MEMBERS_PATH = '/api/:version/groups/:id/members'; +const GROUP_ALL_MEMBERS_PATH = '/api/:version/groups/:id/members/all'; const DESCENDANT_GROUPS_PATH = '/api/:version/groups/:id/descendant_groups'; const GROUP_TRANSFER_LOCATIONS_PATH = 'api/:version/groups/:id/transfer_locations'; @@ -45,3 +47,10 @@ export const getGroupTransferLocations = (groupId, params = {}) => { return axios.get(url, { params: { ...defaultParams, ...params } }); }; + +export const getGroupMembers = (groupId, inherited = false) => { + const path = inherited ? GROUP_ALL_MEMBERS_PATH : GROUP_MEMBERS_PATH; + const url = buildApiUrl(path).replace(':id', groupId); + + return axios.get(url); +}; diff --git a/app/assets/javascripts/api/projects_api.js b/app/assets/javascripts/api/projects_api.js index fe2e2bde940..5c0d101ef5b 100644 --- a/app/assets/javascripts/api/projects_api.js +++ b/app/assets/javascripts/api/projects_api.js @@ -3,6 +3,8 @@ import axios from '../lib/utils/axios_utils'; import { buildApiUrl } from './api_utils'; const PROJECTS_PATH = '/api/:version/projects.json'; +const PROJECT_MEMBERS_PATH = '/api/:version/projects/:id/members'; +const PROJECT_ALL_MEMBERS_PATH = '/api/:version/projects/:id/members/all'; const PROJECT_IMPORT_MEMBERS_PATH = '/api/:version/projects/:id/import_project_members/:project_id'; const PROJECT_REPOSITORY_SIZE_PATH = '/api/:version/projects/:id/repository_size'; const PROJECT_TRANSFER_LOCATIONS_PATH = 'api/:version/projects/:id/transfer_locations'; @@ -54,3 +56,10 @@ export const getTransferLocations = (projectId, params = {}) => { return axios.get(url, { params: { ...defaultParams, ...params } }); }; + +export const getProjectMembers = (projectId, inherited = false) => { + const path = inherited ? PROJECT_ALL_MEMBERS_PATH : PROJECT_MEMBERS_PATH; + const url = buildApiUrl(path).replace(':id', projectId); + + return axios.get(url); +}; diff --git a/app/assets/javascripts/issuable/popover/components/issue_popover.vue b/app/assets/javascripts/issuable/popover/components/issue_popover.vue index 945a3782642..55fb3958e82 100644 --- a/app/assets/javascripts/issuable/popover/components/issue_popover.vue +++ b/app/assets/javascripts/issuable/popover/components/issue_popover.vue @@ -4,7 +4,7 @@ import query from 'ee_else_ce/issuable/popover/queries/issue.query.graphql'; import IssueDueDate from '~/boards/components/issue_due_date.vue'; import IssueMilestone from '~/issuable/components/issue_milestone.vue'; import StatusBox from '~/issuable/components/status_box.vue'; -import { IssuableStatus } from '~/issues/constants'; +import { STATUS_CLOSED } from '~/issues/constants'; import timeagoMixin from '~/vue_shared/mixins/timeago'; import WorkItemTypeIcon from '~/work_items/components/work_item_type_icon.vue'; @@ -57,7 +57,7 @@ export default { return Object.keys(this.issue).length > 0; }, isIssueClosed() { - return this.issue?.state === IssuableStatus.Closed; + return this.issue?.state === STATUS_CLOSED; }, }, apollo: { diff --git a/app/assets/javascripts/issues/constants.js b/app/assets/javascripts/issues/constants.js index 4b9a42da178..7213a4edf89 100644 --- a/app/assets/javascripts/issues/constants.js +++ b/app/assets/javascripts/issues/constants.js @@ -1,15 +1,13 @@ import { __ } from '~/locale'; -export const IssuableStatus = { - Closed: 'closed', - Open: 'opened', - Reopened: 'reopened', -}; +export const STATUS_CLOSED = 'closed'; +export const STATUS_OPEN = 'opened'; +export const STATUS_REOPENED = 'reopened'; export const IssuableStatusText = { - [IssuableStatus.Closed]: __('Closed'), - [IssuableStatus.Open]: __('Open'), - [IssuableStatus.Reopened]: __('Open'), + [STATUS_CLOSED]: __('Closed'), + [STATUS_OPEN]: __('Open'), + [STATUS_REOPENED]: __('Open'), }; export const IssuableType = { diff --git a/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue b/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue index ace128e22db..a4a2feba716 100644 --- a/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue +++ b/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue @@ -4,7 +4,7 @@ import * as Sentry from '@sentry/browser'; import getIssuesQuery from 'ee_else_ce/issues/dashboard/queries/get_issues.query.graphql'; import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_statistics.vue'; import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue'; -import { IssuableStatus } from '~/issues/constants'; +import { STATUS_CLOSED } from '~/issues/constants'; import { CREATED_DESC, defaultTypeTokenOptions, @@ -363,10 +363,10 @@ export default { return axios.get('/-/autocomplete/users.json', { params: { active: true, search } }); }, getStatus(issue) { - if (issue.state === IssuableStatus.Closed && issue.moved) { + if (issue.state === STATUS_CLOSED && issue.moved) { return this.$options.i18n.closedMoved; } - if (issue.state === IssuableStatus.Closed) { + if (issue.state === STATUS_CLOSED) { return this.$options.i18n.closed; } return undefined; diff --git a/app/assets/javascripts/issues/list/components/issue_card_time_info.vue b/app/assets/javascripts/issues/list/components/issue_card_time_info.vue index 1139861ae78..d11540ad3dd 100644 --- a/app/assets/javascripts/issues/list/components/issue_card_time_info.vue +++ b/app/assets/javascripts/issues/list/components/issue_card_time_info.vue @@ -1,6 +1,6 @@ @@ -22,6 +29,7 @@ export default { diff --git a/app/assets/javascripts/search/sidebar/components/checkbox_filter.vue b/app/assets/javascripts/search/sidebar/components/checkbox_filter.vue new file mode 100644 index 00000000000..b580d58b21b --- /dev/null +++ b/app/assets/javascripts/search/sidebar/components/checkbox_filter.vue @@ -0,0 +1,81 @@ + + + diff --git a/app/assets/javascripts/search/sidebar/components/language_filter.vue b/app/assets/javascripts/search/sidebar/components/language_filter.vue new file mode 100644 index 00000000000..7a65f8c7956 --- /dev/null +++ b/app/assets/javascripts/search/sidebar/components/language_filter.vue @@ -0,0 +1,125 @@ + + + diff --git a/app/assets/javascripts/search/sidebar/utils.js b/app/assets/javascripts/search/sidebar/utils.js new file mode 100644 index 00000000000..5c08ad2f959 --- /dev/null +++ b/app/assets/javascripts/search/sidebar/utils.js @@ -0,0 +1,20 @@ +import { languageFilterData } from '~/search/sidebar/constants/language_filter_data'; + +export const convertFiltersData = (rawBuckets) => { + return rawBuckets.reduce( + (acc, bucket) => { + return { + ...acc, + filters: { + ...acc.filters, + [bucket.key.toUpperCase()]: { + label: bucket.key, + value: bucket.key, + count: bucket.count, + }, + }, + }; + }, + { ...languageFilterData, filters: {} }, + ); +}; diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 539e92eeca4..f136a8c3a08 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -634,9 +634,10 @@ $status-icon-size: 22px; /* * Social Icons */ -$twitter: #1d9bf0; -$skype: #0078d7; +$discord: #5865f2; $linkedin: #2867b2; +$skype: #0078d7; +$twitter: #1d9bf0; /* * Award emoji diff --git a/app/assets/stylesheets/page_bundles/profile.scss b/app/assets/stylesheets/page_bundles/profile.scss index ac1e9fb024b..fc745433f1b 100644 --- a/app/assets/stylesheets/page_bundles/profile.scss +++ b/app/assets/stylesheets/page_bundles/profile.scss @@ -240,6 +240,10 @@ color: $twitter; } +.discord-icon { + color: $discord; +} + .key-created-at { line-height: 42px; } diff --git a/app/assets/stylesheets/page_bundles/search.scss b/app/assets/stylesheets/page_bundles/search.scss index 6ffa14dd342..cde570cfb0f 100644 --- a/app/assets/stylesheets/page_bundles/search.scss +++ b/app/assets/stylesheets/page_bundles/search.scss @@ -5,6 +5,7 @@ $search-avatar-size: 16px; $search-sidebar-min-width: 240px; $search-sidebar-max-width: 300px; $search-keyboard-shortcut: '/'; +$language-filter-max-height: 20rem; $border-radius-medium: 3px; @@ -25,6 +26,16 @@ $border-radius-medium: 3px; min-width: $search-sidebar-min-width; max-width: $search-sidebar-max-width; } + + .language-filter-checkbox { + .custom-control-label { + flex-grow: 1; + } + } + + .language-filter-max-height { + max-height: $language-filter-max-height; + } } .search-max-w-inherit { diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 4f379d8a75b..23ec80c1fa9 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -359,6 +359,7 @@ class Admin::UsersController < Admin::ApplicationController :skype, :theme_id, :twitter, + :discord, :username, :website_url, :note, diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 93b131369b8..45b274fc920 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -127,6 +127,7 @@ class ProfilesController < Profiles::ApplicationController :commit_email, :skype, :twitter, + :discord, :username, :website_url, :organization, diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 84182e57e2e..5bedf9512e7 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -30,6 +30,9 @@ class SearchController < ApplicationController end before_action :check_search_rate_limit!, only: search_rate_limited_endpoints + before_action only: :show do + push_frontend_feature_flag(:search_blobs_language_aggregation, current_user) + end before_action only: :show do update_scope_for_code_search end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef174584a4b..4afbe98226e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -368,6 +368,12 @@ module ApplicationHelper end end + def discord_url(user) + return '' if user.discord.blank? + + "https://discord.com/users/#{user.discord}" + end + def collapsed_sidebar? cookies["sidebar_collapsed"] == "true" end diff --git a/app/models/user.rb b/app/models/user.rb index 535f1bd874a..6151ba54555 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -380,6 +380,7 @@ class User < ApplicationRecord delegate :website_url, :website_url=, to: :user_detail, allow_nil: true delegate :location, :location=, to: :user_detail, allow_nil: true delegate :organization, :organization=, to: :user_detail, allow_nil: true + delegate :discord, :discord=, to: :user_detail, allow_nil: true accepts_nested_attributes_for :user_preference, update_only: true accepts_nested_attributes_for :user_detail, update_only: true diff --git a/app/models/user_detail.rb b/app/models/user_detail.rb index b6765cb0285..9d3df3d6400 100644 --- a/app/models/user_detail.rb +++ b/app/models/user_detail.rb @@ -14,11 +14,13 @@ class UserDetail < ApplicationRecord DEFAULT_FIELD_LENGTH = 500 + validates :discord, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true + validate :discord_format validates :linkedin, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true - validates :twitter, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true - validates :skype, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true validates :location, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true validates :organization, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true + validates :skype, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true + validates :twitter, length: { maximum: DEFAULT_FIELD_LENGTH }, allow_blank: true validates :website_url, length: { maximum: DEFAULT_FIELD_LENGTH }, url: true, allow_blank: true, if: :website_url_changed? before_validation :sanitize_attrs @@ -27,7 +29,7 @@ class UserDetail < ApplicationRecord enum registration_objective: REGISTRATION_OBJECTIVE_PAIRS, _suffix: true def sanitize_attrs - %i[linkedin skype twitter website_url].each do |attr| + %i[discord linkedin skype twitter website_url].each do |attr| value = self[attr] self[attr] = Sanitize.clean(value) if value.present? end @@ -41,13 +43,20 @@ class UserDetail < ApplicationRecord def prevent_nil_fields self.bio = '' if bio.nil? + self.discord = '' if discord.nil? self.linkedin = '' if linkedin.nil? - self.twitter = '' if twitter.nil? - self.skype = '' if skype.nil? self.location = '' if location.nil? self.organization = '' if organization.nil? + self.skype = '' if skype.nil? + self.twitter = '' if twitter.nil? self.website_url = '' if website_url.nil? end end +def discord_format + return if discord.blank? || discord =~ %r{\A\d{17,20}\z} + + errors.add(:discord, _('must contain only a discord user ID.')) +end + UserDetail.prepend_mod_with('UserDetail') diff --git a/app/models/wiki_directory.rb b/app/models/wiki_directory.rb index f5d00013622..76fe664f23d 100644 --- a/app/models/wiki_directory.rb +++ b/app/models/wiki_directory.rb @@ -49,6 +49,6 @@ class WikiDirectory # Relative path to the partial to be used when rendering collections # of this object. def to_partial_path - '../shared/wikis/wiki_directory' + 'shared/wikis/wiki_directory' end end diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 24b0b94eeb7..b04aa196883 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -259,7 +259,7 @@ class WikiPage # Relative path to the partial to be used when rendering collections # of this object. def to_partial_path - '../shared/wikis/wiki_page' + 'shared/wikis/wiki_page' end def sha diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index eb9d13cc9a3..4b9e999231e 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -301,6 +301,8 @@ class ProjectPolicy < BasePolicy rule { can?(:reporter_access) & can?(:create_issue) }.enable :create_incident + rule { can?(:reporter_access) & can?(:read_environment) }.enable :read_freeze_period + rule { can?(:create_issue) }.enable :create_work_item rule { can?(:create_issue) }.enable :create_task diff --git a/app/presenters/projects/settings/deploy_keys_presenter.rb b/app/presenters/projects/settings/deploy_keys_presenter.rb index b760786aa4c..14aa9f26677 100644 --- a/app/presenters/projects/settings/deploy_keys_presenter.rb +++ b/app/presenters/projects/settings/deploy_keys_presenter.rb @@ -68,10 +68,6 @@ module Projects } end - def to_partial_path - '../../shared/deploy_keys/index' - end - def form_partial_path 'shared/deploy_keys/project_group_form' end diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index cd879e9bc07..ccc23283ec4 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -260,7 +260,7 @@ module Ci end def acquire_temporary_lock(build_id) - return true unless Feature.enabled?(:ci_register_job_temporary_lock, runner) + return true if Feature.disabled?(:ci_register_job_temporary_lock, runner, type: :ops) key = "build/register/#{build_id}" diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 1bc1e0614de..5ffffb80d97 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -103,6 +103,15 @@ .form-group.gl-form-group = f.label :twitter = f.text_field :twitter, class: 'gl-form-input form-control gl-md-form-input-lg', placeholder: s_("Profiles|@username") + .form-group.gl-form-group + - external_accounts_help_url = help_page_path('user/profile/index', anchor: 'add-external-accounts-to-your-user-profile-page') + - external_accounts_link_start = ''.html_safe % { url: external_accounts_help_url } + - external_accounts_docs_link = s_('Profiles|Your Discord user ID. Should be between %{min} and %{max} digits long. %{external_accounts_link_start}Learn more.%{external_accounts_link_end}').html_safe % { min: '17', max: '20', external_accounts_link_start: external_accounts_link_start, external_accounts_link_end: ''.html_safe } + = f.label :discord + = f.text_field :discord, class: 'gl-form-input form-control gl-md-form-input-lg', placeholder: s_("Profiles|User ID") + %small.form-text.text-gl-muted + = external_accounts_docs_link + .form-group.gl-form-group = f.label :website_url, s_('Profiles|Website url') = f.text_field :website_url, class: 'gl-form-input form-control gl-md-form-input-lg', placeholder: s_("Profiles|https://website.com") diff --git a/app/views/projects/settings/repository/show.html.haml b/app/views/projects/settings/repository/show.html.haml index 953bfcf71ab..de171a25e8d 100644 --- a/app/views/projects/settings/repository/show.html.haml +++ b/app/views/projects/settings/repository/show.html.haml @@ -15,7 +15,7 @@ -# reused in EE. = render "projects/settings/repository/protected_branches", protected_branch_entity: @project = render "shared/deploy_tokens/index", group_or_project: @project, description: deploy_token_description -= render @deploy_keys += render 'shared/deploy_keys/index' = render "projects/cleanup/show" = render_if_exists 'shared/promotions/promote_repository_features' diff --git a/app/views/shared/wikis/_sidebar.html.haml b/app/views/shared/wikis/_sidebar.html.haml index cb6a67bd8d4..8b8c981da96 100644 --- a/app/views/shared/wikis/_sidebar.html.haml +++ b/app/views/shared/wikis/_sidebar.html.haml @@ -28,7 +28,8 @@ = render_wiki_content(@sidebar_page) - elsif @sidebar_wiki_entries %ul.wiki-pages - = render @sidebar_wiki_entries, context: 'sidebar' + - @sidebar_wiki_entries.each do |entry| + = render partial: entry.to_partial_path, object: entry, locals: { context: 'sidebar' } .block.w-100 - if @sidebar_limited = link_to wiki_path(@wiki, action: :pages), class: 'btn gl-button btn-block', data: { qa_selector: 'view_all_pages_button' } do diff --git a/app/views/shared/wikis/_wiki_directory.html.haml b/app/views/shared/wikis/_wiki_directory.html.haml index a29e6ba7a85..5c2233a4db2 100644 --- a/app/views/shared/wikis/_wiki_directory.html.haml +++ b/app/views/shared/wikis/_wiki_directory.html.haml @@ -2,4 +2,5 @@ = link_to wiki_page_path(@wiki, wiki_directory), data: { qa_selector: 'wiki_dir_page_link', qa_page_name: wiki_directory.title } do = wiki_directory.title %ul - = render wiki_directory.entries, context: context + - wiki_directory.entries.each do |entry| + = render partial: entry.to_partial_path, object: entry, locals: { context: context } diff --git a/app/views/shared/wikis/pages.html.haml b/app/views/shared/wikis/pages.html.haml index e1252e91c10..f35649d031c 100644 --- a/app/views/shared/wikis/pages.html.haml +++ b/app/views/shared/wikis/pages.html.haml @@ -17,6 +17,7 @@ = wiki_sort_controls(@wiki, params[:direction]) %ul.wiki-pages-list.content-list - = render @wiki_entries, context: 'pages' + - @wiki_entries.each do |entry| + = render partial: entry.to_partial_path, object: entry, locals: { context: 'pages' } = paginate @wiki_pages, theme: 'gitlab' diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index ed76960d3d7..b9290972656 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -101,6 +101,10 @@ = render 'middle_dot_divider', breakpoint: 'sm' do = link_to twitter_url(@user), class: 'gl-hover-text-decoration-none', title: "Twitter", target: '_blank', rel: 'noopener noreferrer nofollow' do = sprite_icon('twitter', css_class: 'twitter-icon') + - unless @user.discord.blank? + = render 'middle_dot_divider', breakpoint: 'sm' do + = link_to discord_url(@user), class: 'gl-hover-text-decoration-none', title: "Discord", target: '_blank', rel: 'noopener noreferrer nofollow' do + = sprite_icon('discord', css_class: 'discord-icon') - unless @user.website_url.blank? = render 'middle_dot_divider', stacking: true do - if Feature.enabled?(:security_auto_fix) && @user.bot? diff --git a/config/feature_flags/development/ci_register_job_temporary_lock.yml b/config/feature_flags/ops/ci_register_job_temporary_lock.yml similarity index 85% rename from config/feature_flags/development/ci_register_job_temporary_lock.yml rename to config/feature_flags/ops/ci_register_job_temporary_lock.yml index cca6a24ffd4..4b91bf97e9e 100644 --- a/config/feature_flags/development/ci_register_job_temporary_lock.yml +++ b/config/feature_flags/ops/ci_register_job_temporary_lock.yml @@ -3,6 +3,6 @@ name: ci_register_job_temporary_lock introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55202 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323180 milestone: '13.10' -type: development +type: ops group: group::pipeline execution -default_enabled: false +default_enabled: true diff --git a/db/migrate/20221128155738_add_discord_to_user_details.rb b/db/migrate/20221128155738_add_discord_to_user_details.rb new file mode 100644 index 00000000000..4d59a53dcd7 --- /dev/null +++ b/db/migrate/20221128155738_add_discord_to_user_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddDiscordToUserDetails < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + # rubocop:disable Migration/AddLimitToTextColumns + # limits are added in 20221128165833_add_discord_field_limit_to_user_details.rb + def change + add_column :user_details, :discord, :text, default: '', null: false + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb b/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb new file mode 100644 index 00000000000..a63b2019b20 --- /dev/null +++ b/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddDiscordFieldLimitToUserDetails < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + USER_DETAILS_FIELD_LIMIT = 500 + + def up + add_text_limit :user_details, :discord, USER_DETAILS_FIELD_LIMIT + end + + def down + remove_text_limit :user_details, :discord + end +end diff --git a/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb b/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb index f98be3f036f..d409a4dfdd1 100644 --- a/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb +++ b/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb @@ -3,29 +3,13 @@ class SanitizeConfidentialNoteTodos < Gitlab::Database::Migration[2.0] restrict_gitlab_migration gitlab_schema: :gitlab_main - MIGRATION = 'SanitizeConfidentialTodos' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 200 - MAX_BATCH_SIZE = 1000 - SUB_BATCH_SIZE = 20 - - disable_ddl_transaction! - restrict_gitlab_migration gitlab_schema: :gitlab_main - def up - queue_batched_background_migration( - MIGRATION, - :notes, - :id, - job_interval: DELAY_INTERVAL, - batch_size: BATCH_SIZE, - max_batch_size: MAX_BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE, - gitlab_schema: :gitlab_main - ) + # no-op: this empty migration is left here only for compatibility reasons. + # It was a temporary migration which used not-isolated code. + # https://gitlab.com/gitlab-org/gitlab/-/issues/382557 end def down - delete_batched_background_migration(MIGRATION, :notes, :id, []) + # no-op end end diff --git a/db/schema_migrations/20221128155738 b/db/schema_migrations/20221128155738 new file mode 100644 index 00000000000..5322aa1f75e --- /dev/null +++ b/db/schema_migrations/20221128155738 @@ -0,0 +1 @@ +39ca72ad461ff7b56ce6feed351ef46ee9f3584a8c3c9383ca75f44b61baa1a1 \ No newline at end of file diff --git a/db/schema_migrations/20221128165833 b/db/schema_migrations/20221128165833 new file mode 100644 index 00000000000..e2aeaa26c32 --- /dev/null +++ b/db/schema_migrations/20221128165833 @@ -0,0 +1 @@ +4f4846fe8e5f84ee566dfc8f9b8249e1ff1d77f8f6c2f0006d89a73a2e734b9d \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 4595145cbc7..aa0a4f486ca 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22714,9 +22714,11 @@ CREATE TABLE user_details ( organization text DEFAULT ''::text NOT NULL, password_last_changed_at timestamp with time zone DEFAULT now() NOT NULL, onboarding_step_url text, + discord text DEFAULT ''::text NOT NULL, CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)), CONSTRAINT check_444573ee52 CHECK ((char_length(skype) <= 500)), CONSTRAINT check_466a25be35 CHECK ((char_length(twitter) <= 500)), + CONSTRAINT check_4ef1de1a15 CHECK ((char_length(discord) <= 500)), CONSTRAINT check_4f51129940 CHECK ((char_length(onboarding_step_url) <= 2000)), CONSTRAINT check_7b246dad73 CHECK ((char_length(organization) <= 500)), CONSTRAINT check_7d6489f8f3 CHECK ((char_length(linkedin) <= 500)), diff --git a/doc/api/features.md b/doc/api/features.md index 819405bea77..c3db1e53f68 100644 --- a/doc/api/features.md +++ b/doc/api/features.md @@ -116,7 +116,7 @@ POST /features/:name | `name` | string | yes | Name of the feature to create or update | | `value` | integer/string | yes | `true` or `false` to enable/disable, or an integer for percentage of time | | `key` | string | no | `percentage_of_actors` or `percentage_of_time` (default) | -| `feature_group` | string | no | A Feature group name | +| `feature_group` | string | no | A [Feature group](../development/feature_flags/index.md#feature-groups) name | | `user` | string | no | A GitLab username or comma-separated multiple usernames | | `group` | string | no | A GitLab group's path, for example `gitlab-org`, or comma-separated multiple group paths | | `namespace` | string | no | A GitLab group or user namespace's path, for example `john-doe`, or comma-separated multiple namespace paths. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/353117) in GitLab 15.0. | diff --git a/doc/api/freeze_periods.md b/doc/api/freeze_periods.md index 9cf5ba5ed7f..ce7377e1e35 100644 --- a/doc/api/freeze_periods.md +++ b/doc/api/freeze_periods.md @@ -13,8 +13,9 @@ You can use the Freeze Periods API to manipulate GitLab [Freeze Period](../user/ ## Permissions and security -Only users with Maintainer [permissions](../user/permissions.md) can -interact with the Freeze Period API endpoints. +Users with Reporter [permissions](../user/permissions.md) or greater can read +Freeze Period API endpoints. Only users with the Maintainer role can modify +Freeze Periods. ## List freeze periods diff --git a/doc/api/packages/debian.md b/doc/api/packages/debian.md index dd8679c3bdc..87b583de5e6 100644 --- a/doc/api/packages/debian.md +++ b/doc/api/packages/debian.md @@ -40,6 +40,10 @@ The Debian group API is behind a feature flag that is disabled by default. can opt to enable it. To enable it, follow the instructions in [Enable the Debian group API](../../user/packages/debian_repository/index.md#enable-the-debian-group-api). +### Authenticate to the Debian Package Repositories + +See [Authenticate to the Debian Package Repositories](../../user/packages/debian_repository/index.md#authenticate-to-the-debian-package-repositories). + ## Upload a package file > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62028) in GitLab 14.0. diff --git a/doc/api/packages/debian_group_distributions.md b/doc/api/packages/debian_group_distributions.md index a000373089e..23bc85bf0a0 100644 --- a/doc/api/packages/debian_group_distributions.md +++ b/doc/api/packages/debian_group_distributions.md @@ -26,12 +26,16 @@ Debian group repository support is still a work in progress. It's gated behind a can opt to enable it. To enable it, follow the instructions in [Enable the Debian group API](../../user/packages/debian_repository/index.md#enable-the-debian-group-api). +## Authenticate to the Debian distributions APIs + +See [Authenticate to the Debian distributions APIs](../../user/packages/debian_repository/index.md#authenticate-to-the-debian-distributions-apis). + ## List all Debian distributions in a group Lists Debian distributions in the given group. ```plaintext -GET /groups/:id/debian_distributions +GET /groups/:id/-/debian_distributions ``` | Attribute | Type | Required | Description | @@ -73,7 +77,7 @@ Example response: Gets a single Debian group distribution. ```plaintext -GET /groups/:id/debian_distributions/:codename +GET /groups/:id/-/debian_distributions/:codename ``` | Attribute | Type | Required | Description | @@ -112,7 +116,7 @@ Example response: Gets a single Debian group distribution key. ```plaintext -GET /groups/:id/debian_distributions/:codename/key.asc +GET /groups/:id/-/debian_distributions/:codename/key.asc ``` | Attribute | Type | Required | Description | @@ -149,7 +153,7 @@ DAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn Creates a Debian group distribution. ```plaintext -POST /groups/:id/debian_distributions +POST /groups/:id/-/debian_distributions ``` | Attribute | Type | Required | Description | @@ -196,7 +200,7 @@ Example response: Updates a Debian group distribution. ```plaintext -PUT /groups/:id/debian_distributions/:codename +PUT /groups/:id/-/debian_distributions/:codename ``` | Attribute | Type | Required | Description | @@ -243,7 +247,7 @@ Example response: Deletes a Debian group distribution. ```plaintext -DELETE /groups/:id/debian_distributions/:codename +DELETE /groups/:id/-/debian_distributions/:codename ``` | Attribute | Type | Required | Description | diff --git a/doc/api/packages/debian_project_distributions.md b/doc/api/packages/debian_project_distributions.md index b66a70f1e15..0a43546e2e1 100644 --- a/doc/api/packages/debian_project_distributions.md +++ b/doc/api/packages/debian_project_distributions.md @@ -25,6 +25,10 @@ The Debian API is behind a feature flag that is disabled by default. can opt to enable it. To enable it, follow the instructions in [Enable the Debian API](../../user/packages/debian_repository/index.md#enable-the-debian-api). +## Authenticate to the Debian distributions APIs + +See [Authenticate to the Debian distributions APIs](../../user/packages/debian_repository/index.md#authenticate-to-the-debian-distributions-apis). + ## List all Debian distributions in a project Lists Debian distributions in the given project. diff --git a/doc/api/projects.md b/doc/api/projects.md index 356492fb3ab..d53c515bfbe 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -2867,7 +2867,7 @@ Read more in the [Project vulnerabilities](project_vulnerabilities.md) documenta ## Get a project's pull mirror details **(PREMIUM)** -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/354506) in GitLab 15.5. +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/354506) in GitLab 15.6. Returns the details of the project's pull mirror. diff --git a/doc/architecture/blueprints/runner_tokens/index.md b/doc/architecture/blueprints/runner_tokens/index.md index d3376e06ef7..f63e453bfae 100644 --- a/doc/architecture/blueprints/runner_tokens/index.md +++ b/doc/architecture/blueprints/runner_tokens/index.md @@ -336,9 +336,12 @@ scope. | GitLab Rails app | `%15.8` | Create database migration to add `config` column to `ci_runner_machines` table. | | GitLab Runner | `%15.9` | Start sending `system_id` value in `POST /jobs/request` request and other follow-up requests that require identifying the unique system. | | GitLab Rails app | `%15.9` | Create service similar to `StaleGroupRunnersPruneCronWorker` service to clean up `ci_runner_machines` records instead of `ci_runners` records.
Existing service continues to exist but focuses only on legacy runners. | +| GitLab Rails app | `%15.9` | [Feature flag] Rollout of `create_runner_machine`. | | GitLab Rails app | `%15.9` | Create `ci_runner_machines` record in `POST /runners/verify` request if the runner token is prefixed with `glrt-`. | | GitLab Rails app | `%15.9` | Use runner token + `system_id` JSON parameters in `POST /jobs/request` request in the [heartbeat request](https://gitlab.com/gitlab-org/gitlab/blob/c73c96a8ffd515295842d72a3635a8ae873d688c/lib/api/ci/helpers/runner.rb#L14-20) to update the `ci_runner_machines` cache/table. | | GitLab Rails app | `%15.9` | [Feature flag] Enable runner creation workflow (`create_runner_workflow`). | +| GitLab Rails app | `%15.9` | Implement `create_{instance|group|project}_runner` permissions. | +| GitLab Rails app | `%15.10` | Rename `ci_runner_machines.machine_xid` column to `system_xid` to be consistent with `system_id` passed in APIs. | ### Stage 4 - New UI @@ -355,13 +358,22 @@ scope. | Component | Milestone | Changes | |------------------|----------:|---------| -| GitLab Rails app | | Add UI to allow disabling use of registration tokens at project or group level. | -| GitLab Rails app | `16.0` | Introduce `:disable_runner_registration_tokens` feature flag (enabled by default) to control whether use of registration tokens is allowed. | -| GitLab Rails app | | Make [`POST /api/v4/runners` endpoint](../../../api/runners.md#register-a-new-runner) permanently return `HTTP 410 Gone` if either `allow_runner_registration_token` setting or `:disable_runner_registration_tokens` feature flag disables registration tokens.
A future v5 version of the API should return `HTTP 404 Not Found`. | -| GitLab Rails app | | Start refusing job requests that don't include a unique ID, if either `allow_runner_registration_token` setting or `:disable_runner_registration_tokens` feature flag disables registration tokens. | -| GitLab Rails app | | Hide legacy UI showing registration with a registration token, if `:disable_runner_registration_tokens` feature flag disables registration tokens. | +| GitLab Rails app | `%15.11` | Adapt `register_{group|project}_runner` permissions to take [application setting](https://gitlab.com/gitlab-org/gitlab/-/issues/386712) in consideration. | +| GitLab Rails app | `%15.11` | Add UI to allow disabling use of registration tokens at project or group level. | +| GitLab Rails app | `%15.11` | Introduce `:enforce_create_runner_workflow` feature flag (disabled by default) to control whether use of registration tokens is allowed. | +| GitLab Rails app | `%15.11` | Make [`POST /api/v4/runners` endpoint](../../../api/runners.md#register-a-new-runner) permanently return `HTTP 410 Gone` if either `allow_runner_registration_token` setting or `:enforce_create_runner_workflow` feature flag disables registration tokens.
A future v5 version of the API should return `HTTP 404 Not Found`. | +| GitLab Rails app | `%15.11` | Start refusing job requests that don't include a unique ID, if either `allow_runner_registration_token` setting or `:enforce_create_runner_workflow` feature flag disables registration tokens. | +| GitLab Rails app | `%15.11` | Hide legacy UI showing registration with a registration token, if `:enforce_create_runner_workflow` feature flag disables registration tokens. | -### Stage 6 - Removals +### Stage 6 - Enforcement + +| Component | Milestone | Changes | +|------------------|----------:|---------| +| GitLab Runner | `%16.0` | Do not allow runner to start if `.runner_system_id` file cannot be written. | +| GitLab Rails app | `%16.0` | Enable `:enforce_create_runner_workflow` feature flag by default. | +| GitLab Rails app | `%16.0` | Start reject job requests that don't include `system_id` value. | + +### Stage 7 - Removals | Component | Milestone | Changes | |------------------|----------:|---------| @@ -369,7 +381,7 @@ scope. | GitLab Runner | `17.0` | Remove runner model arguments from `register` command (for example `--run-untagged`, `--tag-list`, etc.) | | GitLab Rails app | `17.0` | Create database migrations to drop `allow_runner_registration_token` setting columns from `application_settings` and `namespace_settings` tables. | | GitLab Rails app | `17.0` | Create database migrations to drop:
- `runners_registration_token`/`runners_registration_token_encrypted` columns from `application_settings`;
- `runners_token`/`runners_token_encrypted` from `namespaces` table;
- `runners_token`/`runners_token_encrypted` from `projects` table. | -| GitLab Rails app | `17.0` | Remove `:disable_runner_registration_tokens` feature flag. | +| GitLab Rails app | `17.0` | Remove `:enforce_create_runner_workflow` feature flag. | ## Status diff --git a/doc/development/feature_flags/controls.md b/doc/development/feature_flags/controls.md index f1eafc2a95a..3adf5248b8d 100644 --- a/doc/development/feature_flags/controls.md +++ b/doc/development/feature_flags/controls.md @@ -196,7 +196,22 @@ enabled for only the `gitlab` project. The project is passed by supplying a /chatops run feature set --project=gitlab-org/gitlab some_feature true ``` -For groups the `--group` flag is available: +You can use the `--user` option to enable a feature flag for a specific user: + +```shell +/chatops run feature set --user=myusername some_feature true +``` + +If you would like to gather feedback internally first, +feature flags scoped to a user can also be enabled +for GitLab team members with the `gitlab_team_members` +[feature group](index.md#feature-groups): + +```shell +/chatops run feature set --feature-group=gitlab_team_members some_feature true +``` + +You can use the `--group` flag to enable a feature flag for a specific group: ```shell /chatops run feature set --group=gitlab-org some_feature true diff --git a/doc/development/feature_flags/index.md b/doc/development/feature_flags/index.md index 8f5c19efd94..7370697b082 100644 --- a/doc/development/feature_flags/index.md +++ b/doc/development/feature_flags/index.md @@ -459,6 +459,18 @@ dynamic (querying the DB, for example). Once defined in `lib/feature.rb`, you can to activate a feature for a given feature group via the [`feature_group` parameter of the features API](../../api/features.md#set-or-create-a-feature) +The available feature groups are: + +| Group name | Scoped to | Description | +| --------------------- | --------- | ----------- | +| `gitlab_team_members` | Users | Enables the feature for users who are members of [`gitlab-com`](https://gitlab.com/gitlab-com) | + +Feature groups can be enabled via the group name: + +```ruby +Feature.enable(:feature_flag_name, :gitlab_team_members) +``` + ### Enabling a feature flag locally (in development) In the rails console (`rails c`), enter the following command to enable a feature flag: diff --git a/doc/operations/error_tracking.md b/doc/operations/error_tracking.md index 47badae7472..0be2f087c62 100644 --- a/doc/operations/error_tracking.md +++ b/doc/operations/error_tracking.md @@ -6,7 +6,13 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Error Tracking **(FREE)** -Error Tracking allows developers to easily discover and view the errors that their application may be generating. By surfacing error information where the code is being developed, efficiency and awareness can be increased. +> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/389991) in GitLab 15.9. + +WARNING: +This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/389991) +for use in GitLab 15.9, and is planned for removal in GitLab 16.0. We are replacing this feature with functionality in the [GitLab Observability UI](https://gitlab.com/gitlab-org/opstrace/opstrace-ui). Please also reference our direction for [Observability](https://about.gitlab.com/direction/monitor/observability/) and [data visualization](https://about.gitlab.com/direction/monitor/observability/data-visualization/). + +Error Tracking allows developers to discover and view errors generated by their application. Because error information is surfaced where the code is being developed, efficiency and awareness are increased. ## How error tracking works diff --git a/doc/update/index.md b/doc/update/index.md index b09ba691081..022c5472ba4 100644 --- a/doc/update/index.md +++ b/doc/update/index.md @@ -264,6 +264,10 @@ NOTE: Specific information that follow related to Ruby and Git versions do not apply to [Omnibus installations](https://docs.gitlab.com/omnibus/) and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with appropriate Ruby and Git versions and are not using system binaries for Ruby and Git. There is no need to install Ruby or Git when utilizing these two approaches. +### 15.9.0 + +- This version removes `SanitizeConfidentialTodos` background migration which was [added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87908/diffs) in 15.6 and removed any user inaccessible Todos. Make sure that this migration is finished before upgrading to 15.9. + ### 15.8.0 - Git 2.38.0 and later is required by Gitaly. For installations from source, you should use the [Git version provided by Gitaly](../install/installation.md#git). diff --git a/doc/user/admin_area/settings/account_and_limit_settings.md b/doc/user/admin_area/settings/account_and_limit_settings.md index 7f678344955..35a4c0aeea7 100644 --- a/doc/user/admin_area/settings/account_and_limit_settings.md +++ b/doc/user/admin_area/settings/account_and_limit_settings.md @@ -86,6 +86,9 @@ To modify the maximum file size for imports in GitLab: 1. On the left sidebar, select **Settings > General**, then expand **Account and limit**. 1. Increase or decrease by changing the value in **Maximum import size (MB)**. +This setting applies only to repositories +[imported from a GitLab export file](../../project/settings/import_export.md#import-a-project-and-its-data). + If you choose a size larger than the configured value for the web server, you may receive errors. See the [troubleshooting section](#troubleshooting) for more details. diff --git a/doc/user/clusters/agent/work_with_agent.md b/doc/user/clusters/agent/work_with_agent.md index 28a0d366ec5..0b0e1365604 100644 --- a/doc/user/clusters/agent/work_with_agent.md +++ b/doc/user/clusters/agent/work_with_agent.md @@ -19,6 +19,7 @@ Prerequisite: To view the list of agents: 1. On the top bar, select **Main menu > Projects** and find the project that contains your agent configuration file. + You cannot view registered agents from a project that does not contain the agent configuration file. 1. On the left sidebar, select **Infrastructure > Kubernetes clusters**. 1. Select **Agent** tab to view clusters connected to GitLab through the agent. diff --git a/doc/user/okrs.md b/doc/user/okrs.md index a4ba1f8f646..0d3be8474fe 100644 --- a/doc/user/okrs.md +++ b/doc/user/okrs.md @@ -13,8 +13,8 @@ OKRs are in [**Alpha**](../policy/alpha-beta-support.md#alpha-features). For the OKR feature roadmap, see [epic 7864](https://gitlab.com/groups/gitlab-org/-/epics/7864). FLAG: -On self-managed GitLab, by default this feature is not available. To make it available, -ask an administrator to [enable the featured flag](../administration/feature_flags.md) named `okrs_mvc`. +On self-managed GitLab, by default this feature is not available. To make it available per project, ask an administrator to [enable the featured flag](../administration/feature_flags.md) named `okrs_mvc`. +On GitLab.com, this feature is not available. The feature is not ready for production use. Use objectives and key results to align your workforce towards common goals and track the progress. diff --git a/doc/user/packages/debian_repository/index.md b/doc/user/packages/debian_repository/index.md index 08b069c3f69..7ec20e3d036 100644 --- a/doc/user/packages/debian_repository/index.md +++ b/doc/user/packages/debian_repository/index.md @@ -62,24 +62,44 @@ Feature.disable(:debian_group_packages) Creating a Debian package is documented [on the Debian Wiki](https://wiki.debian.org/Packaging). -## Authenticate to the Package Registry +## Authenticate to the Debian endpoints -To create a distribution, publish a package, or install a private package, you need one of the -following: +Authentication methods differs between [distributions APIs](#authenticate-to-the-debian-distributions-apis) +and [package repositories](#authenticate-to-the-debian-package-repositories). -- [Personal access token](../../../api/rest/index.md#personalprojectgroup-access-tokens) -- [CI/CD job token](../../../ci/jobs/ci_job_token.md) +### Authenticate to the Debian distributions APIs + +To create, read, update, or delete a distribution, you need one of the following: + +- [Personal access token](../../../api/rest/index.md#personalprojectgroup-access-tokens), + using `--header "PRIVATE-TOKEN: "` - [Deploy token](../../project/deploy_tokens/index.md) + using `--header "Deploy-Token: "` +- [CI/CD job token](../../../ci/jobs/ci_job_token.md) + using `--header "Job-Token: "` + +### Authenticate to the Debian Package Repositories + +To publish a package, or install a private package, you need to use basic authentication, +with one of the following: + +- [Personal access token](../../../api/rest/index.md#personalprojectgroup-access-tokens), + using `:` +- [Deploy token](../../project/deploy_tokens/index.md) + using `:` +- [CI/CD job token](../../../ci/jobs/ci_job_token.md) + using `gitlab-ci-token:` ## Create a Distribution On the project-level, Debian packages are published using *Debian Distributions*. To publish packages on the group level, create a distribution with the same `codename`. -To create a project-level distribution: +To create a project-level distribution using a personal access token: ```shell -curl --request POST --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/projects//debian_distributions?codename=" +curl --request POST --header "PRIVATE-TOKEN: " \ + "https://gitlab.example.com/api/v4/projects//debian_distributions?codename=" ``` Example response with `codename=sid`: @@ -120,33 +140,50 @@ Once built, several files are created: - `.buildinfo` file: Used for Reproducible builds (optional) - `.changes` file: Upload metadata, and list of uploaded files (all the above) -To upload these files, you can use `dput-ng >= 1.32` (Debian bullseye): +To upload these files, you can use `dput-ng >= 1.32` (Debian bullseye). +`` and `` are defined +[as above](#authenticate-to-the-debian-package-repositories): ```shell cat < dput.cf [gitlab] method = https -fqdn = :@gitlab.example.com +fqdn = :@gitlab.example.com incoming = /api/v4/projects//packages/debian EOF dput --config=dput.cf --unchecked --no-upload-log gitlab .changes ``` +## Directly upload a package + +> Direct upload [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/101838) in GitLab 15.9. + +When you don't have access to `.changes` file, you can directly upload a `.deb` by passing +distribution `codename` and target `component` as parameters with +your [credentials](#authenticate-to-the-debian-package-repositories). +For example, to upload to component `main` of distribution `sid` using a personal access token: + +```shell +curl --request PUT --user ":" \ + "https://gitlab.example.com/api/v4/projects//packages/debian/?distribution=sid&component=main" \ + --upload-file /path/to/your.deb +``` + ## Install a package To install a package: 1. Configure the repository: - If you are using a private project, add your [credentials](#authenticate-to-the-package-registry) to your apt configuration: + If you are using a private project, add your [credentials](#authenticate-to-the-debian-package-repositories) to your apt configuration: ```shell - echo 'machine gitlab.example.com login password ' \ + echo 'machine gitlab.example.com login password ' \ | sudo tee /etc/apt/auth.conf.d/gitlab_project.conf ``` - Download your distribution key: + Download your distribution key using your [credentials](#authenticate-to-the-debian-distributions-apis): ```shell sudo mkdir -p /usr/local/share/keyrings @@ -179,14 +216,14 @@ To download a source package: 1. Configure the repository: - If you are using a private project, add your [credentials](#authenticate-to-the-package-registry) to your apt configuration: + If you are using a private project, add your [credentials](#authenticate-to-the-debian-package-repositories) to your apt configuration: ```shell - echo 'machine gitlab.example.com login password ' \ + echo 'machine gitlab.example.com login password ' \ | sudo tee /etc/apt/auth.conf.d/gitlab_project.conf ``` - Download your distribution key: + Download your distribution key using your [credentials](#authenticate-to-the-debian-distributions-apis): ```shell sudo mkdir -p /usr/local/share/keyrings diff --git a/doc/user/profile/index.md b/doc/user/profile/index.md index 65951ce2dda..a84d16e6d0c 100644 --- a/doc/user/profile/index.md +++ b/doc/user/profile/index.md @@ -132,8 +132,9 @@ To add links to other accounts: 1. On the top bar, in the upper-right corner, select your avatar. 1. Select **Edit profile**. 1. In the **Main settings** section, add your information from: - - Skype + - Discord ([User ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-)) - LinkedIn + - Skype - Twitter 1. Select **Update profile settings**. diff --git a/doc/user/project/quick_actions.md b/doc/user/project/quick_actions.md index d12a71c9ab3..194b501d1fb 100644 --- a/doc/user/project/quick_actions.md +++ b/doc/user/project/quick_actions.md @@ -71,7 +71,7 @@ threads. Some quick actions might not be available to all subscription tiers. | `/create_merge_request ` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Create a new merge request starting from the current issue. | | `/done` | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | Mark to do as done. | | `/draft` | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No | Set the [draft status](merge_requests/drafts.md). Use for toggling the draft status ([deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92654) in GitLab 15.4.) | -| `/due ` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Set due date. Examples of valid `` include `in 2 days`, `this Friday` and `December 31st`. | +| `/due ` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Set due date. Examples of valid `` include `in 2 days`, `this Friday` and `December 31st`. See [Chronic](https://gitlab.com/gitlab-org/ruby/gems/gitlab-chronic#examples) for more examples. | | `/duplicate <#issue>` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Close this issue. Mark as a duplicate of, and related to, issue `<#issue>`. | | `/epic ` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Add to epic ``. The `` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. | | `/estimate