-
Notifications
You must be signed in to change notification settings - Fork 209
Allow member fields from other operations in spec #139
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
Allow member fields from other operations in spec #139
Conversation
Is this a PR in progress? |
Nope. This is just a small PR.
I want to add
I don't see any unit tests for the type defs methods. Any pointers? |
Thanks for explaining. We should ideally make an effort to increase test coverage of our codebase (maybe a collective effort as a team in coming sprints) but it's definitely out of scope for this PR. LGTM. I'll let one more team member review this before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RedbackThomson please see my inline comment.
Also, to unit test this functionality, simply add the generator config changes you are testing out for the S3 controller's update code paths to the testdata/ generator yaml for S3:
and add a test for the now-expected new Spec field for Logging in this unit test file:
code-generator/pkg/model/model_s3_test.go
Line 70 in 5a40e37
expSpecFieldCamel := []string{ |
and a test for the now-expected LoggingStatus type defs in the same model_s3_test.go file. You can use the testutil.GetTypeDefByName
utility function from here:
code-generator/pkg/testutil/get.go
Line 45 in 5a40e37
func GetTypeDefByName( |
Cleaned up unnecessary methods and added unit tests for the S3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bingo. ++
} | ||
for _, typeDef := range expTypeDefCamel { | ||
assert.NotNil(testutil.GetTypeDefByName(t, g, typeDef)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson, vijtrip2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adds custom hooks to detect changes to the `Logging` spec field and optionally calls the `PutBucketLogging` SDK method. Currently errors are not populated into terminal conditions, and updates are not supported. Uses aws-controllers-k8s/code-generator#139 and aws-controllers-k8s/code-generator#140
Description of changes:
Allow the use of member fields contained within other API operations within a resource's spec. For example,
LoggingStatus
for S3 is only in thePutBucketLogging
operation, but should be settable from spec.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.