From dd291074126424667e12b00e5f109fdf8d4c5e5a Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 20 Feb 2024 14:37:02 +0100 Subject: [PATCH 1/4] Support service ID with special character in the validation CLI --- scripts/declarations/utils/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/declarations/utils/index.js b/scripts/declarations/utils/index.js index 0225bf440..da382e928 100644 --- a/scripts/declarations/utils/index.js +++ b/scripts/declarations/utils/index.js @@ -20,9 +20,9 @@ export default class DeclarationUtils { } async getModifiedData() { - const modifiedFilePathsAsString = (await this.git.diff([ '--diff-filter=d', '--name-only', this.defaultBranch, 'HEAD', '--', './declarations' ])).trim(); + const modifiedFilePathsAsString = (await this.git.diff([ '-z', '--diff-filter=d', '--name-only', this.defaultBranch, 'HEAD', '--', './declarations' ])).trim(); // -z option is required to avoid pathnames with "unusual" characters to be quoted, but it also replace result separator by the zero byte character \0 - const modifiedFilePaths = modifiedFilePathsAsString ? modifiedFilePathsAsString.split('\n') : []; + const modifiedFilePaths = (modifiedFilePathsAsString ? modifiedFilePathsAsString.split('\0') : []).filter(str => str !== ''); // split on \0 rather than \n due to the -z option of git diff return { modifiedFilePaths, modifiedServicesIds: Array.from(new Set(modifiedFilePaths.map(DeclarationUtils.filePathToServiceId))) }; } From 987c37728809f0db418c252dd1141f5409ff03c1 Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 20 Feb 2024 14:37:08 +0100 Subject: [PATCH 2/4] Add changelog entry --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7432358cd..1b538e2ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,15 @@ All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## Unreleased [patch] + +_Full changeset and discussions: [#1055](https://github.com/OpenTermsArchive/engine/pull/1055)._ + +> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs. + +### Fixed + +- Fix support of service names with special character in the validation CLI ## 0.37.0 - 2024-02-20 From a53666fa589bb37496b6b288408bfb6506ff45fc Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 20 Feb 2024 14:44:08 +0100 Subject: [PATCH 3/4] Fix changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b538e2ad..d2e6c7a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All changes that impact users of this module are documented in this file, in the ## Unreleased [patch] -_Full changeset and discussions: [#1055](https://github.com/OpenTermsArchive/engine/pull/1055)._ +_Full changeset and discussions: [#1056](https://github.com/OpenTermsArchive/engine/pull/1056)._ > Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs. From 047986dbc2b6618ac7854e0ee9d9cc50a28973b7 Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 20 Feb 2024 14:45:45 +0100 Subject: [PATCH 4/4] Fix typo --- scripts/declarations/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/declarations/utils/index.js b/scripts/declarations/utils/index.js index da382e928..df677a19d 100644 --- a/scripts/declarations/utils/index.js +++ b/scripts/declarations/utils/index.js @@ -20,7 +20,7 @@ export default class DeclarationUtils { } async getModifiedData() { - const modifiedFilePathsAsString = (await this.git.diff([ '-z', '--diff-filter=d', '--name-only', this.defaultBranch, 'HEAD', '--', './declarations' ])).trim(); // -z option is required to avoid pathnames with "unusual" characters to be quoted, but it also replace result separator by the zero byte character \0 + const modifiedFilePathsAsString = (await this.git.diff([ '-z', '--diff-filter=d', '--name-only', this.defaultBranch, 'HEAD', '--', './declarations' ])).trim(); // -z option is required to avoid pathnames with "unusual" characters to be quoted, but it also replaces result separator by the zero byte character \0 const modifiedFilePaths = (modifiedFilePathsAsString ? modifiedFilePathsAsString.split('\0') : []).filter(str => str !== ''); // split on \0 rather than \n due to the -z option of git diff