Skip to content

Conversation

@eldritchideen
Copy link
Contributor

Summary

1. unicorn_approvals/ApprovalsService/pom.xml

Added test environment variable: CONTRACT_STATUS_TABLE=test-table for testing
Added Maven Surefire dependency: Added JUnit4 support with version 3.5.3

2. ContractStatusChangedHandlerFunction.java

Enhanced logging: Added comprehensive logging throughout the function
Added error handling: Wrapped the main logic in try-catch with proper error logging
Environment validation: Added check to ensure CONTRACT_STATUS_TABLE is set
Debug information: Added logging for table name, events received, and DynamoDB operations

3. unicorn_web/Common/src/main/java/dao/Property.java

Fixed partition key generation: Changed from lowercase conversion of entire string to lowercase conversion of individual components

4. unicorn_web/Data/property_data.json

Fixed partition key format: Updated all PK values from lowercase property# to uppercase PROPERTY#
Consistency fix: Ensures test data matches the new partition key format

5. PublicationApprovedEventHandler.java

Enhanced logging: Added detailed logging for property updates and key generation
Fixed partition key: Changed from search# prefix to PROPERTY# prefix
Debug output: Added logging for partition key, sort key, and existing property data

6. RequestApprovalFunction.java (Major Refactoring)

Changed from API Gateway to SQS: Completely refactored from handling API Gateway events to SQS events
Removed HTTP response logic: Eliminated all API Gateway response creation methods
Added batch processing: Now processes multiple SQS messages in a single invocation
Enhanced error handling: Individual message failures don't stop processing of other messages
Improved logging: Added comprehensive logging throughout the processing pipeline
Fixed partition key: Changed from search# to PROPERTY# prefix
Added environment logging: Logs environment variables for debugging

7. PropertySearchFunction.java

Fixed partition key: Changed from search# to PROPERTY# prefix for consistency
Added debug logging: Added logging for partition and sort keys

Overall Impact

This commit primarily fixes a partition key inconsistency across the application where some components were using search# while others expected PROPERTY#.
The changes ensure all components use the consistent PROPERTY# prefix, along with improved error handling and logging throughout the system. The major
architectural change is converting the approval request function from API Gateway-triggered to SQS-triggered for better scalability and reliability.

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@eldritchideen eldritchideen requested a review from a team as a code owner August 29, 2025 04:43
@github-actions
Copy link

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

@github-actions github-actions bot added do-not-merge PRs that are blocked for varying reasons need-issue PR is missing a related issue for tracking change labels Aug 29, 2025
Copy link
Contributor

@sliedig sliedig left a comment

Choose a reason for hiding this comment

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

Thnaks again @eldritchideen !!

@sliedig sliedig merged commit 1e96286 into aws-samples:develop Aug 29, 2025
5 of 6 checks passed
@github-actions
Copy link

undefined No related issues found. Please ensure 'pending-release' label is applied before releasing.

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

Labels

do-not-merge PRs that are blocked for varying reasons need-issue PR is missing a related issue for tracking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants