-
Notifications
You must be signed in to change notification settings - Fork 45
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
Side deck for plugins #30
base: v1.x/staging
Are you sure you want to change the base?
Side deck for plugins #30
Conversation
fkovinAtRocket
commented
May 2, 2019
- side deck that a plugin can use to link with the functions in the server
- script that I used to generate it
- header file that has all the functions that are in the side deck
- side deck that a plugin can use to link with the functions in the server - script that I used to generate it - header file that has all the functions that are in the side deck Signed-off-by: Fyodor Kovin <[email protected]>
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 line endings in this file look strange. I know that the side file must have 80 character across. Is this going to cause an issue when it's checked out?
Jordan, the file is supposed to be 80 char fixed block, so it doesn't have line endings. Every line is exactly 80 characters, padded with spaces if needed. The only problem would be if it's stored internally represented in ISO8859-1: it's unlikely that the compiler supports file tags and auto conversion. It looks like git check out stuff in 1047 by default though, so that should be alright. |
What really concerns me though is that we're adding many functions whose name don't have prefixes, like: Some of them might be non-essential, but the functions in httpserver.c definitely must go there, and they all are unprefixed, with names like So I'm wondering if we should take the time and rename them to e.g. |
Would we want to include the recovery.c functions (recoveryPush, recoveryPop, etc)? The recovery context is created by ZSS, so it's better if we provide those functions as they may be incompatible with the context if linked statically. |
Signed-off-by: Fyodor Kovin <[email protected]>
How far do we go here? charsets.c and xml.c also look like someone may want to use them. |
As I though of this, the criteria is not so much whether someone wants to use it or not. The code is always there and they can link statically. Each new file added to this side deck is a potential pain for us, since everything that has once been added there becomes an API and thus a maintenance burden for us. Since this PR is approved, we won't be able to easily rename a function from http.c, for example, because someone's plugin will break and fail to load because a symbol will not be found. Rather, the criteria was: include everything that's required for communication between ZSS and the plugin. Nothing good will happen if ZSS passes a plugin a HTTPRequest that was made by an incompatibly changed constructor function, and the plugin has statically linked an older version. HTTP, dataserivce, json, logging, recovery, even utils because of StringList are all shared between ZSS and plugins. |
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.
This approach to side file generation should not be done for two reasons
- It includes several internal functions that shouldn't be called at least due to them having no good meaning or purpose to plugins
- It generates a nearly unreadable file that breaks our rule for 120 character line length limit. side file specification does not say that you cannot have a newline on the last byte of the 80 column line.
A good start would be a hand-crafted file including only useful functions, or, having a file generated by including only functions that are marked by some means as being valid for inclusion. It is easier to add on request as needed than to remove when people wrongly depended on what should have been an internal function that we didn't sufficiently protect in the first place.
Now is also not the right time to be attempting to rename internal functions to work-around the automated pitfalls. That could be significant effort and could cause significant problems for direct extenders of zowe-common-c.
|
Side files are human-readable files when written to only include functions that plugins should be able to use, and exclude those they shouldn't rely on. They then serve as a form of documentation. What's a "useful" function will change over time, so we should start with a short list and only extend it when requested and the request has merit. |
Example of something that shouldn't be in the side file but is in this PR: dequeueHttpRequest |
Signed-off-by: Fyodor Kovin <[email protected]>
686c21f
to
d90953b
Compare
Signed-off-by: Fyodor Kovin <[email protected]>
6316f0c
to
4f5cd0e
Compare
It turns out that we actually need xml.c because there's a global function in httpserver that creates an XML object. |
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 think this approach can work, but there's more to blacklist.
lib/zss.x
Outdated
IMPORT CODE,'zssServer','setConfiguredProperty' | ||
IMPORT CODE,'zssServer','setContentType' | ||
IMPORT CODE,'zssServer','setDefaultJSONRESTHeaders' | ||
IMPORT CODE,'zssServer','setHttpAuthTrace' |
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'd blacklist all the tracers... doesn't seem like something that plugins should be touching.
lib/zss.x
Outdated
IMPORT CODE,'zssServer','printStderr' | ||
IMPORT CODE,'zssServer','printStdout' | ||
IMPORT CODE,'zssServer','printXMLToken' | ||
IMPORT CODE,'zssServer','processHttpFragment' |
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.
This seems too internal
lib/zss.x
Outdated
IMPORT CODE,'zssServer','logGetLevel' | ||
IMPORT CODE,'zssServer','logSetLevel' | ||
IMPORT CODE,'zssServer','logShouldTraceInternal' | ||
IMPORT CODE,'zssServer','mainHttpLoop' |
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.
Wouldn't be used by a plugin.
Signed-off-by: Fyodor Kovin <[email protected]>
Signed-off-by: Fyodor Kovin <[email protected]>
…fication-of-addresses Adding ipAddresses field for zlux and agent(zss) for specifying binding to specific IPs