diff --git a/ee/app/assets/javascripts/blob/constants.js b/ee/app/assets/javascripts/blob/constants.js index 72522728e2f1ccba6bcc75882345597fea53dff9..d93d0e16b78eb47624ecfa8dc881849e5ed7bbcd 100644 --- a/ee/app/assets/javascripts/blob/constants.js +++ b/ee/app/assets/javascripts/blob/constants.js @@ -24,7 +24,7 @@ export const ERROR_MESSAGE = s__( 'CodeownersValidation|An error occurred while loading the validation errors. Please try again later.', ); -export const DOCS_URL = `${DOCS_URL_IN_EE_DIR}/user/project/codeowners/reference.html#error-handling-in-code-owners`; +export const DOCS_URL = `${DOCS_URL_IN_EE_DIR}/user/project/codeowners/advanced.html#error-handling`; export const CODEOWNERS_VALIDATION_I18N = { syntaxValid: SYNTAX_VALID, @@ -40,6 +40,8 @@ export const INVALID_SECTION_OWNER_FORMAT = s__('CodeownersValidation|Inaccessib export const MISSING_ENTRY_OWNER = s__('CodeownersValidation|Zero owners'); +export const MALFORMED_ENTRY_OWNER = s__('CodeownersValidation|Malformed owners'); + export const INVALID_ENTRY_OWNER_FORMAT = s__('CodeownersValidation|Entries with spaces'); export const MISSING_SECTION_NAME = s__('CodeownersValidation|Missing section name'); @@ -53,6 +55,7 @@ export const INVALID_SECTION_FORMAT = s__('CodeownersValidation|Unparsable secti export const CODE_TO_MESSAGE = { invalid_section_owner_format: INVALID_SECTION_OWNER_FORMAT, missing_entry_owner: MISSING_ENTRY_OWNER, + malformed_entry_owner: MALFORMED_ENTRY_OWNER, invalid_entry_owner_format: INVALID_ENTRY_OWNER_FORMAT, missing_section_name: MISSING_SECTION_NAME, invalid_approval_requirement: INVALID_APPROVAL_REQUIREMENT, diff --git a/ee/lib/gitlab/code_owners/error.rb b/ee/lib/gitlab/code_owners/error.rb index a2392ac57a2e520c806b9c25b62e2823d06717bb..1ba7ed311e3cc8f5d1b74e41aa1da7999dd52f10 100644 --- a/ee/lib/gitlab/code_owners/error.rb +++ b/ee/lib/gitlab/code_owners/error.rb @@ -5,6 +5,7 @@ module CodeOwners class Error INVALID_SECTION_OWNER_FORMAT = :invalid_section_owner_format MISSING_ENTRY_OWNER = :missing_entry_owner + MALFORMED_ENTRY_OWNER = :malformed_entry_owner INVALID_ENTRY_OWNER_FORMAT = :invalid_entry_owner_format MISSING_SECTION_NAME = :missing_section_name INVALID_APPROVAL_REQUIREMENT = :invalid_approval_requirement diff --git a/ee/spec/frontend/blob/components/codeowners_validation_spec.js b/ee/spec/frontend/blob/components/codeowners_validation_spec.js index e7e70e26bc4ec760cf1ad029421fa03033a1cbe9..02600f087621509c93e1ed3312dcc16c1ed338d4 100644 --- a/ee/spec/frontend/blob/components/codeowners_validation_spec.js +++ b/ee/spec/frontend/blob/components/codeowners_validation_spec.js @@ -115,7 +115,7 @@ describe('codeowners validation', () => { it('renders links to line with error', () => { const firstErrorLink = linksToErrors().at(0); - expect(linksToErrors()).toHaveLength(6); + expect(linksToErrors()).toHaveLength(7); expect(firstErrorLink.text()).toBe('Line 2'); expect(firstErrorLink.attributes('href')).toBe('#L2'); }); diff --git a/ee/spec/frontend/blob/mock_data.js b/ee/spec/frontend/blob/mock_data.js index 5cfd1b2114ddb8951c76072f63617425c24bf34d..034f4e05d0fd5500598539371302f92fc103a6a4 100644 --- a/ee/spec/frontend/blob/mock_data.js +++ b/ee/spec/frontend/blob/mock_data.js @@ -17,6 +17,11 @@ export const validateCodeownerFile = { lines: [5, 6], __typename: 'RepositoryCodeownerError', }, + { + code: 'malformed_entry_owner', + lines: [9], + __typename: 'RepositoryCodeownerError', + }, { code: 'invalid_section_format', lines: [36], diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 25a923410a9323fc4044238f996bc734dc99ab29..2c5b535f0347fc634fa5f1cdedd85b7b8f8142bb 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -13954,6 +13954,9 @@ msgstr "" msgid "CodeownersValidation|Line" msgstr "" +msgid "CodeownersValidation|Malformed owners" +msgstr "" + msgid "CodeownersValidation|Missing section name" msgstr ""