Skip to content

Conversation

@TheovanKraay
Copy link
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, or chat mode file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, or chat mode with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

Instructions file for converting Cassandra applications to using Azure Cosmos DB (with Spring Data Cosmos module).


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New chat mode file.
  • New collection file.
  • Update to existing instruction, prompt, chat mode, or collection.
  • Other (please specify):

Additional Notes


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive instruction file for converting Spring Boot applications from Apache Cassandra to Azure Cosmos DB using Spring Data Cosmos. The guide is based on real-world conversion experience and provides detailed step-by-step instructions covering dependency updates, configuration changes, entity conversion, repository updates, and troubleshooting.

Key Changes

  • New instruction file: convert-cassandra-to-spring-data-cosmos.instructions.md (1,114 lines) providing detailed conversion guidance
  • README update: Added entry in the instructions table for the new file with appropriate install badges

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
instructions/convert-cassandra-to-spring-data-cosmos.instructions.md Comprehensive 11-step guide covering Cassandra to Cosmos DB conversion, including dependency management, entity/repository conversion, authentication setup, and troubleshooting for 10+ common issues
docs/README.instructions.md Added table entry for the new instruction file with VS Code and VS Code Insiders install links

**Problem**: Test files reference old Cassandra DAOs and use UUID constructors.
**Critical Files to Update**:
1. Remove `MockReactiveResultSet.java` (Cassandra-specific)
2. Update `*ReactiveSer vicesTest.java` - replace DAO references with Cosmos repositories
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo: "ReactiveSer vices" should be "ReactiveServices" (no space).

Suggested change
2. Update `*ReactiveSer vicesTest.java` - replace DAO references with Cosmos repositories
2. Update `*ReactiveServicesTest.java` - replace DAO references with Cosmos repositories

Copilot uses AI. Check for mistakes.
entity1.setField2("value2");
```

**Common files to check**: DataSeeder, DatabaseInitializer, TestDataLoader, or any `@Component` implementing `CommandLineRunner`erEntity owner1 = new OwnerEntity();
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to have corrupted text. After "CommandLineRunner" there's extra text that doesn't belong: "erEntity owner1 = new OwnerEntity();". This seems to be accidentally merged from a code example. The line should end after "CommandLineRunner".

Suggested change
**Common files to check**: DataSeeder, DatabaseInitializer, TestDataLoader, or any `@Component` implementing `CommandLineRunner`erEntity owner1 = new OwnerEntity();
**Common files to check**: DataSeeder, DatabaseInitializer, TestDataLoader, or any `@Component` implementing `CommandLineRunner`
```java
OwnerEntity owner1 = new OwnerEntity();

Copilot uses AI. Check for mistakes.
Comment on lines +818 to +823
### 8. Test Updates

#### Update Test Classes

**CRITICAL**: All test files must be updated to work with String IDs and Cosmos repositories

Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate section header and content. The heading "### 8. Test Updates" and "#### Update Test Classes" are repeated on lines 811-815 and then again on lines 818-820. The duplicate content should be removed to maintain clean documentation structure.

Suggested change
### 8. Test Updates
#### Update Test Classes
**CRITICAL**: All test files must be updated to work with String IDs and Cosmos repositories

Copilot uses AI. Check for mistakes.
**Root Cause**: Different data distribution strategies
**Solution**: Choose appropriate partition key based on query patterns, typically the most frequently queried field

#### Issue 9: UUID to String conversion issues
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two different "Issue 9" entries in the troubleshooting section. Line 936 has "Issue 9: RBAC permission errors" and line 971 has "Issue 9: UUID to String conversion issues". The second one should be renumbered to "Issue 10" to maintain sequential numbering.

Suggested change
#### Issue 9: UUID to String conversion issues
#### Issue 10: UUID to String conversion issues

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@aaronpowell aaronpowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot has noted some things that might be some typing mistakes or copy/paste errors @TheovanKraay - can you review them and apply (or close) as relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants