Skip to content

Modify EC2 Get Instances action to allow partial results#2216

Open
ravikiranvm wants to merge 7 commits intomainfrom
ops-4065a
Open

Modify EC2 Get Instances action to allow partial results#2216
ravikiranvm wants to merge 7 commits intomainfrom
ops-4065a

Conversation

@ravikiranvm
Copy link
Copy Markdown
Contributor

@ravikiranvm ravikiranvm commented Apr 10, 2026

Part of OPS-4065.

I will modify the remaining AWS Actions in the follow-up PRs.

Additional Notes

Screenshot 2026-04-13 at 12 13 23 PM

@linear
Copy link
Copy Markdown

linear bot commented Apr 10, 2026

@ravikiranvm ravikiranvm marked this pull request as ready for review April 13, 2026 05:39
Copilot AI review requested due to automatic review settings April 13, 2026 05:39
Copy link
Copy Markdown
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 (OPS-4065) updates the EC2 “Get Instances” implementation to optionally tolerate per-region failures and still return results from successful regions, enabling workflows to proceed with partial data.

Changes:

  • Added getEc2InstancesWithPartialResults helper that returns { results, failedRegions } using Promise.allSettled across regions.
  • Added allowPartialResults checkbox to the EC2 Get Instances block action to switch between strict vs partial-result behavior.
  • Added/updated unit tests covering partial results behavior and action output shape.

Reviewed changes

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

File Description
packages/openops/src/lib/aws/ec2/ec2-get-instances.ts Introduces partial-results helper/types and refactors per-region describe logic into a shared function.
packages/openops/test/aws/ec2/ec2-get-instances.test.ts Adds unit tests validating partial-results behavior and STS failure handling.
packages/blocks/aws/src/lib/actions/ec2/ec2-get-instances-action.ts Adds allowPartialResults prop, routes to partial helper, and refactors batching logic.
packages/blocks/aws/test/ec2/ec2-get-instances-action.test.ts Extends action tests for the new prop and partial-results return shape/aggregation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fetchFilters: Filter[];
};

function buildEc2GetInstancesBatches(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved the common logic here to remove duplication between the partial-results and strict branches. This function builds the list of EC2 describe batches

@sonarqubecloud
Copy link
Copy Markdown

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