-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow to get activation list by a binding package name #4919
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4919 +/- ##
==========================================
- Coverage 83.51% 77.72% -5.80%
==========================================
Files 201 201
Lines 9441 9521 +80
Branches 396 407 +11
==========================================
- Hits 7885 7400 -485
- Misses 1556 2121 +565
Continue to review full report at Codecov.
|
|
@@ -3,7 +3,7 @@ | |||
"language": "javascript", | |||
"views": { | |||
"activations": { | |||
"map": "function (doc) {\n var PATHSEP = \"/\";\n var isActivation = function (doc) { return (doc.activationId !== undefined) };\n var summarize = function (doc) {\n var endtime = doc.end !== 0 ? doc.end : undefined;\n return {\n namespace: doc.namespace,\n name: doc.name,\n version: doc.version,\n publish: doc.publish,\n annotations: doc.annotations,\n activationId: doc.activationId,\n start: doc.start,\n end: endtime,\n duration: endtime !== undefined ? endtime - doc.start : undefined,\n cause: doc.cause,\n statusCode: (endtime !== undefined && doc.response !== undefined && doc.response.statusCode !== undefined) ? doc.response.statusCode : undefined\n }\n };\n\n var pathFilter = function(doc) {\n for (i = 0; i < doc.annotations.length; i++) {\n var a = doc.annotations[i];\n if (a.key == \"path\") try {\n var p = a.value.split(PATHSEP);\n if (p.length == 3) {\n return p[1] + PATHSEP + doc.name;\n } else return doc.name;\n } catch (e) {\n return doc.name;\n }\n }\n return doc.name;\n }\n\n if (isActivation(doc)) try {\n var value = summarize(doc)\n emit([doc.namespace+PATHSEP+pathFilter(doc), doc.start], value);\n } catch (e) {}\n}\n", | |||
"map": "function (doc) {\n var PATHSEP = \"/\";\n var isActivation = function (doc) { return (doc.activationId !== undefined) };\n var summarize = function (doc) {\n var endtime = doc.end !== 0 ? doc.end : undefined;\n return {\n namespace: doc.namespace,\n name: doc.name,\n version: doc.version,\n publish: doc.publish,\n annotations: doc.annotations,\n activationId: doc.activationId,\n start: doc.start,\n end: endtime,\n duration: endtime !== undefined ? endtime - doc.start : undefined,\n cause: doc.cause,\n statusCode: (endtime !== undefined && doc.response !== undefined && doc.response.statusCode !== undefined) ? doc.response.statusCode : undefined\n }\n };\n \n var pathFilter = function(doc) {\n var path = undefined;\n var binding = undefined;\n for (i = 0; i < doc.annotations.length; i++) {\n var a = doc.annotations[i];\n if (a.key == \"path\") {\n path = a.value;\n }\n if (a.key == \"binding\") {\n binding = a.value;\n }\n }\n try {\n if (binding) {\n var b = binding.split(PATHSEP)\n return b[1] + PATHSEP + doc.name;\n }\n if (path) {\n var p = path.split(PATHSEP);\n if (p.length == 3) {\n return p[1] + PATHSEP + doc.name;\n } else return doc.name; \n }\n } catch (e) {\n return doc.name;\n }\n return doc.name;\n }\n\n if (isActivation(doc)) try {\n var value = summarize(doc)\n emit([doc.namespace+PATHSEP+pathFilter(doc), doc.start], value);\n } catch (e) {}\n}\n", |
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.
please use a new view with a different version number since updating this design doc will cause the view to recompute which can take a long time.
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.
Thanks for making the change. I also suggest keeping the v2.1.0 view around for a while to allow operators a chance to migrate.
@rabbah Thank you for your review. I've added the v2.1.0 view again. |
I am merging this with the confirmation from @rabbah again on Slack. |
Description
Users cannot query the activation list by a binding package name. And It also becomes ambiguous if there is a package that is the same as the original package name of the binding package.
This PR changes the activation list query to more clear.
Ambiguous case
In this case, the
guest
namespace cannot get the activations invoked only in the/guest/p1
package.The entity name
/whisk.system/p1/a1
and/guest/p1/a1
returns same results:User expected behavior for activations of binding package action
In general, the behavior expected by the user is to get activations for each binding package. They expect to see activations of the two binding packages separately.
Related issue and scope
My changes affect the following components
Types of changes
Checklist: