jiangpengcheng commented on a change in pull request #4986: URL: https://github.com/apache/openwhisk/pull/4986#discussion_r502127875
########## 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: then we need to store that default version for each action and fetch it before invoke/get an action how about adding a new field or an annotation field to action named `publish` which default to true if not exist, when user invoke/get an action without an `version` parameter, the latest and `published` action will be used, if `version` parameter is provided, then ignore this `publish` field, so users can test(invoke/get) with no-published versions ########## File path: core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala ########## @@ -216,11 +224,23 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with case _ => entitlementProvider.check(user, content.exec) } + val latestDocId = WhiskActionVersionList.get(entityName, entityStore).map { result => Review comment: yes, I will update ---------------------------------------------------------------- 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: us...@infra.apache.org