From 3fba557d5c310e1fc4e6866a6a342c40331b3ad2 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 27 Sep 2017 09:52:03 +0100 Subject: [PATCH 1/5] Add static analysis job to find invalid YAML in changelogs When a changelog has invalid YAML (typically, there is an unquoted @ at the start of the author field), then the entry will be discarded. This script checks all unreleased changelogs for validity, and runs as part of the static-analysis step, so the pipeline will fail if this happens in future. --- changelogs/unreleased/lint-changelog-yaml.yml | 5 +++++ scripts/lint-changelog-yaml | 19 +++++++++++++++++++ scripts/static-analysis | 3 ++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/lint-changelog-yaml.yml create mode 100755 scripts/lint-changelog-yaml diff --git a/changelogs/unreleased/lint-changelog-yaml.yml b/changelogs/unreleased/lint-changelog-yaml.yml new file mode 100644 index 00000000000..dcc8bf54827 --- /dev/null +++ b/changelogs/unreleased/lint-changelog-yaml.yml @@ -0,0 +1,5 @@ +--- +title: Detect when changelog entries are invalid +merge_request: +author: +type: other diff --git a/scripts/lint-changelog-yaml b/scripts/lint-changelog-yaml new file mode 100755 index 00000000000..402a0c42bd3 --- /dev/null +++ b/scripts/lint-changelog-yaml @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +require 'yaml' + +invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog| + begin + YAML.load_file(changelog) + rescue + end +end + +if invalid_changelogs.any? + puts "Changelogs with invalid YAML found!\n" + puts invalid_changelogs.sort + exit 1 +else + puts "All changelogs are valid YAML.\n" + exit 0 +end diff --git a/scripts/static-analysis b/scripts/static-analysis index 295b6f132c1..aeefb2bc96f 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -13,7 +13,8 @@ tasks = [ %w[yarn run eslint], %w[bundle exec rubocop --require rubocop-rspec], %w[scripts/lint-conflicts.sh], - %w[bundle exec rake gettext:lint] + %w[bundle exec rake gettext:lint], + %w[scripts/lint-changelog-yaml] ] failed_tasks = tasks.reduce({}) do |failures, task| From 2d64c8211ab82a0fd60907cd3046b6ae72e616d0 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 27 Sep 2017 09:59:25 +0100 Subject: [PATCH 2/5] Manually add CHANGELOG entry for !13325 This was discarded from the initial compilation because it had invalid YAML. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c671f8d53a..9f3bc4a1212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,8 @@ entry. - [FIXED] Fixed merge request changes bar jumping. - [FIXED] Improve migrations using triggers. - [FIXED] Fix ConvDev Index nav item and Monitoring submenu regression. +- [FIXED] disabling notifications globally now properly turns off group/project added + emails !13325 - [DEPRECATED] Deprecate custom SSH client configuration for the git user. !13930 - [CHANGED] allow all users to delete their account. !13636 (Jacopo Beschi @jacopo-beschi) - [CHANGED] Use full path of project's avatar in webhooks. !13649 (Vitaliy @blackst0ne Klachkov) From f984d35f1cd9407f33a6be2d5be8d8ad4be790dd Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 27 Sep 2017 10:01:34 +0100 Subject: [PATCH 3/5] Fix invalid changelog entries --- changelogs/unreleased/13711-allow-same-period-housekeeping.yml | 2 +- .../36953-add-gitLab-pages-version-to-admin-dashboard.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelogs/unreleased/13711-allow-same-period-housekeeping.yml b/changelogs/unreleased/13711-allow-same-period-housekeeping.yml index 6749e22cf6a..607a8683aff 100644 --- a/changelogs/unreleased/13711-allow-same-period-housekeeping.yml +++ b/changelogs/unreleased/13711-allow-same-period-housekeeping.yml @@ -2,5 +2,5 @@ title: Allow to use same periods for different housekeeping tasks (effectively skipping the lesser task) merge_request: 13711 -author: @cernvcs +author: cernvcs type: added diff --git a/changelogs/unreleased/36953-add-gitLab-pages-version-to-admin-dashboard.yml b/changelogs/unreleased/36953-add-gitLab-pages-version-to-admin-dashboard.yml index 680ef0cef92..9ac4a0ae7f3 100644 --- a/changelogs/unreleased/36953-add-gitLab-pages-version-to-admin-dashboard.yml +++ b/changelogs/unreleased/36953-add-gitLab-pages-version-to-admin-dashboard.yml @@ -1,5 +1,5 @@ --- title: Add GitLab-Pages version to Admin Dashboard merge_request: 14040 -author: @travismiller +author: travismiller type: added From e73c9ddc9e7c3191e5d16e7c42fb39867b38862b Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 29 Sep 2017 15:24:16 +0100 Subject: [PATCH 4/5] Extend changelog checker to test file extensions Changelogs without a .yml extension won't be picked up, and will be ignored completely, so fail the pipeline when one of those is found. --- scripts/lint-changelog-yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/lint-changelog-yaml b/scripts/lint-changelog-yaml index 402a0c42bd3..cce5f1c7667 100755 --- a/scripts/lint-changelog-yaml +++ b/scripts/lint-changelog-yaml @@ -2,7 +2,10 @@ require 'yaml' -invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog| +invalid_changelogs = Dir['changelogs/**/*'].reject do |changelog| + next true if changelog =~ /(archive\.md|unreleased(-ee)?)$/ + next false unless changelog.end_with?('.yml') + begin YAML.load_file(changelog) rescue @@ -10,7 +13,7 @@ invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog| end if invalid_changelogs.any? - puts "Changelogs with invalid YAML found!\n" + puts "Invalid changelogs found!\n" puts invalid_changelogs.sort exit 1 else From 1bb332ceb3643f7b129eb3674d1de3c402bbf2cb Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 29 Sep 2017 15:32:01 +0100 Subject: [PATCH 5/5] Remove changelogs with invalid extensions All of these were in past releases, so missed their chance to be included in the main changelog :-( --- changelogs/unreleased/12673-fix_v3_project_hooks_build_events | 4 ---- .../12892-reset-css-text-align-to-initial-for-rtl.md | 4 ---- ...9-add-an-email-address-to-unsubscribe-list-header-in-email | 4 ---- changelogs/unreleased/26908-make-timelogs-use-foreign-keys | 4 ---- changelogs/unreleased/32340-correct-jobs-api-documentation | 4 ---- changelogs/unreleased/35942-api-binary-encoding.yaml | 3 --- ...ock-deployment-and-monitoring-service-for-development.yaml | 4 ---- changelogs/unreleased/repository-name-emojis | 4 ---- 8 files changed, 31 deletions(-) delete mode 100644 changelogs/unreleased/12673-fix_v3_project_hooks_build_events delete mode 100644 changelogs/unreleased/12892-reset-css-text-align-to-initial-for-rtl.md delete mode 100644 changelogs/unreleased/22619-add-an-email-address-to-unsubscribe-list-header-in-email delete mode 100644 changelogs/unreleased/26908-make-timelogs-use-foreign-keys delete mode 100644 changelogs/unreleased/32340-correct-jobs-api-documentation delete mode 100644 changelogs/unreleased/35942-api-binary-encoding.yaml delete mode 100644 changelogs/unreleased/add-mock-deployment-and-monitoring-service-for-development.yaml delete mode 100644 changelogs/unreleased/repository-name-emojis diff --git a/changelogs/unreleased/12673-fix_v3_project_hooks_build_events b/changelogs/unreleased/12673-fix_v3_project_hooks_build_events deleted file mode 100644 index 59bc646406f..00000000000 --- a/changelogs/unreleased/12673-fix_v3_project_hooks_build_events +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: "Fix v3 api project_hooks POST and PUT operations for build_events" -merge_request: 12673 -author: Richard Clamp diff --git a/changelogs/unreleased/12892-reset-css-text-align-to-initial-for-rtl.md b/changelogs/unreleased/12892-reset-css-text-align-to-initial-for-rtl.md deleted file mode 100644 index 87e95240bba..00000000000 --- a/changelogs/unreleased/12892-reset-css-text-align-to-initial-for-rtl.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: "reset text-align to initial to let elements with dir="auto" align texts to right in RTL languages ( default is left )" -merge_request: 12892 -author: goshhob diff --git a/changelogs/unreleased/22619-add-an-email-address-to-unsubscribe-list-header-in-email b/changelogs/unreleased/22619-add-an-email-address-to-unsubscribe-list-header-in-email deleted file mode 100644 index f4011b756a5..00000000000 --- a/changelogs/unreleased/22619-add-an-email-address-to-unsubscribe-list-header-in-email +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Handle unsubscribe from email notifications via replying to reply+%{key}+unsubscribe@ address -merge_request: 6597 -author: diff --git a/changelogs/unreleased/26908-make-timelogs-use-foreign-keys b/changelogs/unreleased/26908-make-timelogs-use-foreign-keys deleted file mode 100644 index 0e8f7093b34..00000000000 --- a/changelogs/unreleased/26908-make-timelogs-use-foreign-keys +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Refactor Timelogs structure to use foreign keys. -merge_request: 8769 -author: diff --git a/changelogs/unreleased/32340-correct-jobs-api-documentation b/changelogs/unreleased/32340-correct-jobs-api-documentation deleted file mode 100644 index 4ada62356eb..00000000000 --- a/changelogs/unreleased/32340-correct-jobs-api-documentation +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: "Correction to documention for manual steps on the Jobs API" -merge_request: 11411 -author: Zac Sturgess \ No newline at end of file diff --git a/changelogs/unreleased/35942-api-binary-encoding.yaml b/changelogs/unreleased/35942-api-binary-encoding.yaml deleted file mode 100644 index 4f7960d860e..00000000000 --- a/changelogs/unreleased/35942-api-binary-encoding.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: "Fix API to serve binary diffs that are treated as text." -merge_request: 14038 diff --git a/changelogs/unreleased/add-mock-deployment-and-monitoring-service-for-development.yaml b/changelogs/unreleased/add-mock-deployment-and-monitoring-service-for-development.yaml deleted file mode 100644 index 4c81d21a94b..00000000000 --- a/changelogs/unreleased/add-mock-deployment-and-monitoring-service-for-development.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Added mock deployment and monitoring service with environments fixtures -merge_request: -author: diff --git a/changelogs/unreleased/repository-name-emojis b/changelogs/unreleased/repository-name-emojis deleted file mode 100644 index fe52df8eedc..00000000000 --- a/changelogs/unreleased/repository-name-emojis +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Added ability to put emojis into repository name -merge_request: 7420 -author: Vincent Composieux