Skip to content
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

fix: Fixed an issue where custom AmazonEC2Client.DryRun() method was not working for non-BCL targets. Also included this method in IAmazonEC2 interface. #3602

Merged

Conversation

ashishdhingra
Copy link
Contributor

@ashishdhingra ashishdhingra commented Jan 9, 2025

Description

fix: Fixed an issue where custom AmazonEC2Client.DryRun() method was not working for non-BCL targets. Also included this method in IAmazonEC2 interface.

This PR addressed following:

  • Includes DryRun() method as part of IAmazonEC2 interface for easier mock-ability.
  • For non-BCL targets it includes NonPublic methods in reflection search. Kindly note that we need to explicitly use BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic.

Based on discussion with @normj, we should perhaps deprecate/obsolete this method in V4 and remove customization in ec2.customizations.json to not exclude DryRun property from request models (this was done due to legacy reasons when EC2 code was hand-coded). Created separate backlog item for it in Input queue.

Motivation and Context

Issue #3595

Testing

  • Tested locally using below code:

    IAmazonEC2 ec2Client = new AmazonEC2Client();
    var ec2DryRunRespose = ec2Client.DryRun(new StartInstancesRequest { InstanceIds = new() { "<<EC2InstanceID>>" } });

    No unit test/integration test was added since we would need to spin up new EC2 instance. We would also deprecate this method in V4.

  • Catapult dry-run completed successfully.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@ashishdhingra ashishdhingra requested a review from normj January 9, 2025 17:31
@ashishdhingra ashishdhingra force-pushed the user/ashdhin/EC2DryRun-NetStandard-Issue3595 branch from 919c662 to e1438c4 Compare January 9, 2025 22:12
…not working for non-BCL targets. Also included this method in IAmazonEC2 interface.
@ashishdhingra ashishdhingra force-pushed the user/ashdhin/EC2DryRun-NetStandard-Issue3595 branch from e1438c4 to 92bb5d8 Compare January 9, 2025 22:13
@ashishdhingra ashishdhingra merged commit bcaa7d6 into main-staging Jan 23, 2025
1 check passed
@ashishdhingra ashishdhingra deleted the user/ashdhin/EC2DryRun-NetStandard-Issue3595 branch January 23, 2025 17:39
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.

3 participants