-
Notifications
You must be signed in to change notification settings - Fork 81
Feature/add mis endpoints in col #695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/add mis endpoints in col #695
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add note to the Changelog.md
8751904
to
307a260
Compare
There was a problem hiding this 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 several missing collection-related API endpoints to the v2 client library, expanding collection management capabilities. The implementation includes 9 new endpoints for collection statistics, revision tracking, checksum calculations, shard management, index operations, renaming, count recalculation, and compaction.
- Implements collection statistics, revision, checksum, and shard management endpoints
- Adds index loading, collection renaming, count recalculation, and compaction operations
- Includes comprehensive test coverage for all new endpoints with proper environment validation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
v2/arangodb/collection.go | Adds method signatures for 8 new collection operations |
v2/arangodb/collection_impl.go | Implements the collection endpoint methods with proper HTTP handling |
v2/arangodb/collection_opts.go | Defines request/response structs for new collection operations |
v2/arangodb/database.go | Adds KeyGenerators method to Database interface |
v2/arangodb/database_impl.go | Implements KeyGenerators endpoint for database |
v2/arangodb/database_opts.go | Defines KeyGeneratorsResponse struct |
v2/tests/database_collection_operations_test.go | Comprehensive test coverage for all new collection endpoints |
v2/tests/database_transactions_test.go | Test for database KeyGenerators endpoint |
v2/tests/graph_helper_test.go | Updates graph helper to include database name in graph naming |
v2/CHANGELOG.md | Documents the addition of missing collection endpoints |
Comments suppressed due to low confidence (1)
v2/arangodb/collection_opts.go:400
- [nitpick] The struct ResponsibleShardRequest has a field 'Key' but the JSON tag is '_key'. This inconsistency could be confusing. Consider renaming the field to match the JSON convention or vice versa.
Key string `json:"_key,omitempty"`
v2/arangodb/collection_impl.go
Outdated
if *withRevisions { | ||
modifiers = append(modifiers, connection.WithQuery("withRevisions", boolToString(*withRevisions))) | ||
} | ||
if *withData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential nil pointer dereference. The function should check if withRevisions is nil before dereferencing it.
if *withRevisions { | |
modifiers = append(modifiers, connection.WithQuery("withRevisions", boolToString(*withRevisions))) | |
} | |
if *withData { | |
if withRevisions != nil && *withRevisions { | |
modifiers = append(modifiers, connection.WithQuery("withRevisions", boolToString(*withRevisions))) | |
} | |
if withData != nil && *withData { |
Copilot uses AI. Check for mistakes.
v2/arangodb/collection_impl.go
Outdated
if *withRevisions { | ||
modifiers = append(modifiers, connection.WithQuery("withRevisions", boolToString(*withRevisions))) | ||
} | ||
if *withData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential nil pointer dereference. The function should check if withData is nil before dereferencing it.
if *withRevisions { | |
modifiers = append(modifiers, connection.WithQuery("withRevisions", boolToString(*withRevisions))) | |
} | |
if *withData { | |
if withRevisions != nil && *withRevisions { | |
modifiers = append(modifiers, connection.WithQuery("withRevisions", boolToString(*withRevisions))) | |
} | |
if withData != nil && *withData { |
Copilot uses AI. Check for mistakes.
|
||
result, err := col.Compact(ctx) | ||
require.NoError(t, err) | ||
fmt.Printf("Compacted Collection: %s, ID: %s, Status: %d\n", result.Name, result.ID, result.Status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using fmt.Printf in tests is not recommended. Consider using t.Logf() instead for proper test logging.
fmt.Printf("Compacted Collection: %s, ID: %s, Status: %d\n", result.Name, result.ID, result.Status) | |
t.Logf("Compacted Collection: %s, ID: %s, Status: %d", result.Name, result.ID, result.Status) |
Copilot uses AI. Check for mistakes.
This includes the following collection-related endpoints: