From 64d80d99a907c9b5ac0d72b6a958916c496e31b1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 29 Apr 2021 06:09:58 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/rules.gitlab-ci.yml | 2 +- .../merge_request_templates/Documentation.md | 6 +- .markdownlint.json | 148 ------------------ .markdownlint.yml | 140 +++++++++++++++++ .overcommit.yml.example | 2 +- .../markdownlint-no-trailing-spaces.yml | 3 + .../documentation/styleguide/index.md | 7 +- doc/development/documentation/testing.md | 10 +- locale/gitlab.pot | 9 ++ package.json | 4 +- .../branch_with_unusual_name_spec.rb | 46 ++++++ .../file/file_with_unusual_name_spec.rb | 47 ++++++ scripts/lint-doc.sh | 2 +- scripts/review_apps/review-apps.sh | 5 +- 14 files changed, 262 insertions(+), 169 deletions(-) delete mode 100644 .markdownlint.json create mode 100644 .markdownlint.yml create mode 100644 doc/.markdownlint/markdownlint-no-trailing-spaces.yml create mode 100644 qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb create mode 100644 qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 23c2dbd7ba3..b8527382876 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -124,7 +124,7 @@ .docs-patterns: &docs-patterns - ".gitlab/route-map.yml" - "doc/**/*" - - ".markdownlint.json" + - ".markdownlint.yml" - "scripts/lint-doc.sh" .frontend-dependency-patterns: &frontend-dependency-patterns diff --git a/.gitlab/merge_request_templates/Documentation.md b/.gitlab/merge_request_templates/Documentation.md index ad00f0edb31..fac84d98141 100644 --- a/.gitlab/merge_request_templates/Documentation.md +++ b/.gitlab/merge_request_templates/Documentation.md @@ -26,9 +26,7 @@ - [ ] [Request a review](https://docs.gitlab.com/ee/development/code_review.html#dogfooding-the-reviewers-feature) from the [designated Technical Writer](https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments). -/label ~"development guidelines" -/label ~"Description templates (.gitlab/\*)" - +/label ~documentation /assign me Do not add the ~"feature", ~"frontend", ~"backend", ~"bug", or ~"database" labels if you are only updating documentation. These labels will cause the MR to be added to code verification QA issues. @@ -74,5 +72,3 @@ For more information, see our documentation on [Merging a merge request](https:/ 1. [ ] Review by assigned maintainer, who can always request/require the above reviews. Maintainer's review can occur before or after a technical writer review. 1. [ ] Ensure a release milestone is set. 1. [ ] If there has not been a technical writer review, [create an issue for one using the Doc Review template](https://gitlab.com/gitlab-org/gitlab/issues/new?issuable_template=Doc%20Review). - -/label ~documentation diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index e548e03fe28..00000000000 --- a/.markdownlint.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "default": true, - "first-header-h1": true, - "header-style": { - "style": "atx" - }, - "ul-style": { - "style": "dash" - }, - "no-trailing-spaces": false, - "line-length": false, - "no-duplicate-header": { - "allow_different_nesting": true - }, - "no-trailing-punctuation": { - "punctuation": ".,;:!。,;:!?" - }, - "ol-prefix": { - "style": "one" - }, - "no-inline-html": false, - "hr-style": { - "style": "---" - }, - "no-emphasis-as-heading": false, - "first-line-h1": false, - "code-block-style": { - "style": "fenced" - }, - "proper-names": { - "names": [ - "Akismet", - "Alertmanager", - "API", - "Asana", - "Auth0", - "Authentiq", - "Azure", - "Bamboo", - "Bitbucket", - "Bugzilla", - "CAS", - "CentOS", - "Consul", - "Debian", - "DevOps", - "Docker", - "DockerSlim", - "Elasticsearch", - "Facebook", - "fastlane", - "fluent-plugin-redis-slowlog", - "GDK", - "Geo", - "Git LFS", - "git-annex", - "Git", - "Gitaly", - "GitHub", - "GitLab Geo", - "GitLab Monitor", - "GitLab Operator", - "GitLab Pages", - "GitLab Rails", - "GitLab Runner", - "GitLab Shell", - "GitLab Workhorse", - "GitLab", - "Gitleaks", - "Gmail", - "Google", - "Grafana", - "Gzip", - "Helm", - "HipChat", - "ID", - "Ingress", - "jasmine-jquery", - "JavaScript", - "Jaeger", - "Jenkins", - "Jira", - "Jira Cloud", - "Jira Server", - "jQuery", - "JSON", - "JupyterHub", - "Karma", - "Kerberos", - "Knative", - "Kubernetes", - "LDAP", - "Let's Encrypt", - "Markdown", - "markdownlint", - "Mattermost", - "Microsoft", - "Minikube", - "MinIO", - "ModSecurity", - "NGINX Ingress", - "NGINX", - "OAuth", - "OAuth 2", - "OmniAuth", - "Omnibus GitLab", - "OpenID", - "OpenShift", - "PgBouncer", - "PostgreSQL", - "Praefect", - "Prometheus", - "Puma", - "puma-worker-killer", - "Python", - "Rake", - "Redis", - "Redmine", - "reCAPTCHA", - "Ruby", - "runit", - "Salesforce", - "SAML", - "Sentry", - "Sidekiq", - "Shibboleth", - "Slack", - "SMTP", - "SpotBugs", - "SSH", - "Tiller", - "TOML", - "Trello", - "Trello Power-Ups", - "TypeScript", - "Twitter", - "Ubuntu", - "Ultra Auth", - "Unicorn", - "unicorn-worker-killer", - "URL", - "WebdriverIO", - "YAML", - "YouTrack" - ], - "code_blocks": false - } -} diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 00000000000..ccf2ef02eee --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,140 @@ +# Base Markdownlint configuration +# Extended Markdownlint configuration in doc/.markdownlint/ +"default": true +"first-header-h1": true +"header-style": + "style": "atx" +"ul-style": + "style": "dash" +"no-trailing-spaces": false +"line-length": false +"no-duplicate-header": + "allow_different_nesting": true +"no-trailing-punctuation": + "punctuation": ".,;:!。,;:!?" +"ol-prefix": + "style": "one" +"no-inline-html": false +"hr-style": + "style": "---" +"no-emphasis-as-heading": false +"first-line-h1": false +"code-block-style": + "style": "fenced" +"proper-names": + "names": [ + "Akismet", + "Alertmanager", + "API", + "Asana", + "Auth0", + "Authentiq", + "Azure", + "Bamboo", + "Bitbucket", + "Bugzilla", + "CAS", + "CentOS", + "Consul", + "Debian", + "DevOps", + "Docker", + "DockerSlim", + "Elasticsearch", + "Facebook", + "fastlane", + "fluent-plugin-redis-slowlog", + "GDK", + "Geo", + "Git LFS", + "git-annex", + "Git", + "Gitaly", + "GitHub", + "GitLab Geo", + "GitLab Monitor", + "GitLab Operator", + "GitLab Pages", + "GitLab Rails", + "GitLab Runner", + "GitLab Shell", + "GitLab Workhorse", + "GitLab", + "Gitleaks", + "Gmail", + "Google", + "Grafana", + "Gzip", + "Helm", + "HipChat", + "ID", + "Ingress", + "jasmine-jquery", + "JavaScript", + "Jaeger", + "Jenkins", + "Jira", + "Jira Cloud", + "Jira Server", + "jQuery", + "JSON", + "JupyterHub", + "Karma", + "Kerberos", + "Knative", + "Kubernetes", + "LDAP", + "Let's Encrypt", + "Markdown", + "markdownlint", + "Mattermost", + "Microsoft", + "Minikube", + "MinIO", + "ModSecurity", + "NGINX Ingress", + "NGINX", + "OAuth", + "OAuth 2", + "OmniAuth", + "Omnibus GitLab", + "OpenID", + "OpenShift", + "PgBouncer", + "PostgreSQL", + "Praefect", + "Prometheus", + "Puma", + "puma-worker-killer", + "Python", + "Rake", + "Redis", + "Redmine", + "reCAPTCHA", + "Ruby", + "runit", + "Salesforce", + "SAML", + "Sentry", + "Sidekiq", + "Shibboleth", + "Slack", + "SMTP", + "SpotBugs", + "SSH", + "Tiller", + "TOML", + "Trello", + "Trello Power-Ups", + "TypeScript", + "Twitter", + "Ubuntu", + "Ultra Auth", + "Unicorn", + "unicorn-worker-killer", + "URL", + "WebdriverIO", + "YAML", + "YouTrack" + ] + "code_blocks": false diff --git a/.overcommit.yml.example b/.overcommit.yml.example index e0f55dd4a14..c1c2395ca93 100644 --- a/.overcommit.yml.example +++ b/.overcommit.yml.example @@ -48,7 +48,7 @@ PreCommit: enabled: true description: 'Lint documentation for Markdown errors' required_executable: 'node_modules/.bin/markdownlint' - flags: ['--config', '.markdownlint.json', 'doc/**/*.md'] + flags: ['--config', '.markdownlint.yml', 'doc/**/*.md'] install_command: 'yarn install' include: - 'doc/**/*.md' diff --git a/doc/.markdownlint/markdownlint-no-trailing-spaces.yml b/doc/.markdownlint/markdownlint-no-trailing-spaces.yml new file mode 100644 index 00000000000..3d107a3e667 --- /dev/null +++ b/doc/.markdownlint/markdownlint-no-trailing-spaces.yml @@ -0,0 +1,3 @@ +# Extended Markdown configuration to enforce no-trailing-spaces rule +"extends": "../../.markdownlint.yml" +"no-trailing-spaces": true diff --git a/doc/development/documentation/styleguide/index.md b/doc/development/documentation/styleguide/index.md index 912a046c2c0..0ac393a8509 100644 --- a/doc/development/documentation/styleguide/index.md +++ b/doc/development/documentation/styleguide/index.md @@ -164,13 +164,12 @@ standard for GitLab documentation). A rule that could cause confusion is `MD044/proper-names`, as it might not be immediately clear what caused markdownlint to fail, or how to correct the -failure. This rule checks a list of known words, listed in the `.markdownlint.json` +failure. This rule checks a list of known words, listed in the `.markdownlint.yml` file in each project, to verify proper use of capitalization and backticks. Words in backticks are ignored by markdownlint. In general, product names should follow the exact capitalization of the official -names of the products, protocols, and so on. See [`.markdownlint.json`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.markdownlint.json) -for the words tested for proper capitalization in GitLab documentation. +names of the products, protocols, and so on. Some examples fail if incorrect capitalization is used: @@ -370,7 +369,7 @@ Capitalize names of: - Third-party organizations, software, and products. For example, Prometheus, Kubernetes, Git, and The Linux Foundation. - Methods or methodologies. For example, Continuous Integration, - Continuous Deployment, Scrum, and Agile. (Tested in [`.markdownlint.json`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.markdownlint.json).) + Continuous Deployment, Scrum, and Agile. Follow the capitalization style listed at the [authoritative source](#links-to-external-documentation) for the entity, which may use non-standard case styles. For example: GitLab and diff --git a/doc/development/documentation/testing.md b/doc/development/documentation/testing.md index 980e77d93ed..af95f3b9023 100644 --- a/doc/development/documentation/testing.md +++ b/doc/development/documentation/testing.md @@ -150,11 +150,11 @@ from those guidelines. markdownlint configuration is found in the following projects: -- [`gitlab`](https://gitlab.com/gitlab-org/gitlab/blob/master/.markdownlint.json) -- [`gitlab-runner`](https://gitlab.com/gitlab-org/gitlab-runner/blob/master/.markdownlint.json) -- [`omnibus-gitlab`](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/.markdownlint.json) -- [`charts`](https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/.markdownlint.json) -- [`gitlab-development-kit`](https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/.markdownlint.json) +- [`gitlab`](https://gitlab.com/gitlab-org/gitlab) +- [`gitlab-runner`](https://gitlab.com/gitlab-org/gitlab-runner) +- [`omnibus-gitlab`](https://gitlab.com/gitlab-org/omnibus-gitlab) +- [`charts`](https://gitlab.com/gitlab-org/charts/gitlab) +- [`gitlab-development-kit`](https://gitlab.com/gitlab-org/gitlab-development-kit) This configuration is also used in build pipelines. diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 30dbf636194..20f631e5d97 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -5043,12 +5043,18 @@ msgstr "" msgid "Billing|An email address is only visible for users with public emails." msgstr "" +msgid "Billing|An error occurred while getting a billable member details" +msgstr "" + msgid "Billing|An error occurred while loading billable members list" msgstr "" msgid "Billing|An error occurred while removing a billable member" msgstr "" +msgid "Billing|Direct memberships" +msgstr "" + msgid "Billing|Enter at least three characters to search." msgstr "" @@ -5064,6 +5070,9 @@ msgstr "" msgid "Billing|Remove user %{username} from your subscription" msgstr "" +msgid "Billing|Toggle seat details" +msgstr "" + msgid "Billing|Type %{username} to confirm" msgstr "" diff --git a/package.json b/package.json index d3c463c3b03..7f2d7fb342e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,9 @@ "lint:stylelint:fix": "yarn run lint:stylelint --fix", "lint:stylelint:staged": "scripts/frontend/execute-on-staged-files.sh stylelint '(css|scss)' -q", "lint:stylelint:staged:fix": "yarn run lint:stylelint:staged --fix", - "markdownlint": "markdownlint --config .markdownlint.json", + "markdownlint": "markdownlint --config .markdownlint.yml", + "markdownlint:no-trailing-spaces": "markdownlint --config doc/.markdownlint/markdownlint-no-trailing-spaces.yml", + "markdownlint:no-trailing-spaces:fix": "yarn run markdownlint:no-trailing-spaces --fix", "postinstall": "node ./scripts/frontend/postinstall.js", "stylelint-create-utility-map": "node scripts/frontend/stylelint/stylelint-utility-map.js", "webpack": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.config.js", diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb new file mode 100644 index 00000000000..db31cadb37d --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + describe 'Branch with unusual name' do + let(:branch_name) { 'unUsually/named#br--anch' } + let(:project) do + Resource::Project.fabricate_via_api! do |resource| + resource.name = 'unusually-named-branch-project' + resource.initialize_with_readme = true + end + end + + before do + Flow::Login.sign_in + end + + context 'when branch name contains slash, hash, double dash, and capital letter' do + it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1780' do + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.branch = branch_name + commit.start_branch = project.default_branch + commit.commit_message = 'Add new file' + commit.add_files([ + { file_path: 'test-folder/test-file.md', content: 'new content' } + ]) + end + + project.visit! + + Page::Project::Show.perform do |show| + show.switch_to_branch(branch_name) + show.click_file('test-folder') + + expect(show).to have_file('test-file.md') + + show.click_file('test-file.md') + + expect(show).to have_content('new content') + end + end + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb new file mode 100644 index 00000000000..98d0a3c5706 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + describe 'File with unusual name' do + let(:file_name) { '-un:usually;named#file?.md' } + let(:project) do + Resource::Project.fabricate_via_api! do |resource| + resource.name = 'unusually-named-file-project' + resource.initialize_with_readme = true + end + end + + before do + Flow::Login.sign_in + end + + context 'when file name starts with a dash and contains hash, semicolon, colon, and question mark' do + it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1779' do + Resource::File.fabricate_via_api! do |file| + file.project = project + file.commit_message = 'Add new file' + file.name = "test-folder/#{file_name}" + file.content = "### Heading\n\n[Gitlab link](https://gitlab.com/)" + end + + project.visit! + + Page::Project::Show.perform do |show| + show.click_file('test-folder') + + expect(show).to have_file(file_name) + + show.click_file(file_name) + + aggregate_failures 'markdown file contents' do + expect(show).to have_content('Heading') + expect(show).to have_content('Gitlab link') + expect(show).not_to have_content('###') + expect(show).not_to have_content('https://gitlab.com/') + end + end + end + end + end + end +end diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh index 4d0c1ba99d2..2abbf3d60df 100755 --- a/scripts/lint-doc.sh +++ b/scripts/lint-doc.sh @@ -137,7 +137,7 @@ if [ -z "${MD_DOC_PATH}" ] then echo "Merged results pipeline detected, but no markdown files found. Skipping." else - run_locally_or_in_docker 'markdownlint' "--config .markdownlint.json ${MD_DOC_PATH}" + run_locally_or_in_docker 'markdownlint' "--config .markdownlint.yml ${MD_DOC_PATH}" fi echo '=> Linting prose...' diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh index 79f156b5795..ebb1405ff4e 100755 --- a/scripts/review_apps/review-apps.sh +++ b/scripts/review_apps/review-apps.sh @@ -281,13 +281,12 @@ function download_chart() { curl --location -o gitlab.tar.bz2 "https://gitlab.com/gitlab-org/charts/gitlab/-/archive/${GITLAB_HELM_CHART_REF}/gitlab-${GITLAB_HELM_CHART_REF}.tar.bz2" tar -xjf gitlab.tar.bz2 - cd "gitlab-${GITLAB_HELM_CHART_REF}" echoinfo "Adding the gitlab repo to Helm..." helm repo add gitlab https://charts.gitlab.io echoinfo "Building the gitlab chart's dependencies..." - helm dependency build . + helm dependency build "gitlab-${GITLAB_HELM_CHART_REF}" } function base_config_changed() { @@ -372,7 +371,7 @@ HELM_CMD=$(cat << EOF ${HELM_CMD} \ --version="${CI_PIPELINE_ID}-${CI_JOB_ID}" \ -f "${base_config_file}" \ - "${release}" . + "${release}" "gitlab-${GITLAB_HELM_CHART_REF}" EOF )