From 2d7d492beaa232d0384089578e493381e8ee377d Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 20 Nov 2025 11:01:14 +0100 Subject: [PATCH 1/3] New: Add quiet mode to hurl test runner (#36339) - Added `--quiet` or `-q` option to disable informational output - Updated help message to include the new option - Modified print functions to respect quiet mode --- test/hurl/README.md | 12 +++++++++++- test/hurl/run.sh | 22 ++++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/test/hurl/README.md b/test/hurl/README.md index 63ca0a1f21f..64038932d8b 100644 --- a/test/hurl/README.md +++ b/test/hurl/README.md @@ -134,7 +134,7 @@ This will exclude all tests that contain either `setup_modules` or `status` in t ### Verbose Output -You can enable verbose output by providing the `--verbose` or `--very-verbose` option to the `run.sh` script. For example: +You can enable verbose output by providing the `--verbose` (also `-v`) or `--very-verbose` option to the `run.sh` script. For example: ```bash ./run.sh --verbose setup_modules @@ -142,6 +142,16 @@ You can enable verbose output by providing the `--verbose` or `--very-verbose` o This will run all tests that contain `setup_modules` in their name with verbose output. +### Quiet Output + +You can disable part of the informational output by providing the `--quiet` (also `-q`) option to the `run.sh` script. For example: + +```bash +./run.sh --quiet setup_modules +``` + +This will run all tests that contain `setup_modules` in their name with info output disabled. + ## Directory and file structure for hurl tests To avoid ending up with thousands of files in the same directory, we should use directories and possible subdirectories where relevant. diff --git a/test/hurl/run.sh b/test/hurl/run.sh index ca5f6c1be69..3d24725fd99 100755 --- a/test/hurl/run.sh +++ b/test/hurl/run.sh @@ -23,8 +23,9 @@ Options: --apikey=APIKEY Specify the API key for API tests. --suburl=SUBURL Specify the suburl of the Dolibarr server. --exclude=PATTERN Exclude tests that match the specified pattern. - --verbose Verbose hurl output + --verbose | -v Verbose hurl output --very-verbose Very verbose hurl output + --quiet | -q Disable info output --help Display this help message and exit. Test Filters: @@ -42,15 +43,21 @@ Examples: EOHELP } -# Github compatible messages -print_error() { printf "::error::%s\n" "$*" >&2 ; } -print_warning() { printf "::warning::%s\n" "$*" >&2 ; } -print_info() { printf "::notice::%s\n" "$*" >&2 ; } - +if [[ -n "${GITHUB_WORKSPACE}" ]]; then + # Github compatible messages + print_error() { printf "::error::%s\n" "$*" >&2; } + print_warning() { if [[ "${QUIET}" = false ]]; then printf "::warning::%s\n" "$*" >&2 ; fi; } + print_info() { if [[ "${QUIET}" = false ]]; then printf "::notice::%s\n" "$*" >&2 ; fi; } +else + print_error() { printf "ERROR: %s\n" "$*" >&2; } + print_warning() { if [[ "${QUIET}" = false ]]; then printf "WARNING: %s\n" "$*" >&2 ; fi; } + print_info() { if [[ "${QUIET}" = false ]]; then printf "INFO: %s\n" "$*" >&2 ; fi; } +fi # Parse command-line arguments as test filters test_filters=() exclude_patterns=() +QUIET=false for arg in "$@"; do case "$arg" in @@ -84,6 +91,9 @@ for arg in "$@"; do --very-verbose|--verbose|-v) VERBOSE=${arg} ;; + --quiet|-q) + QUIET=true + ;; --help) display_help exit 0 From 6c842a12194df31122bafd04b12f6aacb68888d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Thu, 20 Nov 2025 11:03:08 +0100 Subject: [PATCH 2/3] NEW Allow creating contact via api with ISO code (#36322) * Allow creating contact via api with ISO code Add handling for country code to country ID mapping for api. * use dol_getIdFromCode --------- Co-authored-by: Laurent Destailleur --- htdocs/societe/class/api_contacts.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 6cf53c55c8a..f497704568d 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -343,6 +343,16 @@ class Contacts extends DolibarrApi // Check mandatory fields $result = $this->_validate($request_data); + // External api user does not know internal country ID + if (!isset($request_data['country_id']) && isset($request_data['country_code'])) { + $field = strlen($request_data['country_code']) > 2 ? 'code_iso' : 'code'; + $id = dol_getIdFromCode($this->db, $request_data['country_code'], "c_country", $field, "rowid"); + if ($id < 0) { + throw new RestException(404, 'Country code not found in database: ' . $this->db->error); + } + $request_data['country_id'] = $id; + } + foreach ($request_data as $field => $value) { if ($field === 'caller') { // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller From 01dcb2c4aad90a6bd2eec2b48cf17b50f7981ac3 Mon Sep 17 00:00:00 2001 From: Alain Cis Date: Thu, 20 Nov 2025 12:14:35 +0200 Subject: [PATCH 3/3] [NEW] Add regions for CONGO, THE DEMOCRATIC REPUBLIC OF THE;CD (#36340) --- .../install/mysql/data/llx_10_c_regions.sql | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 3f99d96e3c0..f3de623a7d8 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -233,6 +233,34 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9 -- Colombie Regions (id country=70) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 70, 7001, '', 0, 'Colombie'); +-- Regions DRC (id country=73) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7301, 'Kinshasa', 0, 'Kinshasa', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7302, 'Matadi', 0, 'Kongo Central', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7303, 'Kenge', 0, 'Kwango', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7304, 'Bandundu', 0, 'Kwilu', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7305, 'Inongo', 0, 'Mai-Ndombe', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7306, 'Tshikapa', 0, 'Kasaï', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7307, 'Kananga', 0, 'Kasaï-Central', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7308, 'Mbuji-Mayi', 0, 'Kasaï-Oriental', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7309, 'Kabinda', 0, 'Lomami', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7310, 'Lusambo', 0, 'Sankuru', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7311, 'Kindu', 0, 'Maniema', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7312, 'Bukavu', 0, 'Sud-Kivu', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7313, 'Goma', 0, 'Nord-Kivu', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7314, 'Bunia', 0, 'Ituri', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7315, 'Isiro', 0, 'Haut-Uélé', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7316, 'Buta', 0, 'Bas-Uélé', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7317, 'Kisangani', 0, 'Tshopo', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7318, 'Boende', 0, 'Tshuapa', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7319, 'Mbandaka', 0, 'Équateur', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7320, 'Lisala', 0, 'Mongala', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7321, 'Gbadolite', 0, 'Nord-Ubangi', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7322, 'Gemena', 0, 'Sud-Ubangi', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7323, 'Kamina', 0, 'Haut-Lomami', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7324, 'Kolwezi', 0, 'Lualaba', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7325, 'Lubumbashi', 0, 'Haut-Katanga', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (73, 7326, 'Kalemie', 0, 'Tanganyika', 1); + -- Croatia Regions (id country=76) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 76, 7601, '', 0, 'Središnja');