-
Notifications
You must be signed in to change notification settings - Fork 2
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
019 minor fixes #292
019 minor fixes #292
Conversation
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.
All comments are below, but this one just is not related to any specific piece of code: since this PR adds descriptions to almost all of the PHP functions, would be nice to have one for getAction()
as well.
Most of the comments are just suggestions: current version of the PR already makes things better than they were so it makes sence to merge it even as it is right now. So please let me know if you would prefer to leave it as it is or will make some changes.
Thank you for bringing some order to the Chaos! :)
9e9a2dc
to
7b16c01
Compare
Done. |
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.
Few more comments/suggestions.
aad01ab
to
5cf279d
Compare
5cf279d
to
9513771
Compare
Rebased the branch on |
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 am sorry I missed a couple of things during previous review.
I am asking you to change the following things:
- return value of
run.sh
when--help
option is used; - fix description of
constructDataJson()
(the part related to the"doc_as_upsert"
); - mark
--
as required delimiter between arguments ofrun.sh
andesFormat.php
.
And, optionally -- add the link to the ES documentation to the constructActionJson
function's description.
7812ed6
to
21e81e2
Compare
- Separate the definitions into default values (constants) and variables. - Add descriptions.
Exit shouldn't depend on usage()'s return value.
run.sh is a wrapper around PHP script and even uses it to explain the meaning of run.sh's ARGS.
Bring the style closer to that of pyDKB/dataflow/stage/AbstractStage.py.
Having whole message on the same level of indent makes it easier to read and edit.
Details about passing arguments to esFormat.php and getting help for it are unnecessary when the script is called from run.sh.
- Reword the description: 'Elasticsearch config' can be understood in different ways. - Display the default value of the config. - Move the definition of two variables before the usage(): previous point requires one of them.
It is not really important whether a document will be processed alone or in bulk.
The variable's value gets overwritten later in code, so it shouldn't be initialized here to avoid confusion.
It is not changed through the script, so it's actually a 'constant'.
To avoid confusion with DEFAULT_ACTION being changed during the script execution, a new variable is added, while DEFAULT_ACTION's value remains constant and is used, if necessary, to define the new variable. Remove the lengthy comment about DEFAULT_ACTION as it is no longer necessary.
This separator is used in many bash commands - while its role may be obvious to some, others may be unaware of it.
21e81e2
to
fe29851
Compare
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.
That's the last change request here, this time's (almost) for sure.
Commit message of the fe29851 ilooks very confusing: 0
is rarely referred to as a error status, so when I see error status 0
I stumble for a moment and not sure what to think about. Exit status, satus code, exit code, return code, maybe exit value or something?
If you don't mind, please change this commit message -- and let me know what's your decision concerning the getAction()
description.
Action is 'update' if {'_update': true} key-value pair is | ||
present in the document. Otherwise, default value is returned. |
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.
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.
Done, 3a078d4.
Non-zero exit status usually signals that some kind of error occured. Co-Authored-By: Marina Golosova <golosova.marina@gmail.com>
-- is supposed to separate arguments for run.sh and PHP script. The fact that everything works without it is, actually, a bug that would be dealt with later.
a1eb61b
to
3a078d4
Compare
Comment about "error status" is valid, I probably made a mistake while typing. Fixed. |
@Evildoor, thank you! |
Fix various minor problems with the stage.
https://trello.com/c/ZUvvKjKC
https://trello.com/c/wjTOlVWt