Skip to content

Commit

Permalink
Migrating spring data cosmos from sdk/cosmos to sdk/spring (Azure#33905)
Browse files Browse the repository at this point in the history
* Moving the azure-spring-data-cosmos and azure-spring-data-cosmos-test directories from sdk/cosmos to sdk/spring

* Updating the azure-spring-data-cosmos-test pom file.

* Updating the azure-spring-data-cosmos pom file.

* Updating the changelog.

* Making changes for PR.

* Making changes for PR.

* Update cspell to ignore these directories still.

* Fixing paths to sdk/spring from sdk/cosmos.

* Fixing more paths.

* Fixing more paths.

* Switching azure-spring-data-cosmos to use the dependency versoin of azure-cosmos and not the current version.

* Fixing dependency.

* Moving azure-spring-data-cosmos to the sdk/spring ci.

* Updating CI pipelines to run correctly for the migration. 'java - cosmos - ci' had spring removed from it and put in it's own pipeline to accomdate the change, this new pipeline is 'java - cosmos - spring -ci'

* Fixing tests.

* Removing un-used dependency.

* Resolving issue from merge conflict.

* Fixing spring integration tests

* Fixing spring integration tests.

* Removing duplicate from POM.
  • Loading branch information
trande4884 authored May 9, 2023
1 parent dbcd6f7 commit 47c6278
Show file tree
Hide file tree
Showing 347 changed files with 297 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@
"sdk/cosmos/azure-cosmos-spark_3-3_2-12/**",
"sdk/core/azure-core-test/**",
"sdk/cosmos/azure-cosmos-encryption/**",
"sdk/cosmos/azure-spring-data-cosmos-test/**",
"sdk/spring/azure-spring-data-cosmos-test/**",
"sdk/cosmos/azure-cosmos-spark_3_2-12/**",
"sdk/cosmos/azure-spring-data-cosmos/**",
"sdk/spring/azure-spring-data-cosmos/**",
"sdk/core/azure-json/**",
"sdk/deviceupdate/azure-iot-deviceupdate/**",
"sdk/e2e/src/**",
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This project provides SDK library in Java for interacting with [SQL API][sql_api

To get started with a specific library, see the **README.md** file located in the library's project folder. You can find service libraries in the `/sdk/cosmos/` directory.
- [Azure Cosmos](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos/README.md) is Microsoft's Azure Cosmos DB Java SDK which provides client-side logical representation to access the Azure Cosmos DB SQL API. The SDK provides Reactor Core based async APIs.
- [Azure Spring Data Cosmos](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring-data-cosmos/README.md) provides Spring Data support for Azure Cosmos DB using the SQL API, based on Spring Data framework.
- [Azure Spring Data Cosmos](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-data-cosmos/README.md) provides Spring Data support for Azure Cosmos DB using the SQL API, based on Spring Data framework.
- [Azure Cosmos Encryption](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos-encryption/README.md) supports encryption for Azure Cosmos DB using SQL API. This plugin library is still under development and not is not ready to be consumed yet.
- [Azure Cosmos Benchmark](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos-benchmark/README.md) is the benchmarking tool which provides different kinds of benchmarking workloads including but not limited to `readLatency`, `readThroughput`, `writeThroughput`, `readMyWrites`, etc.
- [Azure Cosmos DotNet Benchmark](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos-dotnet-benchmark/README.md) is the port of CosmosDB .NET benchmarking tool.
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos-spark_3-1_2-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ or contact [[email protected]][coc_contact] with any additional questions o
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
[coc_contact]: mailto:[email protected]
[azure_subscription]: https://azure.microsoft.com/free/
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[sql_api_query]: https://docs.microsoft.com/azure/cosmos-db/sql-api-sql-query
[local_emulator]: https://docs.microsoft.com/azure/cosmos-db/local-emulator
[local_emulator_export_ssl_certificates]: https://docs.microsoft.com/azure/cosmos-db/local-emulator-export-ssl-certificates
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos-spark_3-2_2-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ or contact [[email protected]][coc_contact] with any additional questions o
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
[coc_contact]: mailto:[email protected]
[azure_subscription]: https://azure.microsoft.com/free/
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[sql_api_query]: https://docs.microsoft.com/azure/cosmos-db/sql-api-sql-query
[local_emulator]: https://docs.microsoft.com/azure/cosmos-db/local-emulator
[local_emulator_export_ssl_certificates]: https://docs.microsoft.com/azure/cosmos-db/local-emulator-export-ssl-certificates
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos-spark_3-3_2-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ or contact [[email protected]][coc_contact] with any additional questions o
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
[coc_contact]: mailto:[email protected]
[azure_subscription]: https://azure.microsoft.com/free/
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[sql_api_query]: https://docs.microsoft.com/azure/cosmos-db/sql-api-sql-query
[local_emulator]: https://docs.microsoft.com/azure/cosmos-db/local-emulator
[local_emulator_export_ssl_certificates]: https://docs.microsoft.com/azure/cosmos-db/local-emulator-export-ssl-certificates
Expand Down

This file was deleted.

81 changes: 81 additions & 0 deletions sdk/cosmos/ci.spring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- hotfix/*
- release/*
paths:
include:
- sdk/cosmos/ci.spring.yml
- sdk/cosmos/azure-cosmos/
- sdk/cosmos/azure-cosmos-benchmark/
- sdk/cosmos/azure-cosmos-dotnet-benchmark/
- sdk/cosmos/azure-cosmos-encryption/
- sdk/cosmos/azure-cosmos-examples/
- sdk/cosmos/azure-cosmos-spark_3_2-12/
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/
- sdk/cosmos/azure-cosmos-test/
- sdk/cosmos/azure-cosmos-tests/
- sdk/cosmos/faq/
exclude:
- sdk/cosmos/pom.xml
- sdk/cosmos/azure-cosmos/pom.xml
- sdk/cosmos/azure-cosmos-tests/pom.xml
- sdk/cosmos/azure-cosmos-benchmark/pom.xml
- sdk/cosmos/azure-cosmos-dotnet-benchmark/pom.xml
- sdk/cosmos/azure-cosmos-encryption/pom.xml
- sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml -

pr:
branches:
include:
- main
- feature/*
- hotfix/*
- release/*
paths:
include:
- sdk/cosmos/ci.spring.yml
- sdk/cosmos/azure-cosmos/
- sdk/cosmos/azure-cosmos-benchmark/
- sdk/cosmos/azure-cosmos-dotnet-benchmark/
- sdk/cosmos/azure-cosmos-encryption/
- sdk/cosmos/azure-cosmos-examples/
- sdk/cosmos/azure-cosmos-test/
- sdk/cosmos/azure-cosmos-tests/
- sdk/cosmos/azure-cosmos-spark_3_2-12/
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/ -
- sdk/cosmos/faq/
exclude:
- sdk/cosmos/pom.xml
- sdk/cosmos/azure-cosmos/pom.xml
- sdk/cosmos/azure-cosmos-benchmark/pom.xml
- sdk/cosmos/azure-cosmos-dotnet-benchmark/pom.xml
- sdk/cosmos/azure-cosmos-encryption/pom.xml
- sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml -
- sdk/cosmos/azure-cosmos-test/pom.xml
- sdk/cosmos/azure-cosmos-tests/pom.xml

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: spring
Artifacts:
- name: azure-spring-data-cosmos
groupId: com.azure
safeName: azurespringdatacosmos
releaseInBatch: false
AdditionalModules:
- name: azure-spring-data-cosmos-test
groupId: com.azure
29 changes: 4 additions & 25 deletions sdk/cosmos/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ trigger:
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/
- sdk/cosmos/azure-cosmos-test/
- sdk/cosmos/azure-cosmos-tests/
- sdk/cosmos/azure-spring-data-cosmos/
- sdk/cosmos/azure-spring-data-cosmos-test/
- sdk/cosmos/faq/
- eng/pipelines/templates/stages/archetype-sdk-client.yml
- eng/pipelines/templates/jobs/ci.yml
exclude:
- sdk/cosmos/pom.xml
- sdk/cosmos/azure-cosmos/pom.xml
Expand All @@ -35,9 +31,7 @@ trigger:
- sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml -
- sdk/cosmos/azure-spring-data-cosmos/pom.xml
- sdk/cosmos/azure-spring-data-cosmos-test/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml

pr:
branches:
Expand All @@ -60,9 +54,7 @@ pr:
- sdk/cosmos/azure-cosmos-spark_3_2-12/
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/ -
- sdk/cosmos/azure-spring-data-cosmos/
- sdk/cosmos/azure-spring-data-cosmos-test/
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/
- sdk/cosmos/faq/
exclude:
- sdk/cosmos/pom.xml
Expand All @@ -73,21 +65,14 @@ pr:
- sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml -
- sdk/cosmos/azure-spring-data-cosmos/pom.xml
- sdk/cosmos/azure-spring-data-cosmos-test/pom.xml
- sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml
- sdk/cosmos/azure-cosmos-test/pom.xml
- sdk/cosmos/azure-cosmos-tests/pom.xml

parameters:
- name: release_azurecosmos
displayName: 'azure-cosmos'
type: boolean
default: true
- name: release_azurespringdatacosmos
displayName: 'azure-spring-data-cosmos'
type: boolean
default: true
- name: release_azurecosmosencryption
displayName: 'azure-cosmos-encryption'
type: boolean
Expand All @@ -110,7 +95,7 @@ parameters:
default: true

extends:
template: ../../eng/pipelines/templates/stages/cosmos-sdk-client.yml #NOTE: Non-standard template.
template: /eng/pipelines/templates/stages/cosmos-sdk-client.yml #NOTE: Non-standard template.
parameters:
ServiceDirectory: cosmos
EnableBatchRelease: true
Expand All @@ -120,10 +105,6 @@ extends:
groupId: com.azure
safeName: azurecosmos
releaseInBatch: ${{ parameters.release_azurecosmos }}
- name: azure-spring-data-cosmos
groupId: com.azure
safeName: azurespringdatacosmos
releaseInBatch: ${{ parameters.release_azurespringdatacosmos }}
- name: azure-cosmos-encryption
groupId: com.azure
safeName: azurecosmosencryption
Expand Down Expand Up @@ -158,7 +139,5 @@ extends:
groupId: com.azure
- name: azure-cosmos-benchmark
groupId: com.azure
- name: azure-spring-data-cosmos-test
groupId: com.azure
- name: azure-cosmos-spark_3_2-12
groupId: com.azure.cosmos.spark
2 changes: 0 additions & 2 deletions sdk/cosmos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
<module>azure-cosmos-benchmark</module>
<module>azure-cosmos-dotnet-benchmark</module>
<module>azure-cosmos-encryption</module>
<module>azure-spring-data-cosmos</module>
<module>azure-spring-data-cosmos-test</module>
<module>azure-cosmos-spark_3_2-12</module>
<module>azure-cosmos-spark_3-1_2-12</module>
<module>azure-cosmos-spark_3-2_2-12</module>
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ stages:
- $(sub-config-cosmos-azure-cloud-test-resources)
MatrixConfigs:
- Name: Cosmos_live_test_integration
Path: sdk/cosmos/integration-matrix.json
Path: sdk/spring/cosmos-integration-matrix.json
Selection: all
GenerateVMJobs: true
ServiceDirectory: cosmos
ServiceDirectory: spring
Artifacts:
- name: azure-spring-data-cosmos-test
groupId: com.azure
Expand Down
3 changes: 3 additions & 0 deletions sdk/spring/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ This section includes changes in `spring-cloud-azure-appconfiguration-config` an
- spring-cloud-azure-feature-management
- spring-cloud-azure-feature-management-web

#### Features Added
- The module `azure-spring-data-cosmos` was moved from sdk/cosmos to sdk/spring - See [PR 33905](https://github.com/Azure/azure-sdk-for-java/pull/33905)

### Spring Messaging Event Hubs
This section includes changes in `spring-messaging-azure-eventhubs` module.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<packaging>jar</packaging>
<name>Spring Data Test for Azure Cosmos DB SQL API</name>
<description>Spring Data Test for Azure Cosmos DB SQL API</description>
<url>https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-spring-data-cosmos-test</url>
<url>https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-data-cosmos-test</url>

<properties>
<azure.test.resourcegroup>azure-spring-data-cosmos-test</azure.test.resourcegroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.azure.spring.data.cosmos.repository.TestRepositoryConfig;
import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.azure.cosmos.CosmosAsyncClient;
import com.azure.cosmos.CosmosClientBuilder;
import com.azure.cosmos.implementation.TestConfigurations;
import com.azure.spring.data.cosmos.repository.TestRepositoryConfig;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import com.azure.cosmos.models.IndexingMode;
import com.azure.spring.data.cosmos.domain.Address;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.Arrays;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import com.azure.spring.data.cosmos.domain.Person;
import com.azure.spring.data.cosmos.exception.CosmosAccessException;
import com.azure.spring.data.cosmos.repository.TestRepositoryConfig;
import com.azure.spring.data.cosmos.repository.repository.AuditableRepository;
import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.azure.spring.data.cosmos.domain.Address;
import com.azure.spring.data.cosmos.exception.CosmosAccessException;
import com.azure.spring.data.cosmos.repository.TestRepositoryConfig;
import com.azure.spring.data.cosmos.repository.repository.AddressRepository;
import com.azure.spring.data.cosmos.repository.repository.ReactiveAddressRepository;
import org.assertj.core.util.Lists;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

package com.azure.spring.data.cosmos.domain;

import com.azure.spring.data.cosmos.common.TestConstants;
import com.azure.spring.data.cosmos.core.mapping.Container;
import com.azure.spring.data.cosmos.core.mapping.CosmosIndexingPolicy;
import com.azure.spring.data.cosmos.core.mapping.PartitionKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.spring.data.cosmos.repository;

import com.azure.spring.data.cosmos.common.DynamicContainer;
import com.azure.spring.data.cosmos.common.TestConstants;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TestRepositorySpELConfig extends TestRepositoryConfig {

@Bean
public DynamicContainer dynamicContainer() {
return new DynamicContainer(TestConstants.DYNAMIC_BEAN_COLLECTION_NAME);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cosmos.uri=${ACCOUNT_HOST}
cosmos.key=${ACCOUNT_KEY}
cosmos.secondaryKey=${SECONDARY_ACCOUNT_KEY}
cosmos.uri=${COSMOS_SPRING_ACCOUNT_HOST}
cosmos.key=${COSMOS_SPRING_ACCOUNT_KEY}
cosmos.secondaryKey=${COSMOS_SPRING_SECONDARY_ACCOUNT_KEY}

dynamic.collection.name=spel-property-collection
# Populate query metrics
Expand All @@ -13,9 +13,9 @@ cosmos.maxBufferedItemCount=0
cosmos.responseContinuationTokenLimitInKb=0

# Secondary DataSource Config
cosmos.secondary.uri=${NEW_ACCOUNT_HOST}
cosmos.secondary.key=${NEW_ACCOUNT_KEY}
cosmos.secondary.secondaryKey=${NEW_SECONDARY_ACCOUNT_KEY}
cosmos.secondary.uri=${COSMOS_SPRING_NEW_ACCOUNT_HOST}
cosmos.secondary.key=${COSMOS_SPRING_NEW_ACCOUNT_KEY}
cosmos.secondary.secondaryKey=${COSMOS_SPRING_NEW_SECONDARY_ACCOUNT_KEY}

# Populate query metrics
cosmos.secondary.queryMetricsEnabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### Bugs Fixed

#### Other Changes
* The module `azure-spring-data-cosmos` was moved from sdk/cosmos to sdk/spring - See [PR 33905](https://github.com/Azure/azure-sdk-for-java/pull/33905)

### 3.34.0 (2023-04-21)
#### Breaking Changes
Expand Down
Loading

0 comments on commit 47c6278

Please sign in to comment.