Commit Graph

555 Commits

Author SHA1 Message Date
Larry Osterman
3642552d0b
Improve the quality of the WinHTTP transport error message. (#3330)
* Improved HTTP transport error message with Win32 error

* Use std::unique_ptr to manage lifetime of error message
2022-02-08 20:32:35 +00:00
Azure SDK Bot
8774c4ced6
Increment package version after release of azure-core (#3323) 2022-02-08 11:56:57 -08:00
Larry Osterman
60c075a64e
Base64::Decode throws std::runtime_error on failure. (#3305)
* Throw an exception when base64 decode has bogus inputs

Co-authored-by: Ahson Khan <ahkha@microsoft.com>
2022-02-08 09:34:00 -08:00
Anton Kolesnyk
53e90d81fb
Undo assert internal macro and headers (#3318) 2022-02-07 12:25:22 -08:00
Victor Vazquez
7bd640ae55
Azure Core Feb2022 release changelog (#3307)
* Azure Core Feb2022 release changelog

* Update sdk/core/azure-core/CHANGELOG.md

Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com>

Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com>
2022-02-04 15:23:28 -08:00
Ahson Khan
031696179b
Delegate to RFE string ctor and move impl from header to src. (#3315)
* Removing the two param RFE ctor, there should be no callers

* Remove the two param RFE ctor from the source file.

* Fix-up unit test and add a changelog entry.

* Remove test that uses the removed ctor.

* Delegate to RFE string ctor and move impl from header to src.
2022-02-04 15:09:39 -08:00
Ahson Khan
9c79a0725d
Removing the two param RFE ctor, there should be no callers (#3215)
* Removing the two param RFE ctor, there should be no callers

* Remove the two param RFE ctor from the source file.

* Fix-up unit test and add a changelog entry.

* Remove test that uses the removed ctor.
2022-02-03 19:00:25 -08:00
Ahson Khan
40a3e34068
Add back azure_assert.hpp to core CMakeLists (#3311) 2022-02-03 17:49:54 -08:00
Anton Kolesnyk
c4e95dfcfc
Fix unit test compilation on UWP (#3298)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2022-01-31 18:43:37 -08:00
Anton Kolesnyk
2aae6be7a3
Encapsulate getenv(), and make it work on UWP (#3275)
It all started with UWP. The [docs](https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps?view=msvc-170) say: "`Environment variables are not available to UWP apps.`". And it truly won't work, I tried: linker error, the function is simply not present.

So, for a year or so, we were `ifdef`ing everything enivoronment-related: console logger, environment credential, managed identity credential.

And then just recently we wanted to enable our CI for UWP, including tests and samples. And it required to do more ifdefs (in vcpkg, we don't build samples or tests, so that problem did not exist).

It just became more messy. Especially in samples - you can see how we would disable warning with `#pragma warning(disable : 4996)` or defining `_CRT_SECURE_NO_WARNINGS` already, but now came UWP, so we would have to add comment that `getenv()` is not available and make the sample compilation to either fail with clear message, or throw an exception. Plus we would have to detect that we are being compiled on UWP, which also adds visual clutter for reader. You can see how such an irrelevant (for a sample) thing as `getenv` was consuming more and more lines of sample code and reader's attention.

But then! I read docs on more APIs for UWP. And I noticed that on .NET you can read environment variables. So I went and checked Win32 API docs for [GetEnvironmentVariable()](https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getenvironmentvariable) - it says: "`Minimum supported client: ... UWP apps`".

**GetEnvironmentVariable() works on UWP!**
And so does `SetEnvironmentVariable()` (our tests use it, which means we can make all of them work and execute for UWP).

That's good news, but now it would probably be more code: it usually takes more lines to invoke WinAPI, it is no more an one-liner to call `getenv()/setenv()`. So, I encapsulated that into `Azure::Core::_internal::Environment::GetVariable()` and `SetVariable()`. You can see how much less ifdefs is in our code now. Not to mention it works on UWP!

Per team request, that API is SDK-internal. Samples use their own mini-helper project, `get-env-helper` that makes is so that `getenv()` works naturally on Linux and macOS, compiles without warnings and works on Win32, and compiles and works on UWP (using `GetEnvironmentStringsA()`)

If it was for me, I would just make `Azure::Core::Environment::GetVariable()` public and simplify even further, I think it would be beneficial for sample readers (you can see that extra `get-env-helper` stuff adds just a little more visual clutter, compared to nothing). But I can see reasons against that, why team did not want to do it.
2022-01-29 08:22:33 +00:00
Victor Vazquez
335fb0ab43
ci fix (#3259) 2022-01-20 09:24:58 -08:00
Ahson Khan
b3ac959049
Fix up the Azure Core changelog for breaking change and new line (#3255) 2022-01-20 07:13:11 -08:00
Victor Vazquez
20bb1ec276
Recordings for storage (#3194)
* Recordings for storage (#4)
2022-01-18 14:50:15 -08:00
Victor Vazquez
30c5d77d88
Remove Logging from the LibcurlConnectionPool - cleaning routine (#3219)
Remove Logging from the LibcurlConnectionPool - cleaning routine (#3219)
2022-01-13 20:04:18 +00:00
Victor Vazquez
dc5b45e759
Test Cmake generate configs (#3230)
Adding extra stage for individual packages generation
2022-01-11 15:49:56 -08:00
George Arama
4239100f3b
Updates to readme files (#3220)
* links updates

* PR comments

* readme updates

* oops

* update source section
2022-01-11 13:11:44 -08:00
Anton Kolesnyk
4f8f96eb88
Macro rename compatibility layer (#3186)
* Macro rename compatibility layer

* pragma once + doxy comment

* Update sdk/core/azure-core/inc/azure/core/azure_assert.hpp

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* clang format

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
2022-01-06 13:08:09 -08:00
Daniel Jurek
fa0fa97155
Generate map files (#3181)
* Generate map files in build

* Add .map file artifact publishing

* Add Xlinker to spelling exceptions

* Remove PublishMapFiles from clang builds

* Generate the map file artifact name

* CXX_COMPILER_ID and some logging for Clang which might be linking using the GNU linker by default

* More logging

* Move logging out of conditional

* Logging up high, use OS to determine which link flags to set

* Use linker options specific to AppleClang's context, publish map files for all platforms
2022-01-03 13:56:41 -08:00
Anton Kolesnyk
b4fe751310
RequestFailedException: decouple Message and what(). (#3201)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-12-18 09:00:04 -08:00
Anton Kolesnyk
5f97ac1b3d
Fix nightly tests compilation on GCC5 (#3190) 2021-12-16 10:44:22 -08:00
Victor Vazquez
0bde2ad3f8
Define env from each service ci (#3184)
use env vars by service config
2021-12-14 17:23:44 -08:00
Anton Kolesnyk
07d20e78e3
Exclude uncoverable lines from code coverage (#3179)
* Use code coverage annotations in places that never can be covered

* Comments

* Increment goal

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-12-14 15:25:48 -08:00
Victor Vazquez
7301f348b0
Recordings for identity (#3156)
Adding test recordings for Identity
2021-12-14 21:42:08 +00:00
Anton Kolesnyk
a2b2b74080
Add a few simple unit tests to boost coverage (#3163) 2021-12-13 14:50:30 -08:00
Anton Kolesnyk
12a2ca31bc
Fix DateTime::Parse validation for dates past year 9999 due to adjustments (#3177) 2021-12-13 12:55:00 -08:00
Anton Kolesnyk
d4ffa7dbc1
Remove static curl transport (#3178)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-12-10 15:53:17 -08:00
Victor Vazquez
50e984f35c
Recording for Key Vault Keys (#3146)
* test recordings for KeyVault Keys
2021-12-06 20:58:33 +00:00
Anton Kolesnyk
98d9664dc9
Boost code coverage by adding tests (#3123)
* Boost code coverage by adding tests

* Increase Code Coverage min bar goals

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-12-02 08:43:07 -08:00
Anton Kolesnyk
a831b4b3f6
Exclude test, samples, and 3rd party code from code coverage (#3120)
* Exclude test, samples, and 3rd party code from code coverage

* Update min coverage requirement to a true one

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-11-18 13:06:12 -08:00
Anton Kolesnyk
764b839dec
Make AZURE_ASSERT and related macros internal (#3059) 2021-11-17 18:31:37 -08:00
Anton Kolesnyk
5e0f1c9ac8
Do not initialize statics in inline functions (#3111)
* Do not initialize statics in inline functions

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-11-17 13:17:41 -08:00
Anton Kolesnyk
1e01a161cb
Remove LICENSE file duplicates (#3085)
* Remove `LICENSE` file duplicates

* Update hyperlinks

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-11-09 15:55:14 -08:00
Anton Kolesnyk
6aa6ed9747
Update repo links (master => main) (#3084)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-11-08 20:27:47 -08:00
Anton Kolesnyk
767b03401e
Remove en-us from links in code comments (#3083)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-11-08 20:27:32 -08:00
Daniel Jurek
198327e16c
Reduce incidence of build storms (#3079)
* Narrower build trigger matrix, introduce batching so changes to main don't trigger builds for every checkin if there are other builds running, expand core to test everything in CI

* Wire up CtestExcludeRegex

* Improvements including scoping to exclude storage tests

* Use correct trigger settings for storage
2021-11-08 15:01:50 -08:00
Azure SDK Bot
f84c8d2af7
Increment package version after release of azure-core (#3073) 2021-11-08 08:43:45 -08:00
Victor Vazquez
7e7979d7f7
Cl for release 1.3.1 (#3070) 2021-11-05 15:31:33 -07:00
Ahson Khan
1d7b6bb485
Fix up build error by adding missing parenthesis in tests (#3071)
* Fix up build error by adding missing parenthesis in tests

* Because static lib curl tests were disabled we need to lower the threshold
2021-11-05 15:30:59 -07:00
Anton Kolesnyk
ae612c5db5
Fixed linking error when Azure SDK is being built as DLL. (#3069)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>
2021-11-05 14:25:11 -07:00
Ahson Khan
ad87699a2e
Disable unit tests for staticLibCurl since they are failing on Mac (#3068) 2021-11-05 14:18:10 -07:00
Azure SDK Bot
7926ec8c3c
Increment package version after release of azure-core (#3058) 2021-11-05 14:08:33 -07:00
Ahson Khan
e498d6a165
Update cspell.json entry for contributor names within azure core changelog. (#3049)
* Update cspell.json entry for contributor names within azure core changelog.

* Remove in-line exception
2021-11-04 15:31:04 -07:00
Victor Vazquez
4614b80d22
cl (#3047) 2021-11-04 18:52:50 +00:00
Victor Vazquez
50b89caaa5
hide Request general ctor (#3033) 2021-11-03 16:09:07 -07:00
Victor Vazquez
fb03127d05
Use ms for connection timeout (#3001)
* move the static transport adapter to private impl

* use MS for connection timeout

* update

* fix the value
2021-11-03 23:08:35 +00:00
Daniel Jurek
413b4b7665
Add coverage enforcement (#2992)
* Add coverage enforcement

* Add spelling exception for mspremier

* Use previous build coverage data, enforce 3% variance, use Skip.CoverageEnforcement feature flag

* Use version 8 of quality checks

* Remove forceCoverageImprovement, it doesn't allow 0% improvements (e.g. doc changes, etc.)

* branch -> branches

* Configure coverage thresholds per-service

* Use fixed coverage

* Review feedback

* Per-service coverage plumbing

* Flip branch and line coverage requirements for KV to accurately reflect current baseline
2021-11-03 10:56:32 -07:00
Victor Vazquez
31398df179
move the static transport adapter to private impl (#2993) 2021-10-28 11:49:37 -07:00
Victor Vazquez
871b9e8d6d
Expose http request base constructor (#3002)
* Expose http request base constructor

* cl
2021-10-28 10:02:01 -07:00
Victor Vazquez
3be793d558
[Core] - Support azure-core version without OpenSSL dependency (#2839)
* perf test uuid

* use win impl for uuid on linux

* use c99 base64 encode-decode
2021-10-27 23:20:34 +00:00
Victor Vazquez
a4f2e510e5
Adding timeout option (#2991) 2021-10-25 12:12:53 -07:00