-
Notifications
You must be signed in to change notification settings - Fork 0
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
Retry experiment #3
Conversation
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
…/api into retry-experiment
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3 +/- ##
==========================================
- Coverage 90.70% 90.64% -0.06%
==========================================
Files 157 159 +2
Lines 3528 3485 -43
Branches 391 387 -4
==========================================
- Hits 3200 3159 -41
+ Misses 309 305 -4
- Partials 19 21 +2
☔ View full report in Codecov by Sentry. |
@@ -9,8 +9,8 @@ const ExperimentParent = require('../model/ExperimentParent'); | |||
|
|||
const logger = getLogger('[Gem2sController] - '); | |||
|
|||
const runGem2s = async (req, res) => { | |||
const { experimentId } = req.params; | |||
const runGem2s = async (stateMachineParams, authorization) => { |
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.
The functions exported by the controllers should be functions that handle params req
res
. They are supposed to handle routes directly.
If this function is no longer doing that, then it should be moved over to a different place (probably where all the pipeline stuff is, perhaps we can even merge this with other functions? idk).
I noticed this same situation with seurat and subset controller.
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.
Personally I'm leaning more towards separating the params and passing them individually if there are not many of them (3 or less perhaps?), but whatever you prefer
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.
The reason I'm leaning towards separating the params is that having them in an object kind of hides them, and it's not worth it when it's not many params
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 understand it is more tractable to separate the parameters, but the reason I went with passing an entire object is because when the /retry
endpoint is called the object containing the last parameters that is in the db can be directly passed no matter what the function is. Afterwards each function (runSubset
, runSeurat
, runGem2s
) extracts their necessary parameters.
Otherwise, in the retry endpoint I would have to use a switch statement and for each function I would extract the proper parameters. I really do not like that solution as it is not scalable and I think would lower the code quality.
imo we should leave it like this
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.
Ok, although I would suggest avoiding a switch
when possible (there are usually better ways to define things).
For example, it could be stored in your const stateMachineToPipeline
object which already stores functions as [SUBSET_PROCESS_NAME]: (...) => { blablabla; executeSubsetPipeline(...) }
.
I see your point though, what do you think of having runSubset
, runSeurat
, runGem2s
assert that all the necessary properties in these parameter objects are defined and throw an error if they aren't? That should help bring out to light any possible bugs we might introduce in the future/possible incorrect stored parameters. It should also help stop any possible data loss (the error would stop the wrong retry from executing).
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.
If you like the idea of the assert
, since you are going to use it in 3 different files I would suggest checking if there isn't an already accessible assert
function.
If there isn't, you could add a small function, something like this:
assert = (condition) => {
if (!condition) throw new Error("Assertion failed")
}
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.
Why not use the function validateRequest
with a RetryRequest.yaml like we do for most requests in the API? Seems like the cleanest solution to ensure the correct params are passed after being fetched from the database.
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.
hmm I hadn't thought of that because it isn't a request, just a collection of parameters
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Signed-off-by: Kristian-A <[email protected]>
Description
retryParams
inExperimentExecution
table which persists the last request parameters/retry
which figures out the type of pipeline and executes it with the same parameters as before (i.e.retryParams
)run
function which extracts the required parameters from thereq
object. This way the pipelines can be executed directly using the persisted parameters in the db (retryParams
).Details
URL to issue
https://github.com/biomage-org/issues/issues/129
Link to staging deployment URL (or set N/A)
N/A
Links to any PRs or resources related to this PR
biomage-org/ui#2
Integration test branch
master
Merge checklist
Your changes will be ready for merging after all of the steps below have been completed.
Code updates
Have best practices and ongoing refactors being observed in this PR
Manual/unit testing
Integration testing
You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.
Documentation updates
Optional