style95 commented on a change in pull request #4986:
URL: https://github.com/apache/openwhisk/pull/4986#discussion_r496031621
##########
File path:
common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala
##########
@@ -548,8 +632,12 @@ object WhiskAction extends DocumentFactory[WhiskAction]
with WhiskEntityQueries[
wp flatMap { resolvedPkg =>
// fully resolved name for the action
val fqnAction = resolvedPkg.fullyQualifiedName(withVersion =
false).add(actionName)
+ val action = WhiskActionVersionList.get(fqnAction,
entityStore).flatMap { result =>
Review comment:
I am still unsure about having two separate calls to fetch a certain
version of the action.
I haven't tried this but there are some tricks to sort data like
https://stackoverflow.com/a/41959344
If we can sort the data using the views we may have something like this with
one list query:
```
[email protected]
[email protected]
[email protected]
```
Then we might be able to get the latest action metadata with the `limit=1`
parameter.
```
[email protected]
```
Also, if a DocId includes the version information, we can directly fetch a
certain version even if it is old.
##########
File path:
common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala
##########
@@ -548,8 +632,12 @@ object WhiskAction extends DocumentFactory[WhiskAction]
with WhiskEntityQueries[
wp flatMap { resolvedPkg =>
// fully resolved name for the action
val fqnAction = resolvedPkg.fullyQualifiedName(withVersion =
false).add(actionName)
+ val action = WhiskActionVersionList.get(fqnAction,
entityStore).flatMap { result =>
Review comment:
It is still important to provide a feature in a backward-compatible way,
if this is designed in this way for backward compatibility, I am inclined not
to let the design be changed because of the backward compatibility. Instead, we
can provide other options such as a feature flag with a way to easily migrate
existing data.
I believe the semantics or behavior of the feature should not be affected
because of the backward compatibility.
##########
File path:
common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskAction.scala
##########
@@ -548,8 +632,12 @@ object WhiskAction extends DocumentFactory[WhiskAction]
with WhiskEntityQueries[
wp flatMap { resolvedPkg =>
// fully resolved name for the action
val fqnAction = resolvedPkg.fullyQualifiedName(withVersion =
false).add(actionName)
+ val action = WhiskActionVersionList.get(fqnAction,
entityStore).flatMap { result =>
+ val docId = result.matchedDocId(version).getOrElse(fqnAction.toDocId)
+ WhiskAction.get(entityStore, docId)
Review comment:
In case no version is specified, how does it fetch the latest version?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]