-
Notifications
You must be signed in to change notification settings - Fork 6
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
#143 light executed script #163
Conversation
- listExecutedScripts() now returns a sequence of LightExecutedScript - dependencies modified in consequence
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'm not so sure about reading the identifiers. They are used during the scripts execution to determine in what order the scripts should be played but are there relevant otherwise?
Since the objective here is to serialize ExecutedScript
and only read LightExecutedScript
, I think the code to map executed scripts db to executed scripts could be removed and no code to serialize LightExecutedScript
is necessary.
script3, | ||
script2 | ||
lightScript3, | ||
lightScript2 |
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.
Since ExecutedScript
extends LightExecutedScript
, shouldn't it work without even without giving explicit LightExecutedScript
? Did you try?
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 it does not, maybe add an extension to ExecutedScript in the tests that creates the light executed script associated to a script (basically by casting it I think)
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.
No it does not work without explicit type.
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.
And casting is not enough.
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.
Then you could add a function extension to ExecutedScript
, toLightExecutedScript()
, in the tests. I'm sure it will help for other tests because MongoDriverTest
should also check stuff like that.
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.
Already done
executionStatus, | ||
action, | ||
executionDurationInMillis, | ||
executionOutput |
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.
Is this mapping function still necessary? It appears to me that only light executed scripts will be read from the database from now on
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.
Indeed
name = name, | ||
checksum = checksum, | ||
identifier = identifier | ||
) |
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.
Is this function necessary? Light executed scripts should not be inserted in 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.
Indeed
override fun serializeLightExecutedScript(lightExecutedScript: LightExecutedScript): String { | ||
val lightExecutedScriptDb = lightExecutedScript.toLightExecutedScriptDb() | ||
|
||
return mapper.stringify(LightExecutedScriptDb.serializer(), lightExecutedScriptDb) |
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.
Are light executed scripts serialized?
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.
No they are not.
Add an extension function toLightExecutedScript() inside test to avoid lightScript variable in addition to script variable.
ExecutedScript are only serialized and LightExecutedScript are only deserialized.
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.
Hi, thanks for the PR.
#143
Add LightExecutedScript that only contains the name, checksum and identifier.
DatamaintainDriver.listExecutedScripts() now return a sequence of LightExecutedScripts instead of the full ExecutedScript.
Modified MongoDriver, JdbcDriver and tests accordingly.
@driccio