From fdde735514040d2fe7aee05c8d35f624f3565549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Bohl?= Date: Tue, 8 Oct 2024 13:02:19 +0200 Subject: [PATCH 01/11] Update project version and rename accountURL for consistency Updated CMakeLists.txt to increment project version from 0.62.4 to 0.62.5. Renamed key accountURL to accounturl in stream_objects.markdown and azureblobinputstream.h to maintain consistent naming conventions. --- CMakeLists.txt | 2 +- Src/libCZI/Doc/stream_objects.markdown | 2 +- Src/libCZI/StreamsLib/azureblobinputstream.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73924e07..f1c44f22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0091 NEW) # enable new "MSVC runtime library selection" (https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html) project(libCZI - VERSION 0.62.4 + VERSION 0.62.5 HOMEPAGE_URL "https://github.com/ZEISS/libczi" DESCRIPTION "libCZI is an Open Source Cross-Platform C++ library to read and write CZI") diff --git a/Src/libCZI/Doc/stream_objects.markdown b/Src/libCZI/Doc/stream_objects.markdown index b932509c..763b584a 100644 --- a/Src/libCZI/Doc/stream_objects.markdown +++ b/Src/libCZI/Doc/stream_objects.markdown @@ -51,7 +51,7 @@ The reader has multiple modes of operation - mainly differing in how the authent key | description -------------------|--------------------------------------------------- account | The storage-account name. It will be used to create the account-URL as https://.blob.core.windows.net". This key is relevant for all authentication modes except "ConnectionString". - accountURL | The complete base-URL for the storage account. If this is given, then the key 'account' is ignored (and this URL is used instead). This key is relevant for all authentication modes except "ConnectionString". + accounturl | The complete base-URL for the storage account. If this is given, then the key 'account' is ignored (and this URL is used instead). This key is relevant for all authentication modes except "ConnectionString". containername | The container name. blobname | The name of the blob. connectionstring | The connection string to access the blob store. This key is relevant only for authentication mode "ConnectionString". diff --git a/Src/libCZI/StreamsLib/azureblobinputstream.h b/Src/libCZI/StreamsLib/azureblobinputstream.h index 93b32630..622871fd 100644 --- a/Src/libCZI/StreamsLib/azureblobinputstream.h +++ b/Src/libCZI/StreamsLib/azureblobinputstream.h @@ -46,7 +46,7 @@ /// | | This key is relevant for all authentication modes except /// | | "ConnectionString". /// +------------------+-------------------------------------------------------------------------- -/// | acountURL | The complete base-URL for the storage account. If this is given, then the +/// | accounturl | The complete base-URL for the storage account. If this is given, then the /// | | key 'account' is ignored (and this URL is used instead). /// | | This key is relevant for all authentication modes except /// | | "ConnectionString". From fe7c02067f76c3aa5228804241e2652643934bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Bohl?= Date: Tue, 8 Oct 2024 13:12:37 +0200 Subject: [PATCH 02/11] update history.txt --- Src/libCZI/Doc/version-history.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/libCZI/Doc/version-history.markdown b/Src/libCZI/Doc/version-history.markdown index c9b2a9e8..6a86680d 100644 --- a/Src/libCZI/Doc/version-history.markdown +++ b/Src/libCZI/Doc/version-history.markdown @@ -30,4 +30,5 @@ version history {#version_history} 0.62.1 | [114](https://github.com/ZEISS/libczi/pull/114) | improve build system fixing issues with msys2 and mingw-w64, cosmetic changes 0.62.2 | [115](https://github.com/ZEISS/libczi/pull/115) | enabling building with clang on windows 0.62.3 | [116](https://github.com/ZEISS/libczi/pull/116) | enable long paths on Windows for CZIcmd, add Windows-ARM64 build - 0.62.4 | [117](https://github.com/ZEISS/libczi/pull/117) | fix build with private RapidJSON library \ No newline at end of file + 0.62.4 | [117](https://github.com/ZEISS/libczi/pull/117) | fix build with private RapidJSON library + 0.62.5 | [119](https://github.com/ZEISS/libczi/pull/119) | fix a discrepancy between code and documentation \ No newline at end of file From e4db6d781ae1ebeaa0a688960ad6bf9550736520 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 22:54:24 +0200 Subject: [PATCH 03/11] test for fixing build --- .github/workflows/cmake.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4ee2838d..ab56822f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,6 +31,12 @@ jobs: # on Windows, we rely on vcpkg to pull in dependencies shell: bash run: | + # Temporary workaround for the vcpkg internal issue + # See https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 for details + export SystemDrive=$SYSTEMDRIVE + export SystemRoot=$SYSTEMROOT + export windir=$WINDIR + vcpkg install azure-storage-blobs-cpp:x64-windows-static vcpkg install azure-identity-cpp:x64-windows-static vcpkg install rapidjson 'curl[ssl]' --triplet x64-windows-static From 83e24eeea267b2e673b6c573b24009f37c375979 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 23:07:47 +0200 Subject: [PATCH 04/11] make actionlint happy --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ab56822f..ddd4035f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,9 +33,9 @@ jobs: run: | # Temporary workaround for the vcpkg internal issue # See https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 for details - export SystemDrive=$SYSTEMDRIVE - export SystemRoot=$SYSTEMROOT - export windir=$WINDIR + export SystemDrive=$SYSTEMDRIVE # actionlint-ignore SC2153 + export SystemRoot=$SYSTEMROOT # actionlint-ignore SC2153 + export windir=$WINDIR # actionlint-ignore SC2153 vcpkg install azure-storage-blobs-cpp:x64-windows-static vcpkg install azure-identity-cpp:x64-windows-static From 17e4bcfcfb5187896383e814816ceb5d62552c6e Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 23:11:09 +0200 Subject: [PATCH 05/11] test --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ddd4035f..ffe76f49 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,9 +33,9 @@ jobs: run: | # Temporary workaround for the vcpkg internal issue # See https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 for details - export SystemDrive=$SYSTEMDRIVE # actionlint-ignore SC2153 - export SystemRoot=$SYSTEMROOT # actionlint-ignore SC2153 - export windir=$WINDIR # actionlint-ignore SC2153 + export SystemDrive=$SYSTEMDRIVE # actionlint-ignore 2153 + export SystemRoot=$SYSTEMROOT # actionlint-ignore 2153 + export windir=$WINDIR # actionlint-ignore 2153 vcpkg install azure-storage-blobs-cpp:x64-windows-static vcpkg install azure-identity-cpp:x64-windows-static From c8e16dcd33e99d6e2098b3094687be50e9bd7db1 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 23:19:47 +0200 Subject: [PATCH 06/11] test --- .github/workflows/cmake.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ffe76f49..329275c4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,9 +33,10 @@ jobs: run: | # Temporary workaround for the vcpkg internal issue # See https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 for details - export SystemDrive=$SYSTEMDRIVE # actionlint-ignore 2153 - export SystemRoot=$SYSTEMROOT # actionlint-ignore 2153 - export windir=$WINDIR # actionlint-ignore 2153 + # shellcheck disable=SC2153 + export SystemDrive=$SYSTEMDRIVE + export SystemRoot=$SYSTEMROOT + export windir=$WINDIRt vcpkg install azure-storage-blobs-cpp:x64-windows-static vcpkg install azure-identity-cpp:x64-windows-static From 2754882409c20572a00c259dfdae63d614019ca4 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 23:22:03 +0200 Subject: [PATCH 07/11] test --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 329275c4..e4ece313 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -35,6 +35,7 @@ jobs: # See https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 for details # shellcheck disable=SC2153 export SystemDrive=$SYSTEMDRIVE + # shellcheck disable=SC2153 export SystemRoot=$SYSTEMROOT export windir=$WINDIRt From 698250a3b7c791b73011239ff96c7f6527e3c3ba Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 23:41:17 +0200 Subject: [PATCH 08/11] fix silly typo --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e4ece313..2382e620 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -37,7 +37,7 @@ jobs: export SystemDrive=$SYSTEMDRIVE # shellcheck disable=SC2153 export SystemRoot=$SYSTEMROOT - export windir=$WINDIRt + export windir=$WINDIR vcpkg install azure-storage-blobs-cpp:x64-windows-static vcpkg install azure-identity-cpp:x64-windows-static From 6bd3f0a6b4346167a712e859fa943e773b32be6c Mon Sep 17 00:00:00 2001 From: ptahmose Date: Tue, 8 Oct 2024 23:44:08 +0200 Subject: [PATCH 09/11] make linter happy --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2382e620..39376a30 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -37,6 +37,7 @@ jobs: export SystemDrive=$SYSTEMDRIVE # shellcheck disable=SC2153 export SystemRoot=$SYSTEMROOT + # shellcheck disable=SC2153 export windir=$WINDIR vcpkg install azure-storage-blobs-cpp:x64-windows-static From 4cc3d4221910a83a68792574e5347619fb148a31 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Wed, 9 Oct 2024 00:12:21 +0200 Subject: [PATCH 10/11] Add error handling to AzureBlobInputStream::Read method Introduce error handling for AzureBlobInputStream::Read. If ptrBytesRead is nullptr, construct an error message using ostringstream and throw a runtime_error indicating 'DownloadTo' operation failure with status code. --- Src/libCZI/StreamsLib/azureblobinputstream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Src/libCZI/StreamsLib/azureblobinputstream.cpp b/Src/libCZI/StreamsLib/azureblobinputstream.cpp index c01d8a10..556566d7 100644 --- a/Src/libCZI/StreamsLib/azureblobinputstream.cpp +++ b/Src/libCZI/StreamsLib/azureblobinputstream.cpp @@ -210,6 +210,12 @@ void AzureBlobInputStream::Read(std::uint64_t offset, void* pv, std::uint64_t si *ptrBytesRead = download_response.Value.ContentRange.Length.Value(); } } + else + { + ostringstream string_stream; + string_stream << "'DownloadTo' failed with status code " << static_cast(code) << "."; + throw runtime_error(string_stream.str()); + } } /*static*/std::string AzureBlobInputStream::GetBuildInformation() From 9835acf9dd4384a2600f75a5c5fb55b930319293 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Wed, 9 Oct 2024 00:13:35 +0200 Subject: [PATCH 11/11] typo --- Src/libCZI/StreamsLib/azureblobinputstream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/libCZI/StreamsLib/azureblobinputstream.cpp b/Src/libCZI/StreamsLib/azureblobinputstream.cpp index 556566d7..47d4a1d7 100644 --- a/Src/libCZI/StreamsLib/azureblobinputstream.cpp +++ b/Src/libCZI/StreamsLib/azureblobinputstream.cpp @@ -185,7 +185,7 @@ void AzureBlobInputStream::Read(std::uint64_t offset, void* pv, std::uint64_t si const Azure::Core::Http::HttpStatusCode code = download_response.RawResponse->GetStatusCode(); // TODO(JBL): I am not sure about what we can expect here as return code. The Azure SDK documentation is not very clear about this, - // at least I am not aware of an authorative text on this. + // at least I am not aware of an authoritative text on this. if (code == Azure::Core::Http::HttpStatusCode::Ok || code == Azure::Core::Http::HttpStatusCode::PartialContent) { // the reported position should match the requested offset