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

Proof-of-concept port of ApplicationAbleFlight using annotations #1698

Draft
wants to merge 1 commit into
base: stairway_poc
Choose a base branch
from

Conversation

pshapiro4broad
Copy link
Member

@pshapiro4broad pshapiro4broad commented Apr 3, 2024

This POC shows how using StepInput and StepOutput annotations could simplify stairway flight and steps.

If you're not familiar with this code, compare these versions with the code in ApplicationAbleDaoStep, ApplicationAbleIamStep, etc.

These annotations support a form of static data flow analysis. I added a test that generates this output to show what information the annotations provide. Note that without running a step you can't tell which outputs are actually written to by the code, so this prints out all outputs as being potential step outputs.

Test output:

StepData[stepName=ApplicationAblePrecheckStepV3, inputs=[authUserInfo, workspaceId, applicationAbleEnum], outputs=[wsmApplication, applicationAbleDao, applicationAbleSam, response, statusCode]]
StepData[stepName=ApplicationAbleIamStepV3, inputs=[authUserInfo, workspaceId, applicationAbleEnum, wsmApplication, applicationAbleSam], outputs=[response, statusCode]]
StepData[stepName=ApplicationAbleDaoStepV3, inputs=[workspaceId, applicationAbleEnum, applicationAbleDao], outputs=[response, statusCode]]

…simple "data flow" can be generated at test time which can validate declared inputs and outputs for steps.

private StepUtils() {}

public static String keyFromField(Field field) {
Copy link
Member Author

Choose a reason for hiding this comment

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

By default, the inputs and outputs are mapped to flight map (or flight input map) elements by using the annotated field's name. You can also provide an annotation argument to use a different name instead.

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.

1 participant