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

feat(neptune): auto minor version upgrade for an instance #31988

Merged
merged 19 commits into from
Dec 2, 2024

Conversation

badmintoncryer
Copy link
Contributor

@badmintoncryer badmintoncryer commented Nov 2, 2024

Issue # (if applicable)

None

Reason for this change

Cloudformation supports for configuring autoMinorVersionUpgrade for a database instance but AWS CDK cannot do that.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbinstance.html#cfn-neptune-dbinstance-autominorversionupgrade

Description of changes

Add autoMinorVersionUpgrade to DatabaseInstanceProps

Description of how you validated changes

Added both unit and integ tests.

Checklist


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

@github-actions github-actions bot added p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Nov 2, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team November 2, 2024 00:28
@badmintoncryer badmintoncryer marked this pull request as ready for review November 2, 2024 00:29
@@ -138,6 +138,17 @@ new neptune.DatabaseCluster(this, 'Cluster', {
});
```

You can also specify `autoMinorVersionUpgrade` to a database instance.
Even within the same cluster, you can modify the `autoMinorVersionUpgrade` setting on a per-instance basis.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created an integration test with a mixed autoMinorVersionUpgrade setting for verification, and it is deploying successfully.

@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 Nov 2, 2024
/**
* Indicates that minor version patches are applied automatically.
*
* @default - same as the cluster's autoMinorVersionUpgrade setting
Copy link
Contributor

Choose a reason for hiding this comment

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

the default in CDK is undefined. Do not refer to the default value in the service.

Copy link
Contributor Author

@badmintoncryer badmintoncryer Nov 2, 2024

Choose a reason for hiding this comment

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

So, does this mean that it is preferable to specify @default undefined here?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

Copy link
Contributor Author

@badmintoncryer badmintoncryer Nov 2, 2024

Choose a reason for hiding this comment

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

The DESIGN_GUIDELINES says that it is better to avoid @default undefined.

don't write @default undefined, describe the behavior that happens if the property is not supplied.

https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md#defaults

Therefore, I think it would be better to describe how the current behavior works. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

but IMO, we should not mention the CFN default behaviour, since we will not update this value if CFN decided to change that default value.

Copy link
Contributor Author

@badmintoncryer badmintoncryer Nov 6, 2024

Choose a reason for hiding this comment

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

I've updated my description to @default undefined and suppressed linter.

awslint.json

{
  "exclude": [
    "props-physical-name:@aws-cdk/aws-neptune-alpha.ClusterParameterGroupProps",
    "props-physical-name:@aws-cdk/aws-neptune-alpha.ParameterGroupProps",
    "props-physical-name:@aws-cdk/aws-neptune-alpha.SubnetGroupProps",
    "docs-public-apis:@aws-cdk/aws-neptune-alpha.ServerlessScalingConfiguration",
    "props-no-undefined-default:@aws-cdk/aws-neptune-alpha.DatabaseInstanceProps.autoMinorVersionUpgrade" // added
  ]
}

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.50%. Comparing base (40835a0) to head (126fb2a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #31988      +/-   ##
==========================================
+ Coverage   78.48%   78.50%   +0.01%     
==========================================
  Files         106      106              
  Lines        7201     7201              
  Branches     1321     1321              
==========================================
+ Hits         5652     5653       +1     
+ Misses       1362     1361       -1     
  Partials      187      187              
Flag Coverage Δ
suite.unit 78.50% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 78.50% <ø> (+0.01%) ⬆️

@badmintoncryer
Copy link
Contributor Author

@moelasmar Hi, I've updated my code according to your comments. Could you please confirm?

@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 Nov 26, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Approving on behalf of Mohamed since his concern is addressed.

Copy link
Contributor

mergify bot commented Dec 2, 2024

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).

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

mergify bot commented Dec 2, 2024

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 126fb2a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit d95db49 into aws:main Dec 2, 2024
17 checks passed
Copy link
Contributor

mergify bot commented Dec 2, 2024

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).

Copy link

github-actions bot commented Dec 2, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants