Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.idea
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ known_content_issues:
- ['sdk/clientcore/README.md', '#3113']
- ['sdk/clientcore/core/README.md', '#3113']
- ['sdk/clientcore/http-okhttp3/README.md', '#3113']
- ['sdk/clientcore/optional-dependency-tests/README.md', '#3113']
- ['sdk/core/azure-core-experimental/README.md', '#3113']
- ['sdk/cosmos/faq/README.md', '#3113']
- ['sdk/cosmos/azure-cosmos-benchmark/README.md', '#3113']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,17 @@
<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck" files="ConsoleLogger.java"/>
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck"
files="com.azure.sdk.build.tool.*\.java"/>
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" files="io.clientcore.core.json.*" />
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" files="io.clientcore.core.http.pipeline.HttpLoggingPolicy" />
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" files="io.clientcore.core.http.pipeline.InstrumentationPolicy" />
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientBuilderCheck" files="io.clientcore.core.http.client.DefaultHttpClientBuilder" />
<suppress checks="com.azure.tools.checkstyle.checks.UseCaughtExceptionCauseCheck" files="io.clientcore.core.http.pipeline.HttpRetryPolicy" />

<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck" files="io.clientcore.http.okhttp3.OkHttpHttpClientBuilder" />
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientBuilderCheck" files="io.clientcore.http.okhttp3.OkHttpHttpClientBuilder" />
<suppress checks="ExternalDependencyExposed" files=".*[/\\]http-stress[/\\].*\.java"/>
<suppress checks="IllegalImport" files="io.clientcore.http.*.stress"/>
<suppress checks="IllegalImport" files="io.clientcore.core.telemetry.*Tests"/>
<suppress checks="IllegalImport" files="io.clientcore.core.telemetry.*Benchmarks"/>
<suppress checks="IllegalImport" files="io.clientcore.core.http.pipeline.InstrumentationPolicyTests"/>
</suppressions>
3 changes: 3 additions & 0 deletions sdk/clientcore/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ extends:
groupId: io.clientcore
safeName: httpokhttp3
releaseInBatch: ${{ parameters.release_clientcorehttpokhttp3 }}
AdditionalModules:
- name: optional-dependency-tests
groupId: io.clientcore
1 change: 1 addition & 0 deletions sdk/clientcore/core/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@
<suppress files="io.clientcore.core.serialization.json.implementation.StringBuilderWriter.java" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />
<suppress files="io.clientcore.core.serialization.json.models.JsonNumber.java" checks="com.azure.tools.checkstyle.checks.UseCaughtExceptionCauseCheck" />
<suppress files="io.clientcore.core.http.pipeline.HttpLoggingPolicy" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />
<suppress files="io.clientcore.core.http.pipeline.HttpInstrumentationPolicy.java" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />
</suppressions>
29 changes: 19 additions & 10 deletions sdk/clientcore/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0.60</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.60</jacoco.min.branchcoverage>
<jacoco.min.linecoverage>0.50</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.50</jacoco.min.branchcoverage>

<javaModulesSurefireArgLine>
--add-opens io.clientcore.core/io.clientcore.core.annotation=ALL-UNNAMED
Expand Down Expand Up @@ -161,14 +161,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-failsafe-plugin;external_dependency} -->
<dependencies>
<!-- Inject slf4j-simple into integration testing to verify the shim works as intended. -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version> <!-- {x-version-update;org.slf4j:slf4j-simple;external_dependency} -->
</dependency>
</dependencies>
</plugin>

<plugin>
Expand All @@ -183,6 +175,23 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.azure.tools</groupId>
<artifactId>codesnippet-maven-plugin</artifactId>
<version>1.0.0-beta.10</version> <!-- {x-version-update;com.azure.tools:codesnippet-maven-plugin;external_dependency} -->
<configuration>
<additionalCodesnippets>
<additionalCodesnippet>
<root>../optional-dependency-tests/src/samples/java</root>
<glob>**/*.java</glob>
</additionalCodesnippet>
<additionalCodesnippet>
<root>src/test</root>
<glob>**/*.java</glob>
</additionalCodesnippet>
</additionalCodesnippets>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
9 changes: 9 additions & 0 deletions sdk/clientcore/core/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<Class name="io.clientcore.core.implementation.http.rest.SwaggerMethodParser" />
<Class name="io.clientcore.core.serialization.json.implementation.jackson.core.util.RequestPayload" />
<Class name="io.clientcore.core.util.ClientLogger" />
<Class name="io.clientcore.core.implementation.instrumentation.otel.OTelInstrumentation" />
</Or>
</Match>
<Match>
Expand Down Expand Up @@ -393,4 +394,12 @@
<Bug pattern="XXE_XMLSTREAMREADER" />
<Class name="io.clientcore.core.serialization.xml.XmlReader" />
</Match>
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" />
<Class name="io.clientcore.core.http.pipeline.HttpInstrumentationPolicy" />
</Match>
<Match>
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
<Class name="io.clientcore.core.http.pipeline.HttpInstrumentationPolicy" />
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,26 @@ public RequestOptions setContext(Context context) {
return this;
}

/**
* Adds a key-value pair to the request context associated with this request.
*
* @param key The key to add to the context.
* @param value The value to add to the context.
* @return The updated {@link RequestOptions} object.
*
* @see #setContext(Context)
*/
public RequestOptions putContext(Object key, Object value) {
if (locked) {
throw LOGGER.logThrowableAsError(
new IllegalStateException("This instance of RequestOptions is immutable. Cannot set context."));
}

this.context = this.context.put(key, value);

return this;
}

/**
* Sets the configuration indicating how the body of the resulting HTTP response should be handled. If {@code null},
* the response body will be handled based on the content type of the response.
Expand Down
Loading
Loading