From 0677ac1c59a08bea0cc0fd055dd76b7bab64c991 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Wed, 2 Jul 2025 22:44:55 +0200 Subject: [PATCH 1/3] Add code_quality section, both to CI and Makefile --- .../workflows/MainDistributionPipeline.yml | 9 +++++++++ Makefile | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index b06d213..918b296 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -33,3 +33,12 @@ jobs: ci_tools_version: main deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }} exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads' + + code-quality: + name: Code Quality + uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@main + with: + extension_name: httpfs + duckdb_version: v1.3-ossivalis + ci_tools_version: main + extra_toolchains: 'python3' diff --git a/Makefile b/Makefile index c7db037..ff93844 100644 --- a/Makefile +++ b/Makefile @@ -8,3 +8,23 @@ CORE_EXTENSIONS='' # Include the Makefile from extension-ci-tools include extension-ci-tools/makefiles/duckdb_extension.Makefile + +#### Misc +format-check: + python3 duckdb/scripts/format.py --all --check --directories extension/httpfs test + +format: + python3 duckdb/scripts/format.py --all --fix --noconfirm --directories extension/httpfs test + +format-fix: + python3 duckdb/scripts/format.py --all --fix --noconfirm --directories extension/httpfs test + +format-main: + python3 duckdb/scripts/format.py main --fix --noconfirm --directories extension/httpfs test + +tidy-check: + mkdir -p ./build/tidy + cmake $(GENERATOR) $(BUILD_FLAGS) $(EXT_DEBUG_FLAGS) -DDISABLE_UNITY=1 -DCLANG_TIDY=1 -S $(DUCKDB_SRCDIR) -B build/tidy + cp duckdb/.clang-tidy build/tidy/.clang-tidy + cd build/tidy && python3 ../../duckdb/scripts/run-clang-tidy.py '$(PROJ_DIR)extension/httpfs/' -header-filter '$(PROJ_DIR)extension/httpfs/' -quiet ${TIDY_THREAD_PARAMETER} ${TIDY_BINARY_PARAMETER} ${TIDY_PERFORM_CHECKS} + From 3c2f58b4b25360348c7dc627f38d5654e974c10d Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Thu, 3 Jul 2025 08:57:50 +0200 Subject: [PATCH 2/3] Explicit which checks are performed --- .github/workflows/MainDistributionPipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 918b296..9d0b32e 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -42,3 +42,4 @@ jobs: duckdb_version: v1.3-ossivalis ci_tools_version: main extra_toolchains: 'python3' + format_checks: 'format;tidy' From 7906808496616715baa68bc24ef2cacaf41e9ad8 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Wed, 2 Jul 2025 22:52:58 +0200 Subject: [PATCH 3/3] Format fixes --- extension/httpfs/httpfs.cpp | 3 ++- test/sql/secret/secret_aws.test | 2 +- test/sql/secret/secret_refresh.test | 2 +- test/sql/secret/secret_refresh_attach.test | 2 +- test/sql/secret/test_secret_type.test | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extension/httpfs/httpfs.cpp b/extension/httpfs/httpfs.cpp index 56c8b8e..cb7cde8 100644 --- a/extension/httpfs/httpfs.cpp +++ b/extension/httpfs/httpfs.cpp @@ -275,7 +275,8 @@ void TimestampToTimeT(timestamp_t timestamp, time_t &result) { HTTPFileHandle::HTTPFileHandle(FileSystem &fs, const OpenFileInfo &file, FileOpenFlags flags, unique_ptr params_p) : FileHandle(fs, file.path, flags), params(std::move(params_p)), http_params(params->Cast()), - flags(flags), length(0), force_full_download(false), buffer_available(0), buffer_idx(0), file_offset(0), buffer_start(0), buffer_end(0) { + flags(flags), length(0), force_full_download(false), buffer_available(0), buffer_idx(0), file_offset(0), + buffer_start(0), buffer_end(0) { // check if the handle has extended properties that can be set directly in the handle // if we have these properties we don't need to do a head request to obtain them later if (file.extended_info) { diff --git a/test/sql/secret/secret_aws.test b/test/sql/secret/secret_aws.test index 529c4bc..3949161 100644 --- a/test/sql/secret/secret_aws.test +++ b/test/sql/secret/secret_aws.test @@ -1,6 +1,6 @@ # name: test/sql/secret/secret_aws.test # description: Tests secret refreshing -# group: [secrets] +# group: [secret] require-env S3_TEST_SERVER_AVAILABLE 1 diff --git a/test/sql/secret/secret_refresh.test b/test/sql/secret/secret_refresh.test index 85c8738..fe59f62 100644 --- a/test/sql/secret/secret_refresh.test +++ b/test/sql/secret/secret_refresh.test @@ -1,6 +1,6 @@ # name: test/sql/secret/secret_refresh.test # description: Tests secret refreshing -# group: [secrets] +# group: [secret] require-env S3_TEST_SERVER_AVAILABLE 1 diff --git a/test/sql/secret/secret_refresh_attach.test b/test/sql/secret/secret_refresh_attach.test index c20881d..efe3b43 100644 --- a/test/sql/secret/secret_refresh_attach.test +++ b/test/sql/secret/secret_refresh_attach.test @@ -1,6 +1,6 @@ # name: test/sql/secret/secret_refresh_attach.test # description: Tests secret refreshing -# group: [secrets] +# group: [secret] require-env S3_TEST_SERVER_AVAILABLE 1 diff --git a/test/sql/secret/test_secret_type.test b/test/sql/secret/test_secret_type.test index 2024b2f..a143b98 100644 --- a/test/sql/secret/test_secret_type.test +++ b/test/sql/secret/test_secret_type.test @@ -1,6 +1,6 @@ # name: test/sql/secret/test_secret_type.test # description: Test the secret types added by this extension -# group: [httpfs] +# group: [secret] require httpfs