Skip to content

Conversation

@jasdeepbhalla
Copy link

Issue # (if applicable)

Closes #36348.

Reason for this change

The AWS Batch documentation within the CDK library incorrectly stated that the default Spot allocation strategy is SPOT_CAPACITY_OPTIMIZED. However, the default was changed to SPOT_PRICE_CAPACITY_OPTIMIZED in PR #26731 (August 2023), and several JSDoc @default annotations were never updated.

This resulted in inconsistencies between:

  • The published CDK API documentation
  • The JSDoc source annotations
  • The actual implementation (determineAllocationStrategy()), which correctly uses SPOT_PRICE_CAPACITY_OPTIMIZED

This PR updates the documentation to accurately reflect the correct behavior.

Description of changes

  • Updated all incorrect JSDoc @default annotations in managed-compute-environment.ts.
  • Replaced all mentions of SPOT_CAPACITY_OPTIMIZED with SPOT_PRICE_CAPACITY_OPTIMIZED in affected interfaces and props.
  • Ensured consistency across:
    • IManagedEc2EcsComputeEnvironment
    • ManagedEc2EcsComputeEnvironmentProps
    • IManagedEc2EksComputeEnvironment
    • ManagedEc2EksComputeEnvironmentProps
  • No runtime logic was modified; this PR corrects documentation only.

Alternatives considered:

  • Leaving the outdated docs in place — rejected because it causes user confusion.
  • Introducing a transitional deprecation note — rejected to maintain clean, accurate documentation.

Design decisions:

  • Align JSDoc documentation with the real default used by the CDK implementation.

Describe any new or updated permissions being added

No new or updated IAM permissions are introduced.
This PR updates documentation only.

Description of how you validated changes

  • Verified via code inspection that determineAllocationStrategy() already uses the correct default (SPOT_PRICE_CAPACITY_OPTIMIZED).
  • Searched for all relevant JSDoc @default comments and corrected them.
  • Rebuilt the module to ensure no JSII or TypeScript documentation inconsistencies.
  • Confirmed that no integration tests or runtime behavior are affected.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team December 11, 2025 00:26
@github-actions github-actions bot added effort/small Small work item – less than a day of effort p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Dec 11, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@jasdeepbhalla jasdeepbhalla changed the title docs(aws-batch): correct default allocation strategy for spot compute environments docs(batch): correct default allocation strategy for spot compute environments Dec 11, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 11, 2025 00:33

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@github-actions
Copy link
Contributor

TestsPassed ❌️SkippedFailed
Security Guardian Results
TestResult
No test annotations available

@github-actions
Copy link
Contributor

TestsPassed ❌️SkippedFailed
Security Guardian Results with resolved templates
TestResult
No test annotations available

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 11, 2025
Copy link
Contributor

@badmintoncryer badmintoncryer left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Dec 11, 2025
@mergify
Copy link
Contributor

mergify bot commented Dec 15, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Dec 15, 2025

Merge Queue Status

🚫 The pull request has left the queue (rule: default-squash) at b0deb86

This pull request spent 3 minutes 59 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/codebuild-pr-build.yml without workflows permission

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 15, 2025
@mergify
Copy link
Contributor

mergify bot commented Dec 15, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@kumsmrit kumsmrit self-assigned this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-batch: documentation gives wrong default for allocation strategy

4 participants