-
Notifications
You must be signed in to change notification settings - Fork 5
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
Yet another approach to type safe step parameters #1562
base: develop
Are you sure you want to change the base?
Conversation
…notations and some step wrapper code that copies map entries to/from step fields. Note that this doesn't require changing all steps, since its use of FlightMap is transparent to Stairway and the net effect is the same as if the step called `put()` and `get()` directly.
…-map-2 # Conflicts: # src/main/java/bio/terra/service/filedata/flight/delete/DeleteFileAzureDirectoryStep.java
… in and out step parameter
# Conflicts: # src/main/java/bio/terra/app/controller/DatasetsApiController.java # src/main/java/bio/terra/service/dataset/flight/create/CreateDatasetAssetStep.java # src/main/java/bio/terra/service/dataset/flight/datadelete/DataDeletionStep.java # src/main/java/bio/terra/service/dataset/flight/delete/DeleteDatasetAuthzResource.java # src/main/java/bio/terra/service/filedata/flight/delete/DeleteFileAzureDirectoryStep.java # src/main/java/bio/terra/service/snapshot/flight/create/CreateSnapshotMetadataStep.java # src/main/java/bio/terra/service/snapshot/flight/create/CreateSnapshotPrimaryDataAssetGcpStep.java # src/main/java/bio/terra/service/snapshot/flight/create/CreateSnapshotPrimaryDataRowIdsStep.java # src/main/java/bio/terra/service/snapshot/flight/delete/DeleteSnapshotMetadataStep.java
I really like the type safe step parameters. Is it possible the annotations, |
@rtitle Sure, I was thinking that we'd first prove out its utility in TDR and then add it to TCL or Stairway. Since it can be used alongside existing steps it could be put in stairway without breaking compatibility. |
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 14 New issues |
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 6 New issues |
statusCode = HttpStatus.OK; | ||
} | ||
|
||
protected FlightContext getContext() { |
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.
I kept this around in case it's needed but in general steps that use this API shouldn't need to access the context directly.
throw new IllegalGetException(e); | ||
} | ||
if (value == null) { | ||
// An unset output can occur if an exception is thrown inside the run() operation. |
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.
Thinking about this again, maybe instead the code shouldn't write outputs to the map if an exception occurs. Stairway might store flight context data even on error, but that doesn't seem like something we should ever count on.
# Conflicts: # src/test/java/bio/terra/service/snapshot/flight/CreateSnapshotMetadataStepTest.java # src/test/java/bio/terra/service/snapshot/flight/authDomain/AddSnapshotAuthDomainSetResponseStepTest.java
Yet another approach to type safe step parameters. This uses field annotations and some step wrapper code that copies map entries to/from step fields. Note that this doesn't require changing all steps, since its use of FlightMap is transparent to Stairway and the net effect is the same as if the step called
put()
andget()
directly.Reviving these changes from 2021 after a conversation with @nmalfroy