hasadna / reportit-agent

1 stars 1 forks source link

update wait to consider context #53

Closed noamoss closed 4 years ago

noamoss commented 4 years ago

to enable recursive functions, see

in the reportit-agent code

image

akariv commented 4 years ago

where is this NgoOrgsLoop? @noamoss

noamoss commented 4 years ago

@akariv ... not sure what you are asking

it is not implemented of course, since it would break the service. I showed you the code on one of our meetings - you looked at my code you said you know what is the issue and that my implementation is fine - and that's something you need. There is no difference betweeh the NgoOrgsLoop and the GovOrgsLoop - except for the parameter in the function.

noamoss commented 4 years ago

@akariv let me know if you need anything on this issue.

noamoss commented 4 years ago

@akariv please explain

akariv commented 4 years ago

The problem preventing loops in scripts using the method above (using prepare + next functions) was solved.

noamoss commented 4 years ago

@akariv tried compile my recursive functions following the recentupdate and got this error: image, referring to

this.report ).pipe( switchMap((retval) => { if (retval === this.runner.COMPLETE) { this.content.addOptions(null, [ { value: true, display: 'לחצו לסיום השיחה והצגת רשימת המשימות' }, ]); } else { this.content.addOptions(null, [ { value: true, display: 'השיחה הופסקה אולם תוכלו לחזור אליה בהמשך - לחצו להצגת רשימת המשימות' }, ]); } return this.content.waitForInput(false); }),

Notice I did not call the false it was on the repo, but it is probably related to your comment on https://github.com/hasadna/reportit-user/issues/41:

If calling waitForInput inside a function, make sure to pass 'false' as a parameter there.

akariv commented 4 years ago

npm install

On Sat, Dec 14, 2019, 00:08 noamoss notifications@github.com wrote:

Reopened #53 https://github.com/hasadna/reportit-agent/issues/53.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hasadna/reportit-agent/issues/53?email_source=notifications&email_token=AACAY5LKKOFKN4EL2O7MF5TQYQBU5A5CNFSM4JF6HFU2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOVPKBNOI#event-2882803385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAY5NWYWEWERUOZVGT5ZDQYQBU5ANCNFSM4JF6HFUQ .

noamoss commented 4 years ago

@akariv worked.

Now my problem is how to quickly compile the local YAML into json, to check the functions are working well, and well integerated into the script - before making these changes on reportit-scripts and deploying to live.

I assume using the old yaml_to_json.py convertor is the easiest way, right? If so, can you return it to this (and the user) repos? If not, can you guide me how to perform script changes locally, for checks, before applying the on reportit-scripts?

akariv commented 4 years ago

That script is still in use in the reporit-sctipts repo, you can run it there to compile the script from the builder without having to do a deploy. The resulting json file can be then copied to the agent repo for testing purposes.

On Sat, Dec 14, 2019, 11:51 noamoss notifications@github.com wrote:

@akariv https://github.com/akariv worked.

Now my problem is how to quickly compile the local YAML into json, to check the functions are working well, and well integerated into the script

  • before making these changes on reportit-scripts and deploying to live.

I assume using the old yaml_to_json.py convertor is the easiest way, right? If so, can you return it to this (and the user) repos? If not, can you guide me how to perform script changes locally, for checks, before applying the on reportit-scripts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hasadna/reportit-agent/issues/53?email_source=notifications&email_token=AACAY5IFRE7NF5DB6O5Z6ULQYSUBLA5CNFSM4JF6HFU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG37AQA#issuecomment-565702720, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAY5OYEXUNLTCJBEUV72DQYSUBLANCNFSM4JF6HFUQ .

noamoss commented 4 years ago

@akariv

The current yaml_to_json.py is not working on the command line, as it includes newer features which (connection to firebase and kind of file) - I can't spend the time to debug it just to update the script locally. Hope we can think of a better way to enable local checks of the script.

akariv commented 4 years ago

If you don't include any other information other than 'not working' it's not going to be easy to fix the issue you're seeing.

On Sat, Dec 14, 2019 at 6:35 PM noamoss notifications@github.com wrote:

@akariv https://github.com/akariv

The current yaml_to_json.py is not working on the command line, as it includes newer features which (connection to firebase and kind of file) - I can't spend the time to debug it just to update the script locally. Hope we can think of a better way to enable local checks of the script.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hasadna/reportit-agent/issues/53?email_source=notifications&email_token=AACAY5NZBKIOGYLT2JI2E4DQYUDMNA5CNFSM4JF6HFU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4GI6Y#issuecomment-565732475, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAY5OOVOZTYKDY25ZZMX3QYUDMNANCNFSM4JF6HFUQ .

noamoss commented 4 years ago

it returns the following error:

Traceback (most recent call last): File "yaml_to_json.py", line 173, in yaml.dump(scripts, f_in.open('w'), allow_unicode=True, indent=2, width=1000000) File "/home/newone/anaconda3/lib/python3.7/pathlib.py", line 1176, in open opener=self._opener) File "/home/newone/anaconda3/lib/python3.7/pathlib.py", line 1030, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'src/user/script.yaml'

but looking at the script shows why - it is built for local file anymore.

noamoss commented 4 years ago

I know it looks like I should just manually change the path - but it looks like much more than that when looking at the script.

akariv commented 4 years ago

You should run it from the root of the reporit-scripts repo, like so:

python tools/yaml_to_json.py

On Sat, Dec 14, 2019, 19:35 noamoss notifications@github.com wrote:

I know it looks like I should just manually change the path - but it looks like much more than that when looking at the script.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hasadna/reportit-agent/issues/53?email_source=notifications&email_token=AACAY5J55RSV6NCECSOLVZTQYUKMLA5CNFSM4JF6HFU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4HMGA#issuecomment-565736984, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAY5P5C2ZTIWWQODTG7TDQYUKMLANCNFSM4JF6HFUQ ._

noamoss commented 4 years ago

closing this messy issue in favor of https://github.com/hasadna/reportit-agent/issues/70