Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
		
							parent
							
								
									bcd0f3a2f6
								
							
						
					
					
						commit
						0c178b535c
					
				|  | @ -1 +1 @@ | |||
| 827531393ddfbafcdd89c09f1798772f6f087ba8 | ||||
| 9c2da9436f6a41a244a30deef6f48798f877e909 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import { sortBy } from 'lodash'; | ||||
| import { ListType, NOT_FILTER } from './constants'; | ||||
| import { getIdFromGraphQLId } from '~/graphql_shared/utils'; | ||||
| import { ListType } from './constants'; | ||||
| 
 | ||||
| export function getMilestone() { | ||||
|   return null; | ||||
|  | @ -144,6 +144,17 @@ export function isListDraggable(list) { | |||
|   return list.listType !== ListType.backlog && list.listType !== ListType.closed; | ||||
| } | ||||
| 
 | ||||
| export function transformNotFilters(filters) { | ||||
|   return Object.keys(filters) | ||||
|     .filter((key) => key.startsWith(NOT_FILTER)) | ||||
|     .reduce((obj, key) => { | ||||
|       return { | ||||
|         ...obj, | ||||
|         [key.substring(4, key.length - 1)]: filters[key], | ||||
|       }; | ||||
|     }, {}); | ||||
| } | ||||
| 
 | ||||
| // EE-specific feature. Find the implementation in the `ee/`-folder
 | ||||
| export function transformBoardConfig() { | ||||
|   return ''; | ||||
|  | @ -157,4 +168,5 @@ export default { | |||
|   fullLabelId, | ||||
|   fullIterationId, | ||||
|   isListDraggable, | ||||
|   transformNotFilters, | ||||
| }; | ||||
|  |  | |||
|  | @ -16,6 +16,8 @@ export const inactiveId = 0; | |||
| export const ISSUABLE = 'issuable'; | ||||
| export const LIST = 'list'; | ||||
| 
 | ||||
| export const NOT_FILTER = 'not['; | ||||
| 
 | ||||
| export default { | ||||
|   BoardType, | ||||
|   ListType, | ||||
|  |  | |||
|  | @ -16,6 +16,7 @@ import { | |||
|   formatIssue, | ||||
|   formatIssueInput, | ||||
|   updateListPosition, | ||||
|   transformNotFilters, | ||||
| } from '../boards_util'; | ||||
| import listsIssuesQuery from '../graphql/lists_issues.query.graphql'; | ||||
| import boardLabelsQuery from '../graphql/board_labels.query.graphql'; | ||||
|  | @ -66,6 +67,7 @@ export default { | |||
|       'releaseTag', | ||||
|       'search', | ||||
|     ]); | ||||
|     filterParams.not = transformNotFilters(filters); | ||||
|     commit(types.SET_FILTERS, filterParams); | ||||
|   }, | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ | |||
|       = expanded ? _('Collapse') : _('Expand') | ||||
|     %p | ||||
|       = _("Runners are processes that pick up and execute CI/CD jobs for GitLab.") | ||||
|       = link_to s_('How do I configure runners?'), help_page_path('ci/runners/README') | ||||
|       = link_to s_('How do I configure runners?'), help_page_path('ci/runners/README'), target: '_blank', rel: 'noopener noreferrer' | ||||
|   .settings-content | ||||
|     = render 'groups/runners/index' | ||||
| 
 | ||||
|  |  | |||
|  | @ -41,7 +41,7 @@ | |||
|       = expanded ? _('Collapse') : _('Expand') | ||||
|     %p | ||||
|       = _("Runners are processes that pick up and execute CI/CD jobs for GitLab.") | ||||
|       = link_to s_('How do I configure runners?'), help_page_path('ci/runners/README') | ||||
|       = link_to s_('How do I configure runners?'), help_page_path('ci/runners/README'), target: '_blank', rel: 'noopener noreferrer' | ||||
|   .settings-content | ||||
|     = render 'projects/runners/index' | ||||
| 
 | ||||
|  | @ -83,7 +83,7 @@ | |||
|         = expanded ? _('Collapse') : _('Expand') | ||||
|       %p | ||||
|         = _("Save space and find images in the Container Registry. Remove unneeded tags and keep only the ones you want.") | ||||
|         = link_to _('How does cleanup work?'), help_page_path('user/packages/container_registry/index', anchor: 'cleanup-policy', target: '_blank', rel: 'noopener noreferrer') | ||||
|         = link_to _('How does cleanup work?'), help_page_path('user/packages/container_registry/index', anchor: 'cleanup-policy'), target: '_blank', rel: 'noopener noreferrer' | ||||
|     .settings-content | ||||
|       = render 'projects/registry/settings/index' | ||||
| 
 | ||||
|  |  | |||
|  | @ -0,0 +1,5 @@ | |||
| --- | ||||
| title: Add git_two_factor_session_expiry column to application_settings table | ||||
| merge_request: 52761 | ||||
| author: | ||||
| type: added | ||||
|  | @ -0,0 +1,5 @@ | |||
| --- | ||||
| title: Open CI/CD settings help links in new tab by default | ||||
| merge_request: 52948 | ||||
| author: | ||||
| type: other | ||||
|  | @ -0,0 +1,9 @@ | |||
| # frozen_string_literal: true | ||||
| 
 | ||||
| class AddGitTwoFactorSessionExpiryToApplicationSettings < ActiveRecord::Migration[6.0] | ||||
|   DOWNTIME = false | ||||
| 
 | ||||
|   def change | ||||
|     add_column :application_settings, :git_two_factor_session_expiry, :integer, default: 15, null: false | ||||
|   end | ||||
| end | ||||
|  | @ -0,0 +1 @@ | |||
| 6164ef91c60bd614310cbda6ad8ab1a205cae17c4d037fafa89eaf95d06323e4 | ||||
|  | @ -9411,6 +9411,7 @@ CREATE TABLE application_settings ( | |||
|     invisible_captcha_enabled boolean DEFAULT false NOT NULL, | ||||
|     container_registry_cleanup_tags_service_max_list_size integer DEFAULT 200 NOT NULL, | ||||
|     enforce_ssh_key_expiration boolean DEFAULT false NOT NULL, | ||||
|     git_two_factor_session_expiry integer DEFAULT 15 NOT NULL, | ||||
|     CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), | ||||
|     CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), | ||||
|     CONSTRAINT check_17d9558205 CHECK ((char_length((kroki_url)::text) <= 1024)), | ||||
|  |  | |||
|  | @ -62,3 +62,25 @@ data_source: database | |||
| distribution: [ee, ce] | ||||
| tier: ['free', 'starter', 'premium', 'ultimate', 'bronze', 'silver', 'gold'] | ||||
| ``` | ||||
| 
 | ||||
| ## Create a new metric definition | ||||
| 
 | ||||
| The GitLab codebase provides a dedicated [generator](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/generators/gitlab/usage_metric_definition_generator.rb) to create new metric definitions. | ||||
| 
 | ||||
| The generator takes the key path argument and 2 options and creates the metric YAML definition in corresponding location: | ||||
| 
 | ||||
| - `--ee`, `--no-ee` Indicates if metric is for EE. | ||||
| - `--dir=DIR` indicates the metric directory. It must be one of: `counts_7d`, `7d`, `counts_28d`, `28d`, `counts_all`, `all`, `settings`, `license`. | ||||
| 
 | ||||
| ```shell | ||||
| bundle exec rails generate gitlab:usage_metric_definition counts.issues --dir=7d | ||||
| create  config/metrics/counts_7d/issues.yml | ||||
| ``` | ||||
| 
 | ||||
| NOTE: | ||||
| To create a metric definition used in EE, add the `--ee` flag. | ||||
| 
 | ||||
| ```shell | ||||
| bundle exec rails generate gitlab:usage_metric_definition counts.issues --ee --dir=7d | ||||
| create  ee/config/metrics/counts_7d/issues.yml | ||||
| ``` | ||||
|  |  | |||
|  | @ -32095,6 +32095,9 @@ msgstr "" | |||
| msgid "VulnerabilityChart|Severity" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement, Fetching linked Jira issues" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|%{statusStart}Confirmed%{statusEnd} %{timeago} by %{user}" | ||||
| msgstr "" | ||||
| 
 | ||||
|  | @ -32116,15 +32119,27 @@ msgstr "" | |||
| msgid "VulnerabilityManagement|Could not process %{issueReference}: %{errorMessage}." | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Create Jira issue" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Detected" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Needs triage" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Read more about related issues" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Related Jira issues" | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Something went wrong while trying to delete the comment. Please try again later." | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Something went wrong while trying to fetch related Jira issues. Please check the %{linkStart}Jira integration settings%{linkEnd} and try again." | ||||
| msgstr "" | ||||
| 
 | ||||
| msgid "VulnerabilityManagement|Something went wrong while trying to refresh the vulnerability. Please try again later." | ||||
| msgstr "" | ||||
| 
 | ||||
|  |  | |||
|  | @ -0,0 +1,17 @@ | |||
| import { transformNotFilters } from '~/boards/boards_util'; | ||||
| 
 | ||||
| describe('transformNotFilters', () => { | ||||
|   const filters = { | ||||
|     'not[labelName]': ['label'], | ||||
|     'not[assigneeUsername]': 'assignee', | ||||
|   }; | ||||
| 
 | ||||
|   it('formats not filters, transforms epicId to fullEpicId', () => { | ||||
|     const result = transformNotFilters(filters); | ||||
| 
 | ||||
|     expect(result).toEqual({ | ||||
|       labelName: ['label'], | ||||
|       assigneeUsername: 'assignee', | ||||
|     }); | ||||
|   }); | ||||
| }); | ||||
|  | @ -71,7 +71,7 @@ describe('setFilters', () => { | |||
|       actions.setFilters, | ||||
|       filters, | ||||
|       state, | ||||
|       [{ type: types.SET_FILTERS, payload: filters }], | ||||
|       [{ type: types.SET_FILTERS, payload: { ...filters, not: {} } }], | ||||
|       [], | ||||
|       done, | ||||
|     ); | ||||
|  |  | |||
|  | @ -1687,7 +1687,7 @@ RSpec.describe API::Projects do | |||
|       end | ||||
| 
 | ||||
|       it 'returns a 404 error if not found' do | ||||
|         get api('/projects/42', user) | ||||
|         get api("/projects/#{non_existing_record_id}", user) | ||||
|         expect(response).to have_gitlab_http_status(:not_found) | ||||
|         expect(json_response['message']).to eq('404 Project Not Found') | ||||
|       end | ||||
|  | @ -2048,7 +2048,7 @@ RSpec.describe API::Projects do | |||
|       end | ||||
| 
 | ||||
|       it 'returns a 404 error if not found' do | ||||
|         get api('/projects/42/users', user) | ||||
|         get api("/projects/#{non_existing_record_id}/users", user) | ||||
| 
 | ||||
|         expect(response).to have_gitlab_http_status(:not_found) | ||||
|         expect(json_response['message']).to eq('404 Project Not Found') | ||||
|  | @ -3177,7 +3177,7 @@ RSpec.describe API::Projects do | |||
|       end | ||||
| 
 | ||||
|       it 'fails if project to fork from does not exist' do | ||||
|         post api('/projects/424242/fork', user) | ||||
|         post api("/projects/#{non_existing_record_id}/fork", user) | ||||
| 
 | ||||
|         expect(response).to have_gitlab_http_status(:not_found) | ||||
|         expect(json_response['message']).to eq('404 Project Not Found') | ||||
|  | @ -3211,7 +3211,7 @@ RSpec.describe API::Projects do | |||
|       end | ||||
| 
 | ||||
|       it 'fails if trying to fork to non-existent namespace' do | ||||
|         post api("/projects/#{project.id}/fork", user2), params: { namespace: 42424242 } | ||||
|         post api("/projects/#{project.id}/fork", user2), params: { namespace: non_existing_record_id } | ||||
| 
 | ||||
|         expect(response).to have_gitlab_http_status(:not_found) | ||||
|         expect(json_response['message']).to eq('404 Namespace Not Found') | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue