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
HPCC-18038 Remove the version option from the publish and java command #10316
Conversation
https://track.hpccsystems.com/browse/HPCC-18038 |
@rpastrana @afishbeck Please review when you have a chance. |
@@ -180,7 +180,7 @@ bool EsdlCMDShell::parseCommandLineOptions(ArgvIterator &iter) | |||
void EsdlCMDShell::usage() | |||
{ | |||
fprintf(stdout,"\nUsage:\n" | |||
" esdl [--version] <command> [<args>]\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.
We should provide usage for the new "build" command, but also consider keeping this version command to remain consistent across various HPCC command line tools (ecl, eclcc, etc).
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 did add usage for --build in the common command usage. What I'm trying to do is to avoid overloading the meaning of --version, as although we're removing it from publish and java, it's still being used for specifying esdl version in xsd and wsdl commands.
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 could change the xsd and wsdl to use --ver_ (which nicely corresponds to the url parameter name to specify service version), and restore --version solely to printout build info. Do you guys like that better?
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.
makes sense, maybe the tool version command remains --version and the interface version gets an explicit name --interfaceversion or some shorter derivation of it?
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.
Agreed that we should use --version the way other commands do (like ecl.exe) rather than --build.
Where we do want interface version specified, the long intuitive name should be something like "--interface-version".. for people who haven't memorized the short easy name, something like "-iv", or if you guys have a better idea for the short name I'm open.
"--" should always be a long form very intuitive and explicit name. So not --ver_. Single "-" should be a short name, often an abbreviation or single letter. But again I think -ver_ is a bit too awkward.
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.
Sounds reasonable, I'll replace --version with --interface-version and -iv, then replace --build with --version.
5b09435
to
c427fe7
Compare
Changes made as suggested. @rpastrana @afishbeck please review again. |
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.
@mayx A couple of concerns, I might have clouded the issue with my attempt to explain my concerns... don't hesitate to contact me directly if my explanation doesn't make sense.
@@ -79,7 +79,6 @@ class EsdlPublishCmdCommon : public EsdlCmdCommon | |||
" --port <port> WsESDLConfig service port\n" | |||
" -u, --username <name> Username for accessing WsESDLConfig service\n" | |||
" -pw, --password <pw> Password for accessing WsESDLConfig service\n" | |||
" --version <ver> ESDL service version\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.
I think we need to keep this line in the base class usage (and update it to "--interface-version, ESDL interface version\n") since all extensions of this class support should support --version (now --interface-version)
If publish command won't acknowledge this argument, then that class needs to override this usage.
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.
Actually the --version (now --interface-version) is not being used by other publish commands. A couple of other commands takes a "definition version/sequence#" as parameter but that is specified on the command line directly, not with --version (now --interface-version) option. I don't think any of the publish commands need or should specify the interface version.
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.
ahh.. ok so then StringAttr optVersionStr; and double optVersion; are actually being used as "esdl_definition_version"?? maybe we refactor them to esdl_def_ver?
@@ -94,8 +93,6 @@ class EsdlPublishCmdCommon : public EsdlCmdCommon | |||
return true; | |||
if (iter.matchFlag(optWSProcPort, ESDL_OPTION_SERVICE_PORT) || iter.matchFlag(optWSProcPort, ESDL_OPT_SERVICE_PORT)) | |||
return true; | |||
if (iter.matchFlag(optVersionStr, ESDLOPT_VERSION)) |
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 if needs to stay, and check for ESDLOPT_INTERFACE_VERSION || ESDLOPT_IV... we might also want to refactor optVersionStr and optVersion to reflect their actual purpose which is to hold the InterfaceVersion value as declared by the user.
--UPDATE-- looking through the code, I just realized that this member var is also used to hold the ESDL definition version for EsdlDeleteESDLDefCmd; EsdlBindMethodCmd. I don't like overloading variables, so we can either declare a new member var for those classes to hold the ESDL definition version, or live with the way things are, but then we can't refactor optVersionStr and optVersion as suggested above
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.
Yes this is another thing I was thinking to change, but thought it would tie better with another improvement subtask I may make. But maybe changing the variable name now will make it more clear, let me check...
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.
Also, while we're at it...
It seems the usage at the top level might be off:
esdlcmd_shell.cpp:
esdl [--version] []\n\n"
should change to
esdl []\n\n"
and --version should be listed as a command
@JamesDeFabia this change might require a doc change (I think an issue is already open, but wanted to point this out)
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 may also refactor the variable name for the definition sequence. What better describes this variable, "definitionVersion" or "defintionSequence", @rpastrana @afishbeck ?
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.
both are appropriate, sequence might be more accurate, but I think we refer to that number as the definition version in other places. I vote definitionVersion
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 agree with moving --version as a command.
Did the variable name refactoring, also added a separate line for --version usage. @rpastrana @afishbeck please review again. |
tools/esdlcmd/esdl-publish.cpp
Outdated
@@ -615,7 +599,7 @@ class EsdlDeleteESDLDefCmd : public EsdlPublishCmdCommon | |||
optESDLService.set(arg); | |||
break; | |||
case 1: | |||
optVersionStr.set(arg); | |||
optDefinitionVersionStr.set(arg); |
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.
It seems inconsistent to me that when we bind a service we use a definition ID of the format "MyDefinition.3", but here we use a separate ESDLService and Version "MyDefinition 3".
I prefer the ID type usage... which is how roxie queries work... "myquery.5".
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.
Especially when it looks like we turn it into an ID before sending it to ESP.
If we make that change we may not need the variable anymore, but I also wonder if the name "PublishedVersion" is more descriptive... meaning the particular version of the ESDLService that was published for "myserv.3"
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.
Agreed, my original implementation introduced this inconsistency. Changing things now will break users, but we might have to tear off the band-aid quickly and move on.
If we make the change, we could make the fix backward compatible, but I'm not sure if that would be worth the effort.
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.
Sorry missed this string of comments. I was thinking to deal with this inconsistency in a separate issue, but since we're already here and touched on the code already, I may just do it now.
tools/esdlcmd/esdlcmd_common.hpp
Outdated
@@ -62,6 +62,8 @@ typedef IEsdlCommand *(*EsdlCommandFactory)(const char *cmdname); | |||
#define ESDLOPT_XSLT_PATH "--xslt" | |||
|
|||
#define ESDLOPT_VERSION "--version" | |||
#define ESDLOPT_INTERFACE_VERSION "--interface-version" | |||
#define ESDLOPT_IV "-iv" |
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.
"-iv" is considered an abbreviated or short form of "--interface-version" so there is a naming convention to just add an "_S". Making it #define ESDLOPT_INTERFACE_VERSION_S "-iv"
Like this example:
#define ECLOPT_INPUT "--input"
#define ECLOPT_INPUT_S "-in"
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.
A few comments
Changed ESDLOPT_IV to ESDLOPT_INTERFACE_VERSION_S, please review again. There're a few other existing options that don't follow this convention, but I think it would be better to address them in a separate refactoring issue. |
- For publish and java commands, remove the version option and don't pass in version when loading dependencies - Don't validate version command option for publish and java - Remove the --version option from the batch file for ECL IDE - Remove the --version from ReadMeFirst.txt help file - Refactor the variable name optVersion to optInterfaceVersion for xsd and wsdl commands - Change defintion version to definition id for commands delete and bind-method. Signed-off-by: mayx <yanrui.ma@lexisnexisrisk.com>
Removed optDefinitionVersion variable, changed definition version to definition id for commands delete and bind-method. @afishbeck @rpastrana please review again. |
Automated Smoketest: ✅
Install hpccsystems-platform-community_6.4.1-closedown0.el7.x86_64.rpm Unit tests result:
Regression test result:
HPCC Stop: OK |
@@ -863,7 +826,7 @@ class EsdlBindMethodCmd : public EsdlBindServiceCmd | |||
printf( "\n Use this command to publish ESDL Service based bindings.\n" | |||
" To bind a ESDL Service, provide the target ESP process name\n" | |||
" (esp which will host the service.) \n" | |||
" It is also necessary to provide the Port on which this service is configured to run (ESP Binding),\n" | |||
" It is also necessary to provide the target ESP binding name,\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.
Does just specifying the port not work? I think using port is much more intuitive than ESP binding name... which is usually a confusing unique id. If it doesn't work, please open a JIRA to add it (to any command line that currently requires ESP binding name). If it does work the help should still say so (in fact it should be considered the preferred way.
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.
@mayx @rpastrana Btw, in the future when this is fully dynamic the port will still make sense, but the ESP binding name will no longer make sense.
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.
For this command (bind-method), it doesn't take port as a parameter. I've created an issue for it: https://track.hpccsystems.com/browse/HPCC-18126
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.
@mayx some comments
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.
@mayx looks good
" ESDLServiceDefinitionName The name of the ESDL service definition to delete\n" | ||
" ESDLServiceDefinitionVersion The version of the ESDL service definition to delete\n"); | ||
"esdl delete <ESDLDefinitionID> [command options]\n\n" | ||
" ESDLDefinitionID The ESDL definition id <esdldefname>.<esdldefver>\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.
@JamesDeFabia note this change. It needs to be documented
"Commonly used commands:\n" | ||
" xml Generate XML from ESDL definition.\n" | ||
" ecl Generate ECL from ESDL definition.\n" | ||
" xsd Generate XSD from ESDL definition.\n" | ||
" wsdl Generate WSDL from ESDL definition.\n" | ||
" publish Publish ESDL Definition for ESP use.\n" | ||
" list-definitions List all ESDL definitions.\n" | ||
" get-definition Get ESDL definition.\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.
Is this part of a different change?
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.
@rpastrana get-definition command is already there, it was only missing from the usage.
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.
@mayx looks good. I do have a question about the new command "get-definition"
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.
@mayx looks good.
pass in 0 instead.
Signed-off-by: mayx yanrui.ma@lexisnexisrisk.com
Type of change:
Checklist:
Testing: