Skip to content

Added missing properties. Fixed dynamo ops#63

Merged
Im5tu merged 3 commits intomainfrom
updates
Jan 14, 2026
Merged

Added missing properties. Fixed dynamo ops#63
Im5tu merged 3 commits intomainfrom
updates

Conversation

@Im5tu
Copy link
Owner

@Im5tu Im5tu commented Jan 14, 2026

Summary by CodeRabbit

  • New Features

    • Specify return values when conditional checks fail (Put/Delete/Update/transactions)
    • Include item-collection metrics in responses
    • Option to request consumed-capacity details in transactional gets
    • Serialization support for new types
  • Improvements

    • Lazy initialization/conditional merging of expression attribute maps
    • Stricter index name and limit validation for queries
  • Tests

    • Extensive coverage for condition expressions, builder chaining, and serialization behaviors

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Adds support for returning attribute values on conditional check failures and reporting item-collection metrics. Introduces new enum and model types, extends request/response shapes and transaction items, adds builder fluent APIs, tightens condition-expression merging, updates JSON source-gen, and adds tests.

Changes

Cohort / File(s) Summary
Enums & Models
src/Clients/Goa.Clients.Dynamo/Enums/ReturnValuesOnConditionCheckFailure.cs, src/Clients/Goa.Clients.Dynamo/Models/ItemCollectionMetrics.cs
New enum ReturnValuesOnConditionCheckFailure (NONE, ALL_OLD) and new model ItemCollectionMetrics with ItemCollectionKey and SizeEstimateRangeGB.
DeleteItem
src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs, .../DeleteItemRequest.cs, .../DeleteItemResponse.cs
Added WithReturnValuesOnConditionCheckFailure builder method; builder condition-expression merging now guards empty parts. Request: added ReturnValuesOnConditionCheckFailure (default NONE). Response: added ItemCollectionMetrics.
PutItem
src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemBuilder.cs, .../PutItemRequest.cs
Added WithReturnValuesOnConditionCheckFailure builder method; tightened conditional merging. Request: added ReturnValuesOnConditionCheckFailure (default NONE).
UpdateItem
src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs, .../UpdateItemRequest.cs, .../UpdateItemResponse.cs
Added WithReturnValuesOnConditionCheckFailure builder method; guarded condition merging. Request: added ReturnValuesOnConditionCheckFailure (default NONE) and removed default initializer from ExpressionAttributeValues. Response: added ItemCollectionMetrics.
Batch
src/Clients/Goa.Clients.Dynamo/Operations/Batch/BatchWriteItemResponse.cs
Added ItemCollectionMetrics property (per-table map of lists).
Query & Scan
src/Clients/Goa.Clients.Dynamo/Operations/Query/QueryBuilder.cs, src/Clients/Goa.Clients.Dynamo/Operations/Scan/ScanBuilder.cs
Builders now initialize/merge attribute name/value maps only when non-empty. QueryBuilder made partial, adds generated regex for index-name validation and enforces WithIndex length/pattern; WithLimit validates >= 1.
Transactions
src/Clients/Goa.Clients.Dynamo/Operations/Transactions/... (e.g., TransactConditionCheckItem.cs, TransactDeleteItem.cs, TransactPutItem.cs, TransactUpdateItem.cs, TransactGetBuilder.cs, TransactGetRequest.cs)
Transaction item classes gain ReturnValuesOnConditionCheckFailure (default NONE) where applicable. TransactGetBuilder/TransactGetRequest add ReturnConsumedCapacity support and builder method.
Serialization
src/Clients/Goa.Clients.Dynamo/Serialization/DynamoJsonContext.cs
Added JsonSerializable entries for ReturnValuesOnConditionCheckFailure and ItemCollectionMetrics to source-generated JSON context.
Tests
tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs, tests/Clients/Goa.Clients.Dynamo.Tests/BuilderChainingTests.cs
New comprehensive ConditionExpressionValuesTests covering all condition variants and builder interactions. BuilderChainingTests extended with WithReturnValuesOnConditionCheckFailure coverage and serialization assertions; one expected expression formatting tweak.
🚥 Pre-merge checks | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided; the required template sections (checklist items) are completely missing. Provide a description using the template, including checklist items for tests, Native AOT compatibility, documentation, and self-review completion.
Docstring Coverage ⚠️ Warning Docstring coverage is 19.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'Fixed dynamo ops' that don't clearly convey what changed. Use a more specific title describing the main feature or fix, such as 'Add ReturnValuesOnConditionCheckFailure support to DynamoDB operations' or 'Add ItemCollectionMetrics support and improve condition handling'.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7100af5 and 27e9cc5.

📒 Files selected for processing (1)
  • tests/Clients/Goa.Clients.Dynamo.Tests/BuilderChainingTests.cs
🧰 Additional context used
🧬 Code graph analysis (1)
tests/Clients/Goa.Clients.Dynamo.Tests/BuilderChainingTests.cs (6)
tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs (16)
  • Test (20-32)
  • Test (34-46)
  • Test (48-59)
  • Test (65-77)
  • Test (79-91)
  • Test (93-104)
  • Test (110-122)
  • Test (124-136)
  • Test (138-149)
  • Test (155-166)
  • Test (168-179)
  • Test (181-191)
  • Test (197-210)
  • Test (212-225)
  • Test (227-240)
  • Test (246-257)
src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs (8)
  • DeleteItemBuilder (11-126)
  • DeleteItemBuilder (25-29)
  • DeleteItemBuilder (37-66)
  • DeleteItemBuilder (74-83)
  • DeleteItemBuilder (90-94)
  • DeleteItemBuilder (101-105)
  • DeleteItemBuilder (112-116)
  • DeleteItemRequest (122-125)
src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemBuilder.cs (8)
  • PutItemBuilder (11-120)
  • PutItemBuilder (24-28)
  • PutItemBuilder (36-40)
  • PutItemBuilder (48-77)
  • PutItemBuilder (84-88)
  • PutItemBuilder (95-99)
  • PutItemBuilder (106-110)
  • PutItemRequest (116-119)
src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs (17)
  • UpdateItemBuilder (13-953)
  • UpdateItemBuilder (33-37)
  • UpdateItemBuilder (47-57)
  • UpdateItemBuilder (64-76)
  • UpdateItemBuilder (84-97)
  • UpdateItemBuilder (106-126)
  • UpdateItemBuilder (134-147)
  • UpdateItemBuilder (156-169)
  • UpdateItemBuilder (177-188)
  • UpdateItemBuilder (198-198)
  • UpdateItemBuilder (204-204)
  • UpdateItemBuilder (210-210)
  • UpdateItemBuilder (216-216)
  • UpdateItemBuilder (222-222)
  • UpdateItemBuilder (228-228)
  • UpdateItemBuilder (234-234)
  • UpdateItemRequest (876-906)
src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemRequest.cs (1)
  • DeleteItemRequest (9-57)
tests/Clients/Goa.Clients.Dynamo.Generator.Tests/Helpers/CodeComparisonUtilities.cs (1)
  • Contains (114-123)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (4)
tests/Clients/Goa.Clients.Dynamo.Tests/BuilderChainingTests.cs (4)

1-11: LGTM!

The new imports are correctly added and required for the new test methods covering ReturnValuesOnConditionCheckFailure and JSON serialization tests.


112-113: LGTM!

The updated expected expression correctly reflects the tightened condition-expression merging logic where each condition is wrapped in parentheses before combining with AND. This ensures proper precedence for complex condition expressions.


225-297: LGTM!

Good test coverage for ReturnValuesOnConditionCheckFailure across all three builder types (DeleteItem, PutItem, UpdateItem) with both ALL_OLD and NONE variants. The tests follow consistent patterns and properly verify the fluent API propagates values to the built requests.


299-337: Tests are correct and address distinct concerns.

These serialization tests appropriately verify that the ReturnValuesOnConditionCheckFailure property is correctly serialized to JSON using the source-generated DynamoJsonContext for all three builder types. They do not duplicate tests in ConditionExpressionValuesTests.cs, which focuses on condition expression handling and expression attribute values.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemRequest.cs`:
- Around line 52-56: DynamoJsonContext is missing an explicit JsonSerializable
registration for the enum ReturnValuesOnConditionCheckFailure and there is no
test ensuring WithReturnValuesOnConditionCheckFailure() gets serialized; add
[JsonSerializable(typeof(ReturnValuesOnConditionCheckFailure))] to the
DynamoJsonContext attribute list (alongside ReturnValues,
ReturnConsumedCapacity, ReturnItemCollectionMetrics) so the enum is explicitly
wired into the source-generated JSON context, then add a unit test that uses the
DeleteItem request builder (call
WithReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure.ALL_OLD)
or NONE) and asserts the produced serialized request includes the correct
ReturnValuesOnConditionCheckFailure value sent to DynamoDB (mirroring existing
builder tests for ReturnValues).

In `@src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemRequest.cs`:
- Around line 51-55: DynamoJsonContext is missing a JsonSerializable entry for
the new enum type ReturnValuesOnConditionCheckFailure; add a JsonSerializable
attribute for that enum to DynamoJsonContext (i.e., add
[JsonSerializable(typeof(ReturnValuesOnConditionCheckFailure))] alongside the
existing entries for ReturnValues, ReturnConsumedCapacity, and
ReturnItemCollectionMetrics) so the enum is explicitly registered for the
source-generated JSON context and AOT compilation.

In `@src/Clients/Goa.Clients.Dynamo/Operations/Query/QueryBuilder.cs`:
- Around line 66-81: The XML doc for QueryBuilder.WithIndex is incorrect: length
validation uses ArgumentOutOfRangeException while invalid-pattern uses
ArgumentException; update the <exception> tags for WithIndex to document
ArgumentOutOfRangeException for length checks (when indexName.Length < 3 or >
255) and keep/document ArgumentException for pattern validation (when
IndexNamePattern().IsMatch fails), ensuring the summary matches the actual
thrown exceptions.

In `@src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs`:
- Around line 803-820: UpdateItemBuilder.WithCondition currently overwrites
prior conditions and doesn't guard against empty condition.Expression; change it
to match DeleteItemBuilder's multi-condition behavior: if condition.Expression
is null or empty, return without modifying; if _request.ConditionExpression is
null or empty set it to condition.Expression, otherwise set it to "(" +
_request.ConditionExpression + ") AND (" + condition.Expression + ")"; keep the
existing ExpressionAttributeNames/ExpressionAttributeValues merge logic (using
_request.ExpressionAttributeNames ??= ... and Merge) so attribute maps still
combine across calls. Also apply the same empty-expression guard pattern to
PutItemBuilder.WithCondition to ensure consistent behavior across builders.
- Around line 844-853: Add unit tests mirroring the existing
UpdateItemBuilder_WithCondition_* patterns (see ConditionExpressionValuesTests)
that verify UpdateItemBuilder.WithReturnValuesOnConditionCheckFailure(...) and
UpdateItemBuilder.WithReturnValues(...) correctly propagate values into the
built request; instantiate an UpdateItemBuilder, call the method under test with
each relevant enum value, call Build() (or however the request is produced in
tests), and assert the resulting request's ReturnValuesOnConditionCheckFailure
and ReturnValues properties equal the values passed.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2af432 and 670ae60.

📒 Files selected for processing (20)
  • src/Clients/Goa.Clients.Dynamo/Enums/ReturnValuesOnConditionCheckFailure.cs
  • src/Clients/Goa.Clients.Dynamo/Models/ItemCollectionMetrics.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Batch/BatchWriteItemResponse.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemRequest.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemResponse.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemBuilder.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemRequest.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Query/QueryBuilder.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Scan/ScanBuilder.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactConditionCheckItem.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactDeleteItem.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactGetBuilder.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactGetRequest.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactPutItem.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactUpdateItem.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemRequest.cs
  • src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemResponse.cs
  • tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs
🧰 Additional context used
🧬 Code graph analysis (4)
src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemResponse.cs (1)
src/Clients/Goa.Clients.Dynamo/Models/ItemCollectionMetrics.cs (1)
  • ItemCollectionMetrics (6-18)
src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemResponse.cs (1)
src/Clients/Goa.Clients.Dynamo/Models/ItemCollectionMetrics.cs (1)
  • ItemCollectionMetrics (6-18)
src/Clients/Goa.Clients.Dynamo/Operations/Batch/BatchWriteItemResponse.cs (1)
src/Clients/Goa.Clients.Dynamo/Models/ItemCollectionMetrics.cs (1)
  • ItemCollectionMetrics (6-18)
tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs (5)
src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemBuilder.cs (7)
  • PutItemBuilder (11-107)
  • PutItemBuilder (24-28)
  • PutItemBuilder (36-40)
  • PutItemBuilder (47-64)
  • PutItemBuilder (71-75)
  • PutItemBuilder (82-86)
  • PutItemBuilder (93-97)
src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs (7)
  • DeleteItemBuilder (11-120)
  • DeleteItemBuilder (25-29)
  • DeleteItemBuilder (36-60)
  • DeleteItemBuilder (68-77)
  • DeleteItemBuilder (84-88)
  • DeleteItemBuilder (95-99)
  • DeleteItemBuilder (106-110)
src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs (16)
  • UpdateItemBuilder (13-940)
  • UpdateItemBuilder (33-37)
  • UpdateItemBuilder (47-57)
  • UpdateItemBuilder (64-76)
  • UpdateItemBuilder (84-97)
  • UpdateItemBuilder (106-126)
  • UpdateItemBuilder (134-147)
  • UpdateItemBuilder (156-169)
  • UpdateItemBuilder (177-188)
  • UpdateItemBuilder (198-198)
  • UpdateItemBuilder (204-204)
  • UpdateItemBuilder (210-210)
  • UpdateItemBuilder (216-216)
  • UpdateItemBuilder (222-222)
  • UpdateItemBuilder (228-228)
  • UpdateItemBuilder (234-234)
src/Clients/Goa.Clients.Dynamo/Operations/Query/QueryBuilder.cs (13)
  • QueryBuilder (12-234)
  • QueryBuilder (24-48)
  • QueryBuilder (55-59)
  • QueryBuilder (67-85)
  • QueryBuilder (96-105)
  • QueryBuilder (111-115)
  • QueryBuilder (121-125)
  • QueryBuilder (132-142)
  • QueryBuilder (149-159)
  • QueryBuilder (166-170)
  • QueryBuilder (177-181)
  • QueryBuilder (188-192)
  • QueryBuilder (200-224)
src/Clients/Goa.Clients.Dynamo/Operations/Scan/ScanBuilder.cs (11)
  • ScanBuilder (11-173)
  • ScanBuilder (23-47)
  • ScanBuilder (54-58)
  • ScanBuilder (65-69)
  • ScanBuilder (76-80)
  • ScanBuilder (87-97)
  • ScanBuilder (104-114)
  • ScanBuilder (121-125)
  • ScanBuilder (132-136)
  • ScanBuilder (144-152)
  • ScanBuilder (159-163)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (23)
src/Clients/Goa.Clients.Dynamo/Operations/Scan/ScanBuilder.cs (1)

34-44: Good: conditional merge avoids mutating request with empty expression maps.

Condition.ExpressionNames and Condition.ExpressionValues are always initialized as empty dictionaries, so calling .Count is safe. The pattern correctly checks before merging to keep the request clean.

src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactPutItem.cs (1)

1-2: Mapping and serialization are correctly configured.

TransactPutItem is registered in DynamoJsonContext with [JsonSerializable] and the enum serialization is handled by UseStringEnumConverter = true at the context level, so ReturnValuesOnConditionCheckFailure values will be emitted as strings.

Minor note: This file has a UTF-8 BOM ()—consider normalizing encoding across the repo if inconsistent elsewhere.

src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactDeleteItem.cs (1)

1-2: TransactDeleteItem correctly integrated. The using statements (lines 1-2) are properly added, the ReturnValuesOnConditionCheckFailure property is present at line 40 with default NONE, and the class is wired into the transact payload via TransactWriteItem.DeleteTransactWriteRequest.TransactItems. The DynamoJsonContext configuration uses UseStringEnumConverter = true (line 22), ensuring enum values serialize as strings.

src/Clients/Goa.Clients.Dynamo/Enums/ReturnValuesOnConditionCheckFailure.cs (1)

1-17: Enum will serialize to Dynamo string values by default; no custom converter needed.
AWS SDK .NET serializes enums to DynamoDB strings automatically. Your enum members (NONE, ALL_OLD) will emit as string tokens matching DynamoDB's expected values. However, verify in integration tests that the request/response mappers correctly integrate this enum with DynamoDB operations.

src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactConditionCheckItem.cs (1)

1-1: Looks good — but ensure request serialization/mapping matches DynamoDB’s expected values for ReturnValuesOnConditionCheckFailure.

If this library translates to AWS SDK models, please confirm NONE / ALL_OLD are emitted exactly as DynamoDB expects (and that the property is included in the transaction condition-check payload only when supported).

Also applies to: 35-40

src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactUpdateItem.cs (1)

1-2: LGTM — same note: verify enum serialization/mapping for ReturnValuesOnConditionCheckFailure.

Also applies to: 40-45

src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemBuilder.cs (2)

47-64: Good: avoid creating/merging empty ExpressionAttribute dictionaries.*

Please sanity-check Goa.Core.Merge(...) behavior on key collisions (overwrite vs exception) since this method is now the only place that merges condition maps into the request.


88-97: Nice fluent addition for ReturnValuesOnConditionCheckFailure.

src/Clients/Goa.Clients.Dynamo/Models/ItemCollectionMetrics.cs (1)

1-18: LGTM — model matches DynamoDB’s “item collection metrics” shape.

Just confirm your serializer’s naming policy keeps SizeEstimateRangeGB aligned with the upstream payload field name you’re consuming/producing.

src/Clients/Goa.Clients.Dynamo/Operations/Query/QueryBuilder.cs (3)

35-46: Good: only merge ExpressionAttribute when condition provides entries.*

Also applies to: 211-222


95-104: Good guardrail: limit must be >= 1.


12-12: [GeneratedRegex] is fully compatible with the project configuration. The project targets net9.0 and net10.0 with LangVersion set to latest, which exceeds the requirements for the [GeneratedRegex] attribute and partial method support (net7.0+ and C# 11+).

src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemResponse.cs (1)

20-23: Verify compilation and response mapping for ItemCollectionMetrics.
Same note as UpdateItemResponse: add using System.Collections.Generic; if implicit/global usings aren’t enabled, and confirm deserialization maps the DynamoDB field correctly.

Proposed minimal compile-safety tweak (if implicit/global usings are NOT enabled)
+using System.Collections.Generic;
 using Goa.Clients.Dynamo.Models;
src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemRequest.cs (2)

34-34: No issue found. All callers use ??= coalescing assignment before accessing ExpressionAttributeValues.

The nullable change is safe. Every access in UpdateItemBuilder, QueryBuilder, ScanBuilder, PutItemBuilder, and DeleteItemBuilder follows the pattern of _request.ExpressionAttributeValues ??= new(...) before calling .Count, .Merge(), or indexing. No unsafe read patterns exist, and System.Text.Json serialization handles null properties correctly by omitting them (standard DynamoDB API behavior).

Likely an incorrect or invalid review comment.


56-60: ReturnValuesOnConditionCheckFailure serialization verified as correct.

Enum values (NONE, ALL_OLD) and property field name match DynamoDB's API contract. The serialization context uses UseStringEnumConverter = true with PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified, ensuring enums serialize as exact uppercase strings and the property name remains unchanged in the request.

src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemResponse.cs (1)

20-23: No changes needed—ImplicitUsings is enabled project-wide.

The project's root Directory.Build.props has <ImplicitUsings>enable</ImplicitUsings>, so System.Collections.Generic is available implicitly. The ItemCollectionMetrics class is properly defined in the Models folder and follows AWS DynamoDB naming conventions. No explicit using statement is required, and the property will compile correctly as-is.

Likely an incorrect or invalid review comment.

src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactGetRequest.cs (2)

15-18: Property addition looks consistent with the builder and AWS shape.


1-1: This comment is incorrect. The enum serialization is properly configured. DynamoJsonContext explicitly sets UseStringEnumConverter = true in its [JsonSourceGenerationOptions] attribute (line 22), which ensures all enums in this context—including ReturnConsumedCapacity—serialize to string values ("NONE", "INDEXES", "TOTAL") as expected by DynamoDB, not numeric values.

Likely an incorrect or invalid review comment.

src/Clients/Goa.Clients.Dynamo/Operations/Batch/BatchWriteItemResponse.cs (1)

26-30: ItemCollectionMetrics response surface addition looks correct and consistent with the model.

src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs (2)

47-57: Good fix: don’t allocate/merge empty ExpressionAttributeNames/Values maps.


101-110: No action needed. The ReturnValuesOnConditionCheckFailure enum is already properly configured with string serialization (via UseStringEnumConverter = true in DynamoJsonContext.cs) and scoped to only the two values supported by AWS DynamoDB: NONE and ALL_OLD. The strongly-typed parameter in the builder method provides compile-time type safety, preventing invalid values from ever being passed.

Likely an incorrect or invalid review comment.

tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs (1)

11-15: Nice: tests explicitly lock in the “null, not empty dictionary” behavior to prevent the DynamoDB ValidationException regression.

src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactGetBuilder.cs (1)

1-1: WithReturnConsumedCapacity is a clean fluent addition with complete end-to-end serialization coverage.

The ReturnConsumedCapacity property is properly defined in TransactGetRequest, correctly set by the builder method, registered as [JsonSerializable], and ultimately passed to DynamoServiceClient.SendAsync. The implementation follows the established pattern across other builders in the codebase (TransactWriteBuilder, ScanBuilder, QueryBuilder, etc.).

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +52 to +56
/// <summary>
/// Specifies how to return attribute values when a conditional check fails.
/// Use ALL_OLD to return all attributes of the item as they appeared before the operation.
/// </summary>
public ReturnValuesOnConditionCheckFailure ReturnValuesOnConditionCheckFailure { get; set; } = ReturnValuesOnConditionCheckFailure.NONE;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

git ls-files | grep -E "(Delete|Dynamo)" | head -20

Repository: Im5tu/goa

Length of output: 1599


🏁 Script executed:

find . -name "*DeleteItem*" -o -name "*ReturnValuesOnConditionCheckFailure*" | head -20

Repository: Im5tu/goa

Length of output: 493


🏁 Script executed:

fd -t f "DeleteItemRequest" | head -10

Repository: Im5tu/goa

Length of output: 126


🏁 Script executed:

fd -t f "ReturnValuesOnConditionCheckFailure" | head -10

Repository: Im5tu/goa

Length of output: 128


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Enums/ReturnValuesOnConditionCheckFailure.cs

Repository: Im5tu/goa

Length of output: 595


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemRequest.cs

Repository: Im5tu/goa

Length of output: 2759


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs

Repository: Im5tu/goa

Length of output: 5725


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemResponse.cs

Repository: Im5tu/goa

Length of output: 1002


🏁 Script executed:

find . -path "*/DeleteItem*" -name "*.cs" | xargs ls -la

Repository: Im5tu/goa

Length of output: 428


🏁 Script executed:

find . -name "*Serializer*" -o -name "*WireModel*" -o -name "*Wire*" | grep -i dynamo

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

fd -t f "DeleteItem" --exec grep -l "ReturnValuesOnConditionCheckFailure" {} \;

Repository: Im5tu/goa

Length of output: 283


🏁 Script executed:

fd -t f "Test" | grep -i deleteitem

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

git ls-files | grep -i test | head -20

Repository: Im5tu/goa

Length of output: 1737


🏁 Script executed:

find . -name "*.Tests.cs" -o -name "*Tests" -type d | head -10

Repository: Im5tu/goa

Length of output: 379


🏁 Script executed:

rg "ReturnValuesOnConditionCheckFailure" --type cs

Repository: Im5tu/goa

Length of output: 2823


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Operations/Transactions/TransactDeleteItem.cs

Repository: Im5tu/goa

Length of output: 1827


🏁 Script executed:

find . -path "*/DeleteItem*" -o -name "*Serializer*" | xargs rg -l "DeleteItem" 2>/dev/null | head -10

Repository: Im5tu/goa

Length of output: 510


🏁 Script executed:

fd -t f "Dynamo.*Test" tests/Clients/Goa.Clients.Dynamo.Tests/

Repository: Im5tu/goa

Length of output: 254


🏁 Script executed:

ls -la tests/Clients/Goa.Clients.Dynamo.Tests/

Repository: Im5tu/goa

Length of output: 630


🏁 Script executed:

find tests/Clients/Goa.Clients.Dynamo.Tests -name "*.cs" | grep -i delete

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

rg "DeleteItem" tests/Clients/Goa.Clients.Dynamo.Tests/ -C 3

Repository: Im5tu/goa

Length of output: 10190


🏁 Script executed:

rg "ReturnValuesOnConditionCheckFailure" tests/ -C 2

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

cat -n tests/Clients/Goa.Clients.Dynamo.Tests/DynamoClientIntegrationTests.cs | head -100

Repository: Im5tu/goa

Length of output: 3900


🏁 Script executed:

find . -name "*.cs" -path "*/Dynamo/*" | xargs rg -l "ToJson|Serialize|Wire" | head -5

Repository: Im5tu/goa

Length of output: 315


🏁 Script executed:

find . -name "*.cs" -path "*/Dynamo/*" | xargs rg -l "JsonSerializableAttribute|JsonConverter|JsonPropertyName" | head -10

Repository: Im5tu/goa

Length of output: 785


🏁 Script executed:

find . -name "*Client*.cs" -path "*/Dynamo/*" | head -10

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

fd -t f "DynamoClient" | grep -v Test | head -5

Repository: Im5tu/goa

Length of output: 100


🏁 Script executed:

cat -n $(fd -t f "DynamoClient" | grep -v Test | head -1)

Repository: Im5tu/goa

Length of output: 6315


🏁 Script executed:

find . -name "DynamoClient.cs" -o -name "*DynamoClient*.cs" | grep -v Test | grep -v Interface

Repository: Im5tu/goa

Length of output: 102


🏁 Script executed:

rg "class DynamoClient" src/Clients/Goa.Clients.Dynamo/

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

find src/Clients/Goa.Clients.Dynamo -name "*.cs" -type f | xargs grep -l "DeleteItemRequest" | grep -v Operations | head -5

Repository: Im5tu/goa

Length of output: 220


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/DynamoServiceClient.cs | head -150

Repository: Im5tu/goa

Length of output: 7640


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Serialization/DynamoJsonContext.cs

Repository: Im5tu/goa

Length of output: 3678


🏁 Script executed:

rg "ReturnValuesOnConditionCheckFailure" src/Clients/Goa.Clients.Dynamo/Serialization/

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

rg "UseStringEnumConverter\|JsonConverter\|ReturnValuesOnConditionCheckFailure" src/Clients/Goa.Clients.Dynamo/Serialization/ -A 2 -B 2

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

grep -n "ReturnValuesOnConditionCheckFailure" src/Clients/Goa.Clients.Dynamo/Serialization/DynamoJsonContext.cs

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

find . -name "*.cs" -path "*/Serialization/*" -o -name "*Converter*.cs" | xargs grep -l "ReturnValuesOnConditionCheckFailure" 2>/dev/null

Repository: Im5tu/goa

Length of output: 37


🌐 Web query:

AWS DynamoDB DeleteItem API ReturnValuesOnConditionCheckFailure parameter valid values enum

💡 Result:

Valid values: ALL_OLD and NONE. [1][2]

Sources:

  • AWS DeleteItem API reference (ReturnValuesOnConditionCheckFailure). [1]
  • AWS SDK Java enum ReturnValuesOnConditionCheckFailure (ALL_OLD, NONE). [2]

🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Serialization/DynamoJsonContext.cs | grep -E "JsonSerializable.*Delete|JsonSerializable.*Return"

Repository: Im5tu/goa

Length of output: 431


🏁 Script executed:

rg "class DeleteItemRequest" src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemRequest.cs -A 10 | head -20

Repository: Im5tu/goa

Length of output: 463


🏁 Script executed:

find . -name "*.cs" -path "*/Serialization/*" | xargs cat | grep -i "returnvalues"

Repository: Im5tu/goa

Length of output: 93


🏁 Script executed:

python3 << 'EOF'
# Check if ReturnValuesOnConditionCheckFailure would be serialized as part of DeleteItemRequest
# when UseStringEnumConverter is set globally

import json

# The question is: does the enum get serialized when it's a property of a JsonSerializable class?
# With UseStringEnumConverter = true globally, nested enums should serialize as strings

# Looking at the context:
# - DeleteItemRequest is [JsonSerializable] (line 32)
# - UseStringEnumConverter = true (line 22)
# - ReturnValuesOnConditionCheckFailure is a property of DeleteItemRequest
# - The enum is NOT explicitly in [JsonSerializable] attributes

# This means the enum MIGHT serialize correctly due to global setting, but it's not explicit

print("ANALYSIS:")
print("1. DeleteItemRequest IS in [JsonSerializable] list (line 32)")
print("2. UseStringEnumConverter = true is set globally (line 22)")
print("3. ReturnValuesOnConditionCheckFailure property is part of DeleteItemRequest")
print("")
print("POTENTIAL ISSUE:")
print("- The enum is NOT explicitly listed in [JsonSerializable] attributes")
print("- While global UseStringEnumConverter may handle it, best practice is explicit")
print("- Missing from serialization context like other enums (ReturnValues, ReturnConsumedCapacity, etc.)")
EOF

Repository: Im5tu/goa

Length of output: 139


🏁 Script executed:

# Let's verify AWS parameter field name
web_search_query="AWS DynamoDB DeleteItem API request parameter field name ReturnValuesOnConditionCheckFailure JSON"
echo "Searching for field name mapping in AWS docs..."

Repository: Im5tu/goa

Length of output: 100


🏁 Script executed:

rg "WithReturnValuesOnConditionCheckFailure\|ReturnValuesOnConditionCheckFailure\s*=" tests/ -C 2

Repository: Im5tu/goa

Length of output: 35


Add ReturnValuesOnConditionCheckFailure to the serialization context and add test coverage.

While the enum values (NONE, ALL_OLD) correctly match AWS DynamoDB's DeleteItem API contract and the property is properly integrated into the request/builder, two issues need addressing:

  1. The enum should be explicitly registered in DynamoJsonContext as [JsonSerializable(typeof(ReturnValuesOnConditionCheckFailure))] (lines 19-62) for consistency with similar enums like ReturnValues, ReturnConsumedCapacity, and ReturnItemCollectionMetrics, even though the global UseStringEnumConverter setting may handle it implicitly.

  2. Add a test case for WithReturnValuesOnConditionCheckFailure() to verify the property is correctly serialized and sent to DynamoDB, similar to existing builder tests.

🤖 Prompt for AI Agents
In `@src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemRequest.cs`
around lines 52 - 56, DynamoJsonContext is missing an explicit JsonSerializable
registration for the enum ReturnValuesOnConditionCheckFailure and there is no
test ensuring WithReturnValuesOnConditionCheckFailure() gets serialized; add
[JsonSerializable(typeof(ReturnValuesOnConditionCheckFailure))] to the
DynamoJsonContext attribute list (alongside ReturnValues,
ReturnConsumedCapacity, ReturnItemCollectionMetrics) so the enum is explicitly
wired into the source-generated JSON context, then add a unit test that uses the
DeleteItem request builder (call
WithReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure.ALL_OLD)
or NONE) and asserts the produced serialized request includes the correct
ReturnValuesOnConditionCheckFailure value sent to DynamoDB (mirroring existing
builder tests for ReturnValues).

Comment on lines 803 to 820
public UpdateItemBuilder WithCondition(Condition condition)
{
_request.ConditionExpression = condition.Expression;
_request.ExpressionAttributeNames ??= new(StringComparer.OrdinalIgnoreCase);
_request.ExpressionAttributeValues ??= new(StringComparer.OrdinalIgnoreCase);
_request.ExpressionAttributeNames.Merge(condition.ExpressionNames);
_request.ExpressionAttributeValues.Merge(condition.ExpressionValues);

if (condition.ExpressionNames.Count > 0)
{
_request.ExpressionAttributeNames ??= new(StringComparer.OrdinalIgnoreCase);
_request.ExpressionAttributeNames.Merge(condition.ExpressionNames);
}

if (condition.ExpressionValues.Count > 0)
{
_request.ExpressionAttributeValues ??= new(StringComparer.OrdinalIgnoreCase);
_request.ExpressionAttributeValues.Merge(condition.ExpressionValues);
}

return this;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find src -name "*.cs" | head -20

Repository: Im5tu/goa

Length of output: 1260


🏁 Script executed:

rg -n --type=cs 'class Condition\b|record Condition\b|struct Condition\b' src/

Repository: Im5tu/goa

Length of output: 132


🏁 Script executed:

rg -n --type=cs 'WithCondition\(|WithReturnValuesOnConditionCheckFailure\(' src/ -A 2

Repository: Im5tu/goa

Length of output: 2536


🏁 Script executed:

cat -n src/Clients/Goa.Clients.Dynamo/Operations/Condition.cs

Repository: Im5tu/goa

Length of output: 20578


🏁 Script executed:

head -50 src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs

Repository: Im5tu/goa

Length of output: 1907


🏁 Script executed:

rg -n 'WithCondition|WithReturnValuesOnConditionCheckFailure' tests/ -A 5 -B 2 | head -100

Repository: Im5tu/goa

Length of output: 10834


🏁 Script executed:

rg -n 'UpdateItemBuilder.*WithCondition' tests/ -A 10 -B 2 | head -80

Repository: Im5tu/goa

Length of output: 4755


🏁 Script executed:

rg -n '\.WithCondition\(.*\).*\.WithCondition\(' src/Clients/Goa.Clients.Dynamo --type=cs -A 2 -B 2

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

sed -n '800,860p' src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs

Repository: Im5tu/goa

Length of output: 2469


🏁 Script executed:

rg -n 'WithReturnValuesOnConditionCheckFailure' tests/ -B 5 -A 10 | head -60

Repository: Im5tu/goa

Length of output: 35


🏁 Script executed:

sed -n '36,55p' src/Clients/Goa.Clients.Dynamo/Operations/DeleteItem/DeleteItemBuilder.cs

Repository: Im5tu/goa

Length of output: 770


🏁 Script executed:

sed -n '47,66p' src/Clients/Goa.Clients.Dynamo/Operations/PutItem/PutItemBuilder.cs

Repository: Im5tu/goa

Length of output: 709


🏁 Script executed:

rg -n 'WithCondition.*WithCondition' tests/ -C 3

Repository: Im5tu/goa

Length of output: 35


Inconsistent handling of multiple conditions: DeleteItemBuilder properly supports chaining multiple WithCondition() calls by combining expressions with AND, but UpdateItemBuilder and PutItemBuilder silently overwrite the previous condition expression. Align all builders to use the same multi-condition pattern as DeleteItemBuilder, or document that only a single condition is supported.

The dictionary merging optimization is correct—guarding against empty collections avoids allocating and serializing unnecessary attributes. However, consider adding a defensive check for empty condition.Expression to match DeleteItemBuilder's guard and prevent invalid ConditionExpressions from being sent.

🤖 Prompt for AI Agents
In `@src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs`
around lines 803 - 820, UpdateItemBuilder.WithCondition currently overwrites
prior conditions and doesn't guard against empty condition.Expression; change it
to match DeleteItemBuilder's multi-condition behavior: if condition.Expression
is null or empty, return without modifying; if _request.ConditionExpression is
null or empty set it to condition.Expression, otherwise set it to "(" +
_request.ConditionExpression + ") AND (" + condition.Expression + ")"; keep the
existing ExpressionAttributeNames/ExpressionAttributeValues merge logic (using
_request.ExpressionAttributeNames ??= ... and Merge) so attribute maps still
combine across calls. Also apply the same empty-expression guard pattern to
PutItemBuilder.WithCondition to ensure consistent behavior across builders.

Comment on lines +844 to +853
/// <summary>
/// Specifies how to return attribute values when a conditional check fails.
/// </summary>
/// <param name="returnValuesOnConditionCheckFailure">The return values on condition check failure setting.</param>
/// <returns>The UpdateItemBuilder instance for method chaining.</returns>
public UpdateItemBuilder WithReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure)
{
_request.ReturnValuesOnConditionCheckFailure = returnValuesOnConditionCheckFailure;
return this;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check for existing coverage / add similar coverage if missing.
rg -n --type=cs -C2 'WithReturnValuesOnConditionCheckFailure|ReturnValuesOnConditionCheckFailure' tests src/Clients/Goa.Clients.Dynamo.Tests || true

Repository: Im5tu/goa

Length of output: 129


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find test directories
find . -type d -name "*Tests" -o -type d -name "*test*" | head -20

# Also list the structure around the source file
ls -la src/Clients/Goa.Clients.Dynamo/
</script>

Repository: Im5tu/goa

Length of output: 2180


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for UpdateItemBuilder tests
rg -n --type=cs 'WithReturnValuesOnConditionCheckFailure|ReturnValuesOnConditionCheckFailure' tests/Clients/Goa.Clients.Dynamo.Tests || true

echo "---"

# Also search for UpdateItemBuilder test files
fd -t f UpdateItemBuilder tests/Clients/Goa.Clients.Dynamo.Tests/ || true

Repository: Im5tu/goa

Length of output: 56


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for UpdateItem test files
find tests/Clients/Goa.Clients.Dynamo.Tests -type f -name "*UpdateItem*" || true

echo "---"

# Search for any UpdateItem references in tests
rg -l 'UpdateItem' tests/Clients/Goa.Clients.Dynamo.Tests --type=cs || true

echo "---"

# List test directory structure
find tests/Clients/Goa.Clients.Dynamo.Tests/Operations -type f 2>/dev/null | head -20 || true

Repository: Im5tu/goa

Length of output: 204


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for ReturnValuesOnConditionCheckFailure in test files
rg -n 'ReturnValuesOnConditionCheckFailure' tests/Clients/Goa.Clients.Dynamo.Tests/ --type=cs -C3 || true

echo "---"

# Check the content of DynamoClientIntegrationTests.cs to see what UpdateItem tests exist
grep -n 'UpdateItem' tests/Clients/Goa.Clients.Dynamo.Tests/DynamoClientIntegrationTests.cs | head -20 || true

Repository: Im5tu/goa

Length of output: 323


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if UpdateItemBuilder is used in tests
rg -n 'UpdateItemBuilder' tests/Clients/Goa.Clients.Dynamo.Tests/ --type=cs || true

echo "---"

# Look at the actual test that uses UpdateItem
rg -n -A 30 'UpdateItemAsync_ShouldModifyItem_WhenItemExists' tests/Clients/Goa.Clients.Dynamo.Tests/DynamoClientIntegrationTests.cs || true

Repository: Im5tu/goa

Length of output: 2365


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look at the UpdateItemBuilder tests section
rg -n -A 100 '#region UpdateItemBuilder Tests' tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs | head -150 || true

echo "---"

# Check for any use of ReturnValuesOnConditionCheckFailure in the entire test file
rg -n 'ReturnValuesOnConditionCheckFailure' tests/Clients/Goa.Clients.Dynamo.Tests/ConditionExpressionValuesTests.cs || echo "Not found in ConditionExpressionValuesTests.cs"

Repository: Im5tu/goa

Length of output: 4443


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for other WithReturnValues methods in UpdateItemBuilder
rg -n 'WithReturnValues' src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs --type=cs || true

echo "---"

# Check if any ReturnValues methods are tested
rg -n 'WithReturnValues|ReturnValues' tests/Clients/Goa.Clients.Dynamo.Tests/ --type=cs || true

Repository: Im5tu/goa

Length of output: 525


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if WithReturnValues (the non-condition version) is tested
rg -n 'WithReturnValues' tests/Clients/Goa.Clients.Dynamo.Tests/ --type=cs -B2 -A5 || true

echo "---"

# Look at how ReturnValues.ALL_NEW is used in the test
rg -n -B10 -A10 'ReturnValues = ReturnValues.ALL_NEW' tests/Clients/Goa.Clients.Dynamo.Tests/DynamoClientIntegrationTests.cs || true

Repository: Im5tu/goa

Length of output: 919


Add test coverage for the WithReturnValuesOnConditionCheckFailure method.

The builder method is straightforward and follows the fluent API pattern correctly, but it lacks test coverage. Following the pattern established by other builder tests (e.g., UpdateItemBuilder_WithCondition_* tests in ConditionExpressionValuesTests.cs), add a test that validates the method properly flows the value into the built request. Also note that the related WithReturnValues method (line 838) similarly lacks test coverage.

🤖 Prompt for AI Agents
In `@src/Clients/Goa.Clients.Dynamo/Operations/UpdateItem/UpdateItemBuilder.cs`
around lines 844 - 853, Add unit tests mirroring the existing
UpdateItemBuilder_WithCondition_* patterns (see ConditionExpressionValuesTests)
that verify UpdateItemBuilder.WithReturnValuesOnConditionCheckFailure(...) and
UpdateItemBuilder.WithReturnValues(...) correctly propagate values into the
built request; instantiate an UpdateItemBuilder, call the method under test with
each relevant enum value, call Build() (or however the request is produced in
tests), and assert the resulting request's ReturnValuesOnConditionCheckFailure
and ReturnValues properties equal the values passed.

@Im5tu Im5tu merged commit f45b0fd into main Jan 14, 2026
3 checks passed
@Im5tu Im5tu deleted the updates branch January 14, 2026 11:29
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.

1 participant