azure-sdk-for-cpp/CONTRIBUTING.md
Larry Osterman f12d835137
Update feature/websockets to match main. (#3767)
* Support BaseName overrides in CI mode for New-TestResources.ps1 (#3559)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Do not pass Generated to -BaseName (#3562)

Co-authored-by: Heath Stewart <heaths@microsoft.com>

* Sort by service name first (#3570)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Initialize the suppression file. (#3569)

* Sync eng/common directory with azure-sdk-tools for PR 3169 (#3572)

* Use the batch version of ValidateDocsMsPackagesFn

* Use proper pipelining for GetPackageInfoJson function

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* [Tech Docs] Libcurl transport adapter (#3484)

* libcurl transport adapter

* updates

* Update LibcurlTransportAdapter.md

* Update LibcurlTransportAdapter.md

* Update doc/LibcurlTransportAdapter.md

Co-authored-by: Jeffrey Richter <jeffrichter@live.com>

Co-authored-by: Jeffrey Richter <jeffrichter@live.com>

* Skip azcopy download if it already exists (#3576)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* Pin openssl to 1.1.1n (#3575)

* Pin openssl to 1.1.1n

* Updated vcpkg commit to one containing OpenSSL 1.1.1n

* Fixed version number in vcpkg.json

* Fix typo (#3583)

* update curl transport options to support ignore proxy from system (#3564)

* update curl transport options to support ignore proxy from system

* update changelog

* bug fix for cl

* update log level from Retry policy (#3586)

* update log level

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

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

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

* Add batch protocol layer (#3580)

* Add batch protocol layer

* some small fixes on Storage cmakefiles (#3588)

* Migrate to matrix generator (#3553)

* Represent existing matrix in json
* Use new matrix
* Move to stage
* Cloud configuration
* MaxParallel
* DependsOn
* Quote CtestRegex
* Use template for cmake generate tests
* Template name mappings
* Formatting, parameters
* Remove duplicate bypass-local-dns.yml
* Enable Location override
* Add Location
* Add spelling words
* Use Ubuntu 20 where the name specifies Ubuntu 20
* Apply suggestions from code review

Co-authored-by: Ben Broderick Phillips <ben@benbp.net>

* PR feedback
* fix storage sample
* Matrix documentation

Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>

* Sync eng/common directory with azure-sdk-tools for PR 3212 (#3587)

* bump consumed version of test proxy. update scripting to target the fully cross-platform image tag name.
* update target version of the test-proxy to one that enforces http/1.1

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3238 (#3590)

* pin proxy version to one that properly sets listenoptions
* update targeted test-proxy docker repo. "testproxy" -> "test-proxy"

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3221 (#3591)

* Make docs.ms link relative link

* Update Update-DocsMsMetadata.ps1

* Update eng/common/scripts/Update-DocsMsMetadata.ps1

Co-authored-by: Daniel Jurek <djurek@microsoft.com>

Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Daniel Jurek <djurek@microsoft.com>

* Remove the daily branch before date (#3593)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Add ClientCertificateCredential (#3578)

* Add ClientCertificateCredential

* Update unit test

* cspell

* Update Readme

* Cosmetic fixes

* Changelog to mention env cred update

* Fix warning

* cspell

* Tell CI to install openssl

* openssl for all Windows

* update dependency manifest

* Re-phrase changelog

* Clang warnings

* Clang warning

* Clang warning - 2

* Ubuntu18 warning

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

Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>

* PR feedback

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3250 (#3595)

* Change the direction of the commit date

* Log on right place

* remove auth

* fix typo

* Add auth token back

* add delete back

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Create a session handle once in the transport ctor and reuse it for all requests rather than creating a new one each time. (#3585)

* Reuse the same session handle for all requests rather than creating a new one each time.

* Move the session handle creation to the transport adapter ctor.

* Update changelog entry.

* Address PR feedback.

* Change CreateSessionHandle to return a local session handle

* Fix-up the changelog entry link for the curtransportoption bug fix (#3598)

* Remove extra period at ends of exception messages in winhttp transport (#3601)

* fix cmake in storage (#3604)

* Reword the curl proxy fix changelog entry. (#3606)

* Add Emma Zhu as code owner (#3605)

* Short circuit out of msdocs publish if no package locations are specified (#3607)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* sdk/core: Reimplement Md5OpenSSL using EVP API (#3609)

The MD5_Init/Update/Final functions are deprecated in OpenSSL 3.0 and result in
a compile-time warning. Due to the default usage of -Werror during compilation,
these warnings are treated as errors and prevent the SDK from being built on
Ubuntu 22.04, which ships with OpenSSL by default. The deprecated APIs should
be replaced by the EVP APIs, which are already in use for the SHA family of
functions, and supported on all versions of OpenSSL.

* API Review Feedback for Attestation SDK (#3543)

* API Review Feedback for Attestation SDK

* Updated changelog to reflect API Review updates

* Remove version pin for OpenSSL (#3610)

* Remove version pin for OpenSSL

* Gratuitous change to trigger CI pipelines

* Update the version tool to the latest (#3616)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Get rid of warnings in nullable.hpp (#3617)

* cl (#3613)

* Update pipeline-generator version (#3623)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* Prepare Attestation SDK for May Release. (#3625)

* Prepare attestation for May release

* Removed some noise from changelog

* Increment package version after release of azure-core (#3624)

* Update CODEOWNERS (#3628)

* Fix identity samples running in CI (#3632)

* azure identity may 2022 release (#3615)

* Increment package version after release of azure-identity (#3637)

* Removed uwp-x86 from platform matrix. (#3629)

* Increment package version after release of azure-security-attestation (#3636)

* Update readme for -pre and -post TestResource scripts (#3645)

Co-authored-by: Christopher Scott <chriss@microsoft.com>

* Fixed a bug where text of XML element cannot be empty. (#3643)

* String parsing improvements to service directory resource names (#3644)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Adding Acknowledgments (#3611)

* cl

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

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

* cspell

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

* Add skip variable for remove test resources to support debugging (#3648)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Storage Blob Stg78 Features (#3650)

* Clean up target_include_directories() (#3641)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Update all-inclusive headers, and CMakeFiles for including all headers (#3640)

* Remove (#3657)

oexcept specifier from Context::IsCancelled()

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Add Language product slug (#3665)

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3342 (#3664)

* Delete PR and branch which central PR is closed

* more logging changes

* resume the delete operations.

* Change the pr link directly

* fix the regex

* Refactor on regex name

* change the function to inline logic

* change typo

* delete on branch

* make changes on comments

* add commnets

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Split out attestation client factory into separate class (#3654)

* Split out attestation client factory into separate class

* Updated readme; clang-format

* Final set of API review changes

* Replaced () constructors with {} constructors

* Initial implementation of OpenTelemetry APIs. (#3561)

* Start of tracing prototype

* Created initial implementation of azure-core-opentelemetry package

* New version of enabling MSVCRT Lib for static configs

* Attempt to add OpenTelemetry tests to build

* Take a dependency on OpenTelemetry version 1.3

* Added service API level tracing support

* API Review feedback

* storage unittest fix and improvement (#3667)

* Sync eng/common directory with azure-sdk-tools for PR 3362 (#3676)

* spell-check skippable by commit

* suceededOrFailed -> succeededOrFailed

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3378 (#3679)

* Create json package property parent directory

* Fix the issue in script

Co-authored-by: praveenkuttappan <prmarott@microsoft.com>

* Vcpkg sample (#3670)

* one commit to rule them all

* main merge

* error

* all smoke

* typo

* 120 minutes

* timeout param missing on job

* actual url

* Update samples/integration/vcpkg-all-smoke/src/main.cpp

Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>

* actual creds

Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>

* Complete the initial implementation of OpenTelemetry (#3677)

* Added telemetry support for HTTP pipeline elements

* Finish OpenTelemetry implementation

* clang-format and added doxygen comments

* Creadscan skips (#3671)

* one commit to rule them all

* main merge

* error

* add recordings for cred scan skipping

* certificates added

* remove dupe

* cspell

* Moved attestation factory back to static method on attestation class … (#3682)

* Moved attestation factory back to static method on attestation class and return a concrete type not a pointer

* Fixed factory in readme file

* OpenTelemetry API Review Feedback (#3687)

* OpenTelemetry API Review Feedback

* Attestation 1.0.0 GA Release (#3693)

* Prepare attestation for release

* removed references to RetrieveResponseValidationCollateral from docs

* Added C++ SDK team as owners of attestation SDK

* Added Ahmad from attestation team to attestation owners

* Removed dead API; switched attestation back to beta-3

* Disable detached head warnings on sparse checkout to commit (#3680)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Remove samples with docker.io (#3621)

* remove samples using docker.io

* removing docker files

* remove project

* Fix issue where matrix replace was not using imported display names (#3694)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Additional OpenTelemetry Feedback... (#3691)

* OpenTelemetry API Review Feedback

* Returns std::unique_ptr<DiagnosticTracingFactory instead of raw pointer

* Late breaking pull request feedback

* Renamed clientContext parameter to CreateSpan

* Renamed ContextAndSpanFactory to TracingContextFactory and CreateSpan to CreateTracingContext.

* Added ability to create instance with pointer (#3698)

* Added ability to create instance with pointer

* Pull request feedback

* Core 1.7.0-beta.1 Release (#3684)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Increment package version after release of azure-core (#3699)

* Format vcpkg.json (#3701)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Update README to list all the vcpkgs (#3704)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Removed version>= fields for openssl in vcpkg.json files (#3705)

* Tab vcpkg publishing condition in to apply to the task (#3709)

* Storage June Release (#3686)

* Override live test location default to westus (#3696)

* Changelog updates for secrets and certificates (#3714)

* Changelog updates for secrets and certificates

* Update package versions

* Removed empty sections in changelog (#3718)

* Identity 1.3.0 Release (#3685)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* OpenTelemetry vcpkg fixes (#3716)

* OpenTelemetry vcpkg fixes

* Update ci.yml

* Drop version >= from project-level vcpkg

* find_package only supports numeric versions

* include(AzureBuildTargetForCI)

* Do not build as Windows/UWP DLL

* Docs and package dependencies

* Update condition

* Move condition down

* Move more under condition

* Rephrase condition

* Try hack for CI that won't affect vcpkg

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Increment package version after release of azure-identity (#3721)

* Increment version for storage releases (#3713)

* Increment package version after release of azure-storage-common

* Increment package version after release of azure-storage-blobs

* [EngSys] Get Vcpkg automatically (#3614)

* get vcpkg automatically

* Updated changelog (#3726)

* Increment package version after release of azure-core-tracing-opentelemetry (#3727)

* Increment package version after release of azure-security-attestation (#3717)

* Increment package version after release of azure-security-attestation (#3720)

* Enable Distributed Tracing for Attestation SDK client. (#3706)

* Implement tracing for Attestation and Template services

* Pipeline no longer requires service name if opting into distributed tracing; enable tracing in attestation service

* Generate user-agent header from request activity policy

* Added test to catch the redacted header regression

* Updated documentation to reflect API surface changes

* Make sample service an object library (#3728)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Include pi-version to default list of unredacted query params for logging (#3730)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3433 (#3731)

* add condition

* divide line

Co-authored-by: Mariana Rios Flores <mariari@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3267 (#3655)

* Use seperate scripts

* address comments.

* do compare and update

* save on the service level readme

* have the helper for reuse function

* remove mgmt table

* changes

* fix

* no return on error

* return if no contents

* Address comments

* change the table

* address wes comments.

* address wes comments.

* address more comments.

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3386 (#3733)

* Update the order of remarks and examples to align with docs.ms

* change all occurance

* Update class.tmpl.partial

Co-authored-by: sizhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>

* ensure conditions all work properly in the case of a previous error (#3732)

Co-authored-by: Scott Beddall <scbedd@microsoft.com>

* InputSanitizer: rename to HttpSanitizer, remove static member (#3736)

* InputSanitizer => HttpSanitizer, remove static

* Update cpp

* Clang format

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Increment version for keyvault releases (#3719)

* Increment package version after release of azure-security-keyvault-certificates

* Increment package version after release of azure-security-keyvault-secrets

* Update DistributedTracing.md (#3715)

Fix typo

* ApiView command line generation script (#3711)

* ApiView command line generation script

* Strongly typed parameters

Co-authored-by: Ben Broderick Phillips <ben@benbp.net>

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>

* Add missing license header to http_sanitizer source file (#3739)

* Add ResourceType parameter - Selects live test or perf test resources (#3740)

Co-authored-by: Mike Harder <mharder@microsoft.com>

* Update identity codeowners (#3744)

* ManagedIdentityCredential: Add support for AppServiceV2019 (#3734)

* ManagedIdentityCredential: Add support for AppServiceV2019

* Attempt to create 2019 before 2017

* Changelog update

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Fix Bug in Resource Ref Verifier (#3758)

Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>

* Use westus as default region in test resource deployments (#3759)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Perf test for certs (#3729)

* one commit to rule them all

* main merge

* error

* main merge

* error

* main merge

* error

* main merge

* error

* example of perf test

* remove file

* create certs and keys in post setup, use to run the test

* PR comments

* Revert "Override live test location default to westus (#3696)" (#3761)

This reverts commit d4192609d5.

* Sync eng/common directory with azure-sdk-tools for PR 3481 (#3764)

* Support local addons path override in stress test deployment

* Support username based deployId in local stress deployment

* Support WhatIf in stress infrastructure provision script

* Simplify stress user detection

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Run helm plugin add with helper

* Add WhatIf support to ps module install helper function

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Fixed typo in LibcurlTransportAdapter.md (#3768)

Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Heath Stewart <heaths@microsoft.com>
Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>
Co-authored-by: Jeffrey Richter <jeffrichter@live.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
Co-authored-by: JinmingHu <jinmhu@microsoft.com>
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com>
Co-authored-by: Jeremi Piotrowski <jeremi.piotrowski@gmail.com>
Co-authored-by: Christopher Scott <chriss@microsoft.com>
Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
Co-authored-by: praveenkuttappan <prmarott@microsoft.com>
Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com>
Co-authored-by: Mariana Rios Flores <mariari@microsoft.com>
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
Co-authored-by: Mike Harder <mharder@microsoft.com>
Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
2022-06-27 12:28:44 -07:00

251 lines
14 KiB
Markdown

# Azure SDK for C++ Contributing Guide
Thank you for your interest in contributing to Azure SDK for C++.
- For reporting bugs, requesting features, or asking for support, please file an issue in the [issues](https://github.com/Azure/azure-sdk-for-cpp/issues) section of the project.
- If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](https://azure.github.io/azure-sdk/policies_opensource.html).
- To make code changes, or contribute something new, please follow the [GitHub Forks / Pull requests model](https://docs.github.com/articles/fork-a-repo/): Fork the repo, make the change and propose it back by submitting a pull request.
## Pull Requests
- **DO** follow the API design and implementation [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html).
- When submitting large changes or features, **DO** have an issue or spec doc that describes the design, usage, and motivating scenario.
- **DO** submit all code changes via pull requests (PRs) rather than through a direct commit. PRs will be reviewed and potentially merged by the repo maintainers after a peer review that includes at least one maintainer.
- **DO** review your own PR to make sure there aren't any unintended changes or commits before submitting it.
- **DO NOT** submit "work in progress" PRs. A PR should only be submitted when it is considered ready for review and subsequent merging by the contributor.
- If the change is work-in-progress or an experiment, **DO** start if off as a temporary draft PR.
- **DO** give PRs short-but-descriptive names (e.g. "Improve code coverage for Azure.Core by 10%", not "Fix #1234") and add a description which explains why the change is being made.
- **DO** refer to any relevant issues, and include [keywords](https://docs.github.com/articles/closing-issues-via-commit-messages/) that automatically close issues when the PR is merged.
- **DO** tag any users that should know about and/or review the change.
- **DO** ensure each commit successfully builds. The entire PR must pass all tests in the Continuous Integration (CI) system before it'll be merged.
- **DO** address PR feedback in an additional commit(s) rather than amending the existing commits, and only rebase/squash them when necessary. This makes it easier for reviewers to track changes.
- **DO** assume that ["Squash and Merge"](https://github.com/blog/2141-squash-your-commits) will be used to merge your commit unless you request otherwise in the PR.
- **DO NOT** mix independent, unrelated changes in one PR. Separate real product/test code changes from larger code formatting/dead code removal changes. Separate unrelated fixes into separate PRs, especially if they are in different modules or files that otherwise wouldn't be changed.
- **DO** comment your code focusing on "why", where necessary. Otherwise, aim to keep it self-documenting with appropriate names and style.
- **DO** add [doxygen style API comments](https://azure.github.io/azure-sdk/cpp_introduction.html#documentation-style) when adding new APIs or modifying header files.
- **DO** make sure there are no typos or spelling errors, especially in user-facing documentation.
- **DO** verify if your changes have impact elsewhere. For instance, do you need to update other docs or exiting markdown files that might be impacted?
- **DO** add relevant unit tests to ensure CI will catch future regressions.
## Merging Pull Requests (for project contributors with write access)
- **DO** use ["Squash and Merge"](https://github.com/blog/2141-squash-your-commits) by default for individual contributions unless requested by the PR author.
Do so, even if the PR contains only one commit. It creates a simpler history than "Create a Merge Commit".
Reasons that PR authors may request "Merge and Commit" may include (but are not limited to):
- The change is easier to understand as a series of focused commits. Each commit in the series must be buildable so as not to break `git bisect`.
- Contributor is using an e-mail address other than the primary GitHub address and wants that preserved in the history. Contributor must be willing to squash
the commits manually before acceptance.
# Developer Guide
## Codespaces
Codespaces is new technology that allows you to use a container as your development environment. This repo provides a Codespaces container which is supported by both GitHub Codespaces and VS Code Codespaces.
### GitHub Codespaces
1. From the Azure SDK GitHub repo, click on the "Code -> Open with Codespaces" button.
1. Open a Terminal. The development environment will be ready for you. Continue to [Building and Testing](https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md#building-and-testing).
### VS Code Codespaces
1. Install the [VS Code Remote Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack)
1. When you open the Azure SDK for C++ repo in VS Code, it will prompt you to open the project in the Dev Container. If it does not prompt you, then hit CTRL+P, and select "Remote-Containers: Open Folder in Container..."
1. Open a Terminal. The development environment will be ready for you. Continue to [Building and Testing](https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md#building-and-testing).
## Full Local Setup
### Pre-requisites
#### CMake
CMake version 3.13 or higher is required to build these libraries. Download and install CMake from the project's
[website](https://cmake.org/download/).
### Third Party Dependencies
Azure SDK uses Vcpkg manifest mode to declare the [list of required 3rd party dependencies](https://github.com/Azure/azure-sdk-for-cpp/blob/main/vcpkg.json) for building the SDK service libraries. It will also get and set up Vcpkg automatically. **You can move on to [Building the project](#building-the-project)** and skip the next part if you are not interested in learning about alternatives for setting up dependencies.
#### Customize the Vcpkg dependency integration
If the CMake option _-DCMAKE_TOOLCHAIN_FILE=..._ is not defined to generate the project, the Azure SDK project will automatically get Vcpkg and link it to get its dependencies. You can use the next environment variables to change this behavior:
<center>
<table>
<tr>
<td>Environment Variable</td>
<td>Description</td>
</tr>
<tr>
<td>AZURE_SDK_DISABLE_AUTO_VCPKG</td>
<td>When defined, Vcpkg won't be automatically cloned and linked. Use this setting, for example, if your dependencies are installed on the system and you don't need to get them.</td>
</tr>
<tr>
<td>AZURE_SDK_VCPKG_COMMIT</td>
<td>This variable can set the git commit id to be used when automatically cloning Vcpkg.</td>
</tr>
<tr>
<td>VCPKG_ROOT</td>
<td>Use this variable to set an existing Vcpkg folder from your system to be linked for building. Use this, for example, when working with Vcpkg classic mode, to switch between different Vcpkg folders.</td>
</tr>
</table>
</center>
## Building the project
Generate the CMake files and build as you would with any standard CMake project. From the
repo root, run:
```sh
mkdir build
cd build
cmake ..
cmake --build .
```
#### Static Analysis
When the project is built using MSVC on Windows, the compiler can run [static analysis](https://docs.microsoft.com/cpp/code-quality/walkthrough-analyzing-c-cpp-code-for-defects) on the code. The CMake project can add the required compiler flags to perform this check. To enable this feature, set an environment variable `AZURE_ENABLE_STATIC_ANALYSIS`.
Keep in mind that enabling static analysis will significantly impact build time. It is recommended to run it right before submitting the PR, but not in your inner developer loop.
The static code analysis is `ON` for the CI pipelines. You can turn this feature `ON` locally to debug errors reported during CI or for the last time you build and test before creating a new PR.
#### CMake build options
The following CMake options are available for adding/removing project features.
<table>
<tr>
<td>Option</td>
<td>Description</td>
<td>Default Value</td>
</tr>
<tr>
<td>BUILD_TESTING</td>
<td>Generates Unit Test for compilation. CMake will automatically download and build g-test.<br>After Compiling, use `ctest` to run Unit Test.</td>
<td>OFF</td>
</tr>
<tr>
<td>BUILD_CODE_COVERAGE</td>
<td>Build HTML and XML targets for each package which can be call to produce XML or HTML reports. The generated CMake targets are named `package-name_cov_xml` and `package-name_cov_html` (for example, for Azure Core, it would be `azure-core-cov_xml`).<br> <br>Ths option requires compiling on `debug` mode, building tests (BUILD_TESTING) and a GNU compiler like gcc. </td>
<td>OFF</td>
</tr>
<tr>
<td>BUILD_SAMPLES</td>
<td>Build Azure SDK for C++ sample applications. </td>
<td>OFF</td>
</tr>
<tr>
<td>RUN_LONG_UNIT_TESTS</td>
<td>Enables the special unit tests which takes more than 3 minutes to run. These tests are for some specific features like the connection pool for libcurl transport adapter.</td>
<td>OFF</td>
</tr>
<tr>
<td>WARNINGS_AS_ERRORS</td>
<td>Warnings will make compiling fail</td>
<td>ON</td>
</tr>
<tr>
<td>BUILD_TRANSPORT_CURL</td>
<td>Build the libcurl HTTP transport adapter. When building on POSIX systems, if no other transport adapter is built, this option will be automatically turned ON</td>
<td>OFF</td>
</tr>
<tr>
<td>BUILD_TRANSPORT_WINHTTP</td>
<td>Build the WinHTTP transport adapter. When building on Windows systems, if no other transport adapter is built, this option will be automatically turned ON. This option is not supported on non-Windows OSes.</td>
<td>OFF</td>
</tr>
<tr>
<td>BUILD_DOCUMENTATION</td>
<td>Build Doxygen documentation</td>
<td>OFF</td>
</tr>
<tr>
<td>MSVC_USE_STATIC_CRT</td>
<td>On MSVC, link SDK with static CRT (use `/MT` or `/MTd` switch)</td>
<td>OFF</td>
</tr>
</table>
#### Testing the project
##### Test Mode
Before running unit tests, you have to decide what is the test mode you want to use. To set the test mode,
use the environment variable `AZURE_TEST_MODE`. See the supported values next:
- LIVE
When setting `AZURE_TEST_MODE=LIVE`, test cases will try to connect to `AZURE` cloud services using the [test environment configuration](#test-environment-configuration). Make sure to set up the environment variables required to run test cases.
This is the default test mode if `AZURE_TEST_MODE` is not even set.
- PLAYBACK
When setting `AZURE_TEST_MODE=PLAYBACK`, test cases will consume pre-recorded data instead of sending requests to an AZURE cloud service. The [test environment configuration](#test-environment-configuration) is still required, but the configuration values won't be relevant. Use this test mode to run tests cases without a network connection.
- RECORD
When setting `AZURE_TEST_MODE=RECORD`, test cases will run the as when running `LIVE`. All the AZURE service network responses are recorded in a json file within the /recordings folder from the /test/ut directory. Use this test mode to generate pre-recorded data to be used on `PLAYBACK` mode.
##### Test Environment Configuration
Some environment variables are expected to be defined for some test binaries. For example, for `azure-storage-blobs-test`, there should be a `STANDARD_STORAGE_CONNECTION_STRING` variable to let tests know how to connect to the Azure Storage account.
Even for running on `PLAYBACK` mode, the env configuration is mandatory. This is because a test case does not know about the test modes. A test case will always look for the environment configuration to connect/authenticate to Azure.
Take a look to [this file](https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/core/ci.yml#L52) which defines the required configuarion for each SDK package. Those settings are used to run all unit test on `PLAYBACK` mode on CI, you can use the same settings from that file to run on `PLAYBACK` locally.
##### Running tests
If you want to run tests, generate build files using below command and then build.
```sh
cmake -DBUILD_TESTING=ON ..
cmake --build .
```
Tests are executed via the `ctest` command included with CMake. After setting a [test mode](#test-mode), from the build directory, run:
```sh
# use -V for verbose
ctest -V
# Use -N to list test that are part of test set
ctest -N
# Use -R to use a regular exp for what to run
ctest -R Http # runs only HTTP tests
ctest -R storage # runs all the azure storage unit tests
```
#### Generating Code Coverage reports
`gcov` and `gcovr` must be installed on your system.
Also, make sure to generate the project with Debug mode. Then, option `-DBUILD_TESTING` must be `ON` and to use a GNU compiler (like gcc).
```sh
# install gcov and gcovr if missing
sudo apt-get install gcov gcovr # example for Linux
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON ..
# After this, generate reports by calling a package target
make package-name_cov_xml # for example `azure-core_cov_xml`
make package-name_cov_html # for example `azure-core_cov_html`
```
Running the above commands will create the test executable and run it. While it runs, gcov will capture coverage and produce coverage data. And when test finished, gcovr is used to parse the coverage data to produce and XML or HTML. The output files will be inside the package build directory. For example, for Azure core, it will be `../build/path/sdk/core/azure-core/`.
If the coverage data has been previously generated (for example, if you manually run the unit tests), you can define `CODE_COVERAGE_COLLECT_ONLY` environment variable (set it to any value) and then the report will be generated without running the tests again. This is how the coverage reports are generated on CI, where the tests runs prior to code coverage step.
### Visual Studio 2019
You can also build the project by simply opening the repo directory in Visual Studio. Visual Studio will detect the `CMake` file and will configure itself to generate, build and run tests.