Skip to content

Conversation

ammokhov
Copy link
Contributor

@ammokhov ammokhov commented Apr 3, 2020

Issue #, if available:

Description of changes:

along with @rjlohan refactored codegen model to allow aws guided option. This option generates resource handlers (each handler has a special stub) and supporting files allowing developer to use functional paradigm.
refactored files:

  • BaseHandlerStd - abstract class that has a handleRequst wrapper
  • CreateHandler - has a sample create handler context pattern
  • DeleteHandler - has a sample delete handler context pattern
  • ReadHandler - has a sample read handler context pattern
  • UpdateHandler - has a sample update handler context pattern
  • ClientBuilder - has a sample sdkClient builder
  • Translator - has sample api requests

Having progress chain pattern pre-generated for developers gives less function state control, less worry of exception handling, and more standardized approach for any future custom resource implementations.


% cfn init
% Initializing new project
% What's the name of your resource type?
% (Organization::Service::Resource)
>> 
% One language plugin found, defaulting to java
% Enter a package name (empty for default 'com.aa.aa.aa'):
>>
% Choose codegen model - 1 (default) or 2 (guided-aws):

mvn verify builds successfully:

[INFO] All coverage checks have been met.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

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

@ammokhov ammokhov requested review from rjlohan and wbingli April 3, 2020 20:23
@ammokhov ammokhov added codegen It's like magic! enhancement New feature or request labels Apr 3, 2020
@ammokhov ammokhov self-assigned this Apr 3, 2020
@ammokhov ammokhov requested a review from johnttompkins April 3, 2020 20:24
@ammokhov ammokhov requested review from aygold92 and priyap286 April 8, 2020 18:22
@aygold92
Copy link
Contributor

aygold92 commented Apr 8, 2020

please update the name of this PR

@aygold92
Copy link
Contributor

aygold92 commented Apr 8, 2020

can you please post the results of a sample code generation?

Copy link
Contributor

@aygold92 aygold92 left a comment

Choose a reason for hiding this comment

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

please include a lengthy description of what testing you have done on this and include links to samples

Copy link
Contributor

@johnttompkins johnttompkins left a comment

Choose a reason for hiding this comment

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

Overall looks good just some duplication in tests and a few open questions about some of the codegen changes below

@ammokhov ammokhov changed the title Codegen added aws-guided codegen model Apr 13, 2020
Copy link
Contributor

@rjlohan rjlohan left a comment

Choose a reason for hiding this comment

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

Agree with most of the comments from @aygold92 we can make some more updates here.

@ammokhov ammokhov requested review from aygold92 and rjlohan April 18, 2020 08:53
@wbingli wbingli self-requested a review April 22, 2020 22:47
Copy link

@wbingli wbingli left a comment

Choose a reason for hiding this comment

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

A few comments and also need a backfill the recent POJO fix.

@ammokhov ammokhov requested a review from wbingli April 23, 2020 18:12
@wbingli
Copy link

wbingli commented Apr 23, 2020

LGTM. But keep an eye on the POJO.java for a recent fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen It's like magic! enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants