Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.

2018-05-30 Thread Aditya Toshniwal
Hi Hackers,

PFA updated patch after all the permutations, combinations for encoding for
SQL_ASCII database.  Also fixed a small glitch for sql editor connection
status check.

Please note, ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x73 is
a Postgres DB error and not pgAdmin4 error.



You need to change client_encoding to the appropriate. After changing
client_encoding using command - set client_encoding='XYZ', it will give not
give error.








Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"

On Wed, May 23, 2018 at 10:13 AM, Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Thank you Victoria, Anthony.
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>
> On Tue, May 22, 2018 at 7:15 PM, Victoria Henry  wrote:
>
>> Hi Aditya,
>>
>> We made a minor change to make the patch so the python linter can pass.
>> Attached is the change we made.
>> Everything else looks good.
>>
>> Sincerely,
>>
>> Victoria & Anthony
>>
>> On Tue, May 22, 2018 at 4:46 AM Aditya Toshniwal <
>> aditya.toshni...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA updated patch. Linter issues are fixed ( we dont have any linter
>>> setup for python :-( )
>>> Regarding test cases, they run successfully on my system and the reason
>>> it failed for pivotal is timeout exception. I am sorry I can't help with
>>> that.
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_tests/keyboard_shortcut_test.py",
>>> line 52, in runTest
>>> self._check_shortcuts()
>>>   File 
>>> "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_tests/keyboard_shortcut_test.py",
>>> line 77, in _check_shortcuts
>>> ") and contains(@class, 'open')]")
>>>   File "/root/.pyenv/versions/pgadmin36/lib/python3.6/site-packages
>>> /selenium/webdriver/support/wait.py", line 80, in until
>>> raise TimeoutException(message, screen, stacktrace)
>>> selenium.common.exceptions.TimeoutException: Message:
>>>
>>> Thanks and Regards,
>>> Aditya Toshniwal
>>> Software Engineer | EnterpriseDB Software Solutions | Pune
>>> "Don't Complain about Heat, Plant a tree"
>>>
>>> On Tue, May 22, 2018 at 1:37 PM, Dave Page  wrote:
>>>
 Hi

 Pivotal's buildbot is showing problems with this patch:

 https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/pipelines
 /pgadmin-patch/jobs/run-linter/builds/66 (linter failed)
 https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/pipelines
 /pgadmin-patch/jobs/run-tests/builds/84 (tests failed)


 On Tue, May 22, 2018 at 7:05 AM, Aditya Toshniwal <
 aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> PFA patch for RM#3289 where decode error was thrown on querying a
> SQL_ASCII database table. Please note, this problem occurs only on 
> windows.
> Sample insert - insert into test_tab values ('é');
>
> psycopg2 has a encodings dictionary where Postgres Database Encodings
> are mapped to python equivalent. It uses 'ascii' decoder of python to
> decode for SQL_ASCII encoding. If data has characters beyond the limit of
> ascii then it failed. The solution would be to use utf_8 decoder instead 
> of
> ascii. I tried setting the client_encoding using
> set_client_encoding('UTF8') method of a psycopg2 connection but no luck
> (also its not allowed for async connection). I also tried executing "SET
> CLIENT_ENCODING='UTF8'" but it didn't work too.
> So, as in the patch, I had to set encodings dict value directly to
> 'utf_8' and it seems to be working. Please note, the same is added to
> psycopg3 milestones
> https://github.com/psycopg/psycopg2/milestone/4
>
> Also fixed a small glitch for sql editor connection status check.
>
> Kindly review.
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>



 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

>>>
>>>
>


RM3289.patch
Description: Binary data


[PATCH] Support for the source-map in Karma test framework

2018-05-30 Thread Ashesh Vashi
Hi Team,

Debugging the failed jasmine test-cases is very difficult with the current
implementation.
The stack-traces does not give the correct information as It does not have
source-map support for the original code.
And, that makes it very difficult to debug the issue during development.

Please attached a patch for adding the support for the source-map in the
karma test framework.

I have also attached another patch, which will definitely fail some of the
test-cases to show the stack-traces of the failed cases.

Please find the output of 'yarn run test:karma-once' before applying the
proposed patch as below:

*...*

*HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
parent exists returns true FAILED*
* Expected true to be false. at UserContext.
(regression/javascript/tree/tree_spec.js:780:40)HeadlessChrome 0.0.0 (Mac
OS X 10.11.6): Executed 534 of 586 (1 FAILED) (0 secs / 10.361
secs)HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
parent exists returns true FAILED Expected true to be false.HeadlessChrome
0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload reloads the node and
its children FAILED TypeError: Cannot read property 'fakeFail' of undefined
at TreeFake.addNewNode (regression/javascript/tree/tree_spec.js:237:22)
at TreeFake.addNewNode
(regression/javascript/tree/tree_spec.js:465:116) at
UserContext. (regression/javascript/tree/tree_spec.js:790:14)
TypeError: Cannot read property 'reload' of undefined at
UserContext.
(regression/javascript/tree/tree_spec.js:798:16)HeadlessChrome 0.0.0 (Mac
OS X 10.11.6): Executed 535 of 586 (2 FAILED) (0 secs / 10.365
secs)HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
reloads the node and its children FAILED TypeError: Cannot read property
'fakeFail' of undefined at TreeFake.addNewNode
(regression/javascript/tree/tree_spec.js:237:22) at TreeFake.addNewNode
(regression/javascript/tree/tree_spec.js:465:116) at
UserContext. (regression/javascript/tree/tree_spec.js:790:14)
TypeError: Cannot read property 'reload' of undefined...*


After applying the proposed patch:

*...*
*HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
parent exists returns true FAILED*
* Expected true to be false.*
* at UserContext.
(regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:233:40)*
*HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 534 of 586 (1 FAILED) (0
secs / 8.157 secs)*
*HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
parent exists returns true FAILED*
* Expected true to be false.*
*HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
reloads the node and its children FAILED*
* TypeError: Cannot read property 'fakeFail' of undefined*
* at TreeFake.addNewNode
(regression/javascript/tree/webpack:/pgadmin/static/js/tree/tree.js:96:18)*
* at TreeFake.addNewNode
(regression/javascript/tree/webpack:/regression/javascript/tree/tree_fake.js:25:5)*
* at UserContext.
(regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:243:14)*
* TypeError: Cannot read property 'reload' of undefined*
* at UserContext.
(regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:252:16)*
*HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 535 of 586 (2 FAILED) (0
secs / 8.179 secs)*
*HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
reloads the node and its children FAILED*
* TypeError: Cannot read property 'fakeFail' of undefined*
* at TreeFake.addNewNode
(regression/javascript/tree/webpack:/pgadmin/static/js/tree/tree.js:96:18)*
* at TreeFake.addNewNode
(regression/javascript/tree/webpack:/regression/javascript/tree/tree_fake.js:25:5)*
* at UserContext.
(regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:243:14)*
* TypeError: Cannot read property 'reload' of undefined*

*...*



As you can see, it gives a lot more relevant information in the stack trace.

Please let me know if you have any objection to the proposed patch.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*



karma_webpack_source_map_support.patch
Description: Binary data


karma_testcases_expected_to_fail.patch
Description: Binary data


[pgAdmin4][Patch#3389] To prevent unwanted model changes in Server dialog

2018-05-30 Thread Murtuza Zabuawala
Hi,

PFA minor patch to fix the issue when you change any field in server dialog
'tunnel_identity_file' model value get included unnecessarily in the update
request.

eg: Change the server name and click on Save button, Check the request
payload in network console.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


RM_3389.diff
Description: Binary data


Container build hanging

2018-05-30 Thread Dave Page
Hi

The container build is hanging for me on 2 different machines at:

20:19:50 $ cross-env NODE_ENV=production yarn run bundle:dev
20:19:51 $ yarn run linter && yarn run webpacker
20:19:52 $ yarn eslint --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .
20:19:52 $ /pgadmin4/web/node_modules/.bin/eslint --no-eslintrc -c
.eslintrc.js --ext .js --ext .jsx .

Both systems (a Jenkins build node and my laptop) hang at that step,
seemingly indefinitely.

Running the same (e.g. yarn eslint --no-eslintrc -c .eslintrc.js --ext .js
--ext .jsx .) is fine directly on my laptop.

Anyone got any ideas why that may be? The only thing I can think of is the
overly cute unicode symbols that yarn is spitting out may be confusing
docker.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.

2018-05-30 Thread Joao De Almeida Pereira
Hello Aditya,

It looks ok and it passes CI.

We have some recommendations:
- These look like 2 different changes so they should be in separated commits
- Do we have test coverage for the bug that you are talking about? If not
we should, to ensure this problem does not happen again in a future change.


Thanks
Victoria && Joao

On Wed, May 30, 2018 at 3:06 AM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> PFA updated patch after all the permutations, combinations for encoding
> for SQL_ASCII database.  Also fixed a small glitch for sql editor
> connection status check.
>
> Please note, ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x73
> is a Postgres DB error and not pgAdmin4 error.
>
>
>
> You need to change client_encoding to the appropriate. After changing
> client_encoding using command - set client_encoding='XYZ', it will give not
> give error.
>
>
>
>
>
>
>
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>
> On Wed, May 23, 2018 at 10:13 AM, Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Thank you Victoria, Anthony.
>>
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB Software Solutions | Pune
>> "Don't Complain about Heat, Plant a tree"
>>
>> On Tue, May 22, 2018 at 7:15 PM, Victoria Henry 
>> wrote:
>>
>>> Hi Aditya,
>>>
>>> We made a minor change to make the patch so the python linter can pass.
>>> Attached is the change we made.
>>> Everything else looks good.
>>>
>>> Sincerely,
>>>
>>> Victoria & Anthony
>>>
>>> On Tue, May 22, 2018 at 4:46 AM Aditya Toshniwal <
>>> aditya.toshni...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA updated patch. Linter issues are fixed ( we dont have any linter
 setup for python :-( )
 Regarding test cases, they run successfully on my system and the reason
 it failed for pivotal is timeout exception. I am sorry I can't help with
 that.

 Traceback (most recent call last):
   File
 "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_tests/keyboard_shortcut_test.py",
 line 52, in runTest
 self._check_shortcuts()
   File
 "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_tests/keyboard_shortcut_test.py",
 line 77, in _check_shortcuts
 ") and contains(@class, 'open')]")
   File
 "/root/.pyenv/versions/pgadmin36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py",
 line 80, in until
 raise TimeoutException(message, screen, stacktrace)
 selenium.common.exceptions.TimeoutException: Message:

 Thanks and Regards,
 Aditya Toshniwal
 Software Engineer | EnterpriseDB Software Solutions | Pune
 "Don't Complain about Heat, Plant a tree"

 On Tue, May 22, 2018 at 1:37 PM, Dave Page  wrote:

> Hi
>
> Pivotal's buildbot is showing problems with this patch:
>
>
> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/pipelines/pgadmin-patch/jobs/run-linter/builds/66
> (linter failed)
>
> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/pipelines/pgadmin-patch/jobs/run-tests/builds/84
> (tests failed)
>
>
> On Tue, May 22, 2018 at 7:05 AM, Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> PFA patch for RM#3289 where decode error was thrown on querying a
>> SQL_ASCII database table. Please note, this problem occurs only on 
>> windows.
>> Sample insert - insert into test_tab values ('é');
>>
>> psycopg2 has a encodings dictionary where Postgres Database Encodings
>> are mapped to python equivalent. It uses 'ascii' decoder of python to
>> decode for SQL_ASCII encoding. If data has characters beyond the limit of
>> ascii then it failed. The solution would be to use utf_8 decoder instead 
>> of
>> ascii. I tried setting the client_encoding using
>> set_client_encoding('UTF8') method of a psycopg2 connection but no luck
>> (also its not allowed for async connection). I also tried executing "SET
>> CLIENT_ENCODING='UTF8'" but it didn't work too.
>> So, as in the patch, I had to set encodings dict value directly to
>> 'utf_8' and it seems to be working. Please note, the same is added to
>> psycopg3 milestones
>> https://github.com/psycopg/psycopg2/milestone/4
>>
>> Also fixed a small glitch for sql editor connection status check.
>>
>> Kindly review.
>>
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB Software Solutions | Pune
>> "Don't Complain about Heat, Plant a tree"
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


>>
>


Re: [PATCH] Support for the source-map in Karma test framework

2018-05-30 Thread Joao De Almeida Pereira
Hello Ashesh

The change looks great. This will help the community a lot when we are
TDDing new features.

Please do not forget NOT to commit the second patch.

Thanks
Victoria && Joao

On Wed, May 30, 2018 at 3:51 AM Ashesh Vashi 
wrote:

> Hi Team,
>
> Debugging the failed jasmine test-cases is very difficult with the current
> implementation.
> The stack-traces does not give the correct information as It does not
> have source-map support for the original code.
> And, that makes it very difficult to debug the issue during development.
>
> Please attached a patch for adding the support for the source-map in the
> karma test framework.
>
> I have also attached another patch, which will definitely fail some of the
> test-cases to show the stack-traces of the failed cases.
>
> Please find the output of 'yarn run test:karma-once' before applying the
> proposed patch as below:
>
> *...*
>
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED*
> * Expected true to be false. at UserContext.
> (regression/javascript/tree/tree_spec.js:780:40)HeadlessChrome 0.0.0 (Mac
> OS X 10.11.6): Executed 534 of 586 (1 FAILED) (0 secs / 10.361
> secs)HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED Expected true to be false.HeadlessChrome
> 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload reloads the node and
> its children FAILED TypeError: Cannot read property 'fakeFail' of undefined
> at TreeFake.addNewNode (regression/javascript/tree/tree_spec.js:237:22)
> at TreeFake.addNewNode
> (regression/javascript/tree/tree_spec.js:465:116) at
> UserContext. (regression/javascript/tree/tree_spec.js:790:14)
> TypeError: Cannot read property 'reload' of undefined at
> UserContext.
> (regression/javascript/tree/tree_spec.js:798:16)HeadlessChrome 0.0.0 (Mac
> OS X 10.11.6): Executed 535 of 586 (2 FAILED) (0 secs / 10.365
> secs)HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
> reloads the node and its children FAILED TypeError: Cannot read property
> 'fakeFail' of undefined at TreeFake.addNewNode
> (regression/javascript/tree/tree_spec.js:237:22) at TreeFake.addNewNode
> (regression/javascript/tree/tree_spec.js:465:116) at
> UserContext. (regression/javascript/tree/tree_spec.js:790:14)
> TypeError: Cannot read property 'reload' of undefined...*
>
>
> After applying the proposed patch:
>
> *...*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED*
> * Expected true to be false.*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:233:40)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 534 of 586 (1 FAILED)
> (0 secs / 8.157 secs)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED*
> * Expected true to be false.*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
> reloads the node and its children FAILED*
> * TypeError: Cannot read property 'fakeFail' of undefined*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/pgadmin/static/js/tree/tree.js:96:18)*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_fake.js:25:5)*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:243:14)*
> * TypeError: Cannot read property 'reload' of undefined*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:252:16)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 535 of 586 (2 FAILED)
> (0 secs / 8.179 secs)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
> reloads the node and its children FAILED*
> * TypeError: Cannot read property 'fakeFail' of undefined*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/pgadmin/static/js/tree/tree.js:96:18)*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_fake.js:25:5)*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:243:14)*
> * TypeError: Cannot read property 'reload' of undefined*
>
> *...*
>
>
>
> As you can see, it gives a lot more relevant information in the stack
> trace.
>
> Please let me know if you have any objection to the proposed patch.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>


pgAdmin 4 commit: Fix syntax

2018-05-30 Thread Dave Page
Fix syntax

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=189e3076719be3bf592e2b9ae766c9377ef24668

Modified Files
--
pkg/docker/Dockerfile |  2 +-
web/package.json  | 18 +-
2 files changed, 10 insertions(+), 10 deletions(-)



pgAdmin 4 commit: Disable emojis in Yarn output.

2018-05-30 Thread Dave Page
Disable emojis in Yarn output.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b2d4c6ef9d7715c62310bd05dace97f7523a527d

Modified Files
--
pkg/docker/Dockerfile |  4 ++--
web/package.json  | 20 ++--
2 files changed, 12 insertions(+), 12 deletions(-)



Re: [pgAdmin4][Patch#3389] To prevent unwanted model changes in Server dialog

2018-05-30 Thread Joao De Almeida Pereira
Hi Murtuza,

We are having a hard time understanding the logic on the change.

If tunnel_authentication is not on the model and the tunnel_identify_file
is present, we change the tunnel_identify_file in the model to null? Is
this what you mean?

Thanks
Victoria && Joao
​

On Wed, May 30, 2018 at 9:27 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to fix the issue when you change any field in server
> dialog 'tunnel_identity_file' model value get included unnecessarily in the
> update request.
>
> eg: Change the server name and click on Save button, Check the request
> payload in network console.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


Re: pgAdmin 4 commit: Disable emojis in Yarn output.

2018-05-30 Thread Joao De Almeida Pereira
Hello Dave,
When running yarn linter after this commit we get the following:

yarn run v1.7.0
$ yarn eslint --emoji false --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .
$ /Users/pivotal/workspace/pgadmin4/web/node_modules/.bin/eslint
--emoji false --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .
Invalid option '--emoji' - perhaps you meant '--env'?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
this command.

Thanks
Victoria && Joao
​

On Wed, May 30, 2018 at 4:42 PM Dave Page  wrote:

> Disable emojis in Yarn output.
>
> Branch
> --
> master
>
> Details
> ---
>
> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b2d4c6ef9d7715c62310bd05dace97f7523a527d
>
> Modified Files
> --
> pkg/docker/Dockerfile |  4 ++--
> web/package.json  | 20 ++--
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
>


pgAdmin 4 commit: Revert failed Yarn changes.

2018-05-30 Thread Dave Page
Revert failed Yarn changes.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=6a28b9ff26b7cde442dd2aaeed72d5c3b47fc30f

Modified Files
--
pkg/docker/Dockerfile |  2 +-
web/package.json  | 12 ++--
2 files changed, 7 insertions(+), 7 deletions(-)



pgAdmin 4 commit: Remove duplicate options

2018-05-30 Thread Dave Page
Remove duplicate options

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8bda4e02305d2d9481de5fbc1d0fe225b8cb9405

Modified Files
--
pkg/docker/Dockerfile |  2 +-
web/package.json  | 12 ++--
2 files changed, 7 insertions(+), 7 deletions(-)



pgAdmin 4 commit: Fix failed yarn changes

2018-05-30 Thread Dave Page
Fix failed yarn changes

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b00931407ee2cd3588a3ed81b94c464cd95c379f

Modified Files
--
pkg/docker/Dockerfile |  4 ++--
web/package.json  | 20 ++--
2 files changed, 12 insertions(+), 12 deletions(-)



pgAdmin 4 commit: Fix failed yarn changes

2018-05-30 Thread Dave Page
Fix failed yarn changes

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=bea176a6463690a3e2cecda37569125cf97e575c

Modified Files
--
pkg/docker/Dockerfile |  2 +-
web/package.json  | 18 +-
2 files changed, 10 insertions(+), 10 deletions(-)



Re: pgAdmin 4 commit: Disable emojis in Yarn output.

2018-05-30 Thread Dave Page
Yeah - I pushed by mistake (don't ask). It's reverted now.

Sorry!

On Wed, May 30, 2018 at 4:50 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Dave,
> When running yarn linter after this commit we get the following:
>
> yarn run v1.7.0
> $ yarn eslint --emoji false --no-eslintrc -c .eslintrc.js --ext .js --ext 
> .jsx .
> $ /Users/pivotal/workspace/pgadmin4/web/node_modules/.bin/eslint --emoji 
> false --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .
> Invalid option '--emoji' - perhaps you meant '--env'?
> error Command failed with exit code 1.
> info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this 
> command.
> error Command failed with exit code 1.
> info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this 
> command.
>
> Thanks
> Victoria && Joao
> ​
>
> On Wed, May 30, 2018 at 4:42 PM Dave Page  wrote:
>
>> Disable emojis in Yarn output.
>>
>> Branch
>> --
>> master
>>
>> Details
>> ---
>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=
>> b2d4c6ef9d7715c62310bd05dace97f7523a527d
>>
>> Modified Files
>> --
>> pkg/docker/Dockerfile |  4 ++--
>> web/package.json  | 20 ++--
>> 2 files changed, 12 insertions(+), 12 deletions(-)
>>
>>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

2018-05-30 Thread Joao De Almeida Pereira
Hello Akshay,

Thanks for taking a look. We did the following changes over your patch:

   - Changed the XPATH to CSS_SELECTOR, please look in
pgadmin/feature_tests/query_tool_tests.py:660
   and 667
   - Changed the other places in _query_tool_notify_statements to do not
   use xpath.
   - Moved the skip that previously was around the entire function to
   surround only the pg_notify call

Thanks
Victoria && Joao
​

On Wed, May 30, 2018 at 1:52 AM Akshay Joshi 
wrote:

> Hi Joao
>
> On Tue, May 29, 2018 at 9:10 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Akshay,
>>
>> The code looks good, we do have some minor notes for next time:
>>
>> . To make the code easier to understand we should decide on 1 term and
>> not have notifies and notifications to reference the same thing.
>>
>  Fixed and used 'notifies' where it reference the same, but still at
> some places 'notifications' is used because the new tab represents the
> 'Notifications'.
>
>
>> . It would be nice if we tried not to use XPATH to get the HTML
>> components that we are testing on. Maybe try to use CSS classes. Selenium
>> also has a driver.select_by_class_name which would work well in this
>> case.
>>
>  Tried to use both CSS_SELECTOR and CLASS_NAME, but it doesn't
> support string comparison(contains method). I have googled for this and
> most of the sites suggested to use XPATH where we can use contains()
> method.
>
>
>> The error that we are seeing in CI is related to pg_notify. This function
>> was introduced in 9.0 and Greenplum is still not there yet. In order to
>> solve this need to skip that part of the tests. There is an example in that
>> same file using the function _test_explain_plan_feature to skip a tests
>> depending on the Version.
>>
> OK. I have skip that part of the tests as per your suggestion. I have
> rename the method "_test_explain_plan_feature" to
> "_supported_server_version" which is more meaningful then the previous one.
>
>Attached is the modified patch. Please review it.
>
>
>> Thanks
>> Anthony && Joao
>> ​
>>
>> On Mon, May 28, 2018 at 1:34 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Hakers,
>>>
>>> On my last patch feature tests were failed for GreenPlum5 database only
>>> not for PostgreSQL. I have verified that on
>>> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/pipelines/pgadmin-patch/jobs/run-tests/builds/93
>>> .
>>>
>>> Can someone from Pivotal team help me, as I don't have GreenPlum
>>> database and don't know why it is failing.
>>>
>>> On Sat, May 26, 2018 at 5:47 PM, Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Hackers,

 As per suggestion by Dave and discussion with in the team, I have
 modified the logic again. Following are the modifications:

- Instead of waiting for another query to execute on the session
where 'LISTEN' command has been executed, we fetched the notify 
 messages in
the connection status polling logic. Doing this user will get the notify
messages asap.
- Instead of showing all the notifications in single alertify dialog,
we call *alertify.info ('') *for
individual notifications.
- Created new tab 'Notifications' in Query Tool where all the
notify messages will be recorded with the timestamp and payload.

 Please review the latest patch.

 On Tue, May 22, 2018 at 2:43 PM, Dave Page  wrote:

>
>
> On Tue, May 22, 2018 at 10:01 AM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Dave
>>
>> On Tue, May 22, 2018 at 2:02 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Tue, May 22, 2018 at 9:13 AM, Dave Page 
>>> wrote:
>>>
 Hi

 On Tue, May 22, 2018 at 7:07 AM, Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Hi Hackers,
>
> As per suggestion by Dave, I have modified the logic and now
> notifications are popped up in alertify dialog(refer
> Notify_Messages.png) as and when received on that session where
> "LISTEN" is executed. Attached is the modified patch, please review 
> it.
>
> To test this feature following steps need to perform:
>
>- Apply the patch.
>- Run pgAdmin4
>- Connect to any database server and open query tool.
>- Execute 'LISTEN foo;' command.
>- Open another query tool window and execute 'NOTIFY foo'.
>(This is without payload).
>- Execute 'select pg_notify('foo', 'Hello')' query (with
>payload).
>- Go to the query tool window from where 'LISTEN' was executed
>and run any other query.
>
> I think there was a small misunderstanding here - I was suggesting
 that each notification be displayed in an Alerti

Re: Container build hanging

2018-05-30 Thread Dave Page
Hi

So it turns out the hang was a result of:

=
Using the '.eslintignore' config file for excluding the temporary,
vendor specific, and templates files, instead of writing our own logic
to do so.

Patch by: Anthony & Joao
Reviewed by: Khushboo

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=
a7ee85619dfd4cf42a43919beeb1cd1680f46d53
Author: Anthony Emengo 

Modified Files
--
web/.eslintignore |  5 +
web/package.json  |  2 +-
web/pga_eslint.js | 44 
3 files changed, 6 insertions(+), 45 deletions(-)
=

Reverting that one patch fixes the issue. Can one or more of you take a
look please?

Note that running the Docker build is easy - just install Docker and run
"make docker". However, it uses committed code in the build, so any changes
need to be committed to your local tree or they'll be ignored (yes, we need
to fix that).

Thanks!



On Wed, May 30, 2018 at 3:33 PM, Dave Page  wrote:

> Hi
>
> The container build is hanging for me on 2 different machines at:
>
> 20:19:50 $ cross-env NODE_ENV=production yarn run bundle:dev
> 20:19:51 $ yarn run linter && yarn run webpacker
> 20:19:52 $ yarn eslint --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .
> 20:19:52 $ /pgadmin4/web/node_modules/.bin/eslint --no-eslintrc -c
> .eslintrc.js --ext .js --ext .jsx .
>
> Both systems (a Jenkins build node and my laptop) hang at that step,
> seemingly indefinitely.
>
> Running the same (e.g. yarn eslint --no-eslintrc -c .eslintrc.js --ext .js
> --ext .jsx .) is fine directly on my laptop.
>
> Anyone got any ideas why that may be? The only thing I can think of is the
> overly cute unicode symbols that yarn is spitting out may be confusing
> docker.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgadmin, docker and ipv6

2018-05-30 Thread Dave Page
Hi

On Sun, May 27, 2018 at 7:13 AM, Александр Шишенко 
wrote:

> Hello,
>
> I was running my pgadmin4 v2 on my ipv6-only subnet using docker image.
> After the update, I noticed, that you have changed your webserver from
> Apache to gunicorn, and it is configured to listen only on ipv4 network
> (0.0.0.0), so it is unreachable from my network without using docker-proxy
> (and I can't use that on my configuration).
>
> Please, consider switching to dual-stack networking in your configuration.
> It is just as simple as changing '--bind 0.0.0.0:${PGADMIN_LISTEN_PORT:-
> 443}' to '--bind [::]:${PGADMIN_LISTEN_PORT:-443}' in your
> pkg/docker/entrypoint.sh.
> --
>
>

Can you log this on the tracker please?
https://redmine.postgresql.org/projects/pgadmin4/issues/new

Thanks!


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgadmin, docker and ipv6

2018-05-30 Thread Александр Шишенко
Sure, here is the ticket: https://redmine.postgresql.org/issues/3392 31.05.2018, 00:47, "Dave Page" :Hi On Sun, May 27, 2018 at 7:13 AM, Александр Шишенко  wrote:Hello, I was running my pgadmin4 v2 on my ipv6-only subnet using docker image. After the update, I noticed, that you have changed your webserver from Apache to gunicorn, and it is configured to listen only on ipv4 network (0.0.0.0), so it is unreachable from my network without using docker-proxy (and I can't use that on my configuration). Please, consider switching to dual-stack networking in your configuration. It is just as simple as changing '--bind 0.0.0.0:${PGADMIN_LISTEN_PORT:-443}' to '--bind [::]:${PGADMIN_LISTEN_PORT:-443}' in your pkg/docker/entrypoint.sh.--   Can you log this on the tracker please? https://redmine.postgresql.org/projects/pgadmin4/issues/new Thanks!  --Dave PageBlog: http://pgsnake.blogspot.comTwitter: @pgsnakeEnterpriseDB UK: http://www.enterprisedb.comThe Enterprise PostgreSQL Company  -- 

Re: pgadmin, docker and ipv6

2018-05-30 Thread Dave Page
Thanks!

On Wed, May 30, 2018 at 5:53 PM, Александр Шишенко 
wrote:

> Sure, here is the ticket: https://redmine.postgresql.org/issues/3392
>
> 31.05.2018, 00:47, "Dave Page" :
>
> Hi
>
> On Sun, May 27, 2018 at 7:13 AM, Александр Шишенко 
> wrote:
>
> Hello,
>
> I was running my pgadmin4 v2 on my ipv6-only subnet using docker image.
> After the update, I noticed, that you have changed your webserver from
> Apache to gunicorn, and it is configured to listen only on ipv4 network
> (0.0.0.0), so it is unreachable from my network without using docker-proxy
> (and I can't use that on my configuration).
>
> Please, consider switching to dual-stack networking in your configuration.
> It is just as simple as changing '--bind 0.0.0.0:${PGADMIN_LISTEN_PORT:-
> 443}' to '--bind [::]:${PGADMIN_LISTEN_PORT:-443}' in your
> pkg/docker/entrypoint.sh.
> --
>
>
>
> Can you log this on the tracker please? https://redmine.
> postgresql.org/projects/pgadmin4/issues/new
>
> Thanks!
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
>
> --
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgAdmin 4 commit: Ensure backup/restore/maintenance work via SSH tunnel

2018-05-30 Thread Dave Page
Ensure backup/restore/maintenance work via SSH tunnels. Fixes #3355

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2b4605a9d390cb44e5dfe9967c3adf2b28d04f1f
Author: Akshay Joshi 

Modified Files
--
web/pgadmin/tools/backup/__init__.py  | 42 +--
web/pgadmin/tools/maintenance/__init__.py |  6 -
web/pgadmin/tools/restore/__init__.py | 24 +++---
3 files changed, 55 insertions(+), 17 deletions(-)



Re: [pgAdmin4][Patch] RM #3355 User can not perform operation of backup,Backup all, Backup global and Maintenance DB with ssh tunneling

2018-05-30 Thread Dave Page
Thanks, applied.

On Tue, May 29, 2018 at 6:41 AM, Akshay Joshi  wrote:

> Hi Hackers,
>
> Attached is the patch to fix RM #3355 User can not perform operation of
> backup, Backup all, Backup global and Maintenance DB with ssh tunneling.
>
> Please review it.
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgAdmin 4 commit: Add support for LISTEN/NOTIFY in the query tool. Fixe

2018-05-30 Thread Dave Page
Add support for LISTEN/NOTIFY in the query tool. Fixes #3204

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=38ee39ae7acb32e331f0ba291e1036d721de8eb4
Author: Akshay Joshi 

Modified Files
--
docs/en_US/release_notes_3_1.rst   |   1 +
web/pgadmin/feature_tests/query_tool_tests.py  |  77 ++--
web/pgadmin/static/js/sqleditor/execute_query.js   |   4 +
.../js/sqleditor/query_tool_notifications.js   | 131 +
web/pgadmin/static/js/sqleditor_utils.js   |   6 +
web/pgadmin/tools/sqleditor/__init__.py|  13 +-
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |  24 +++-
.../tools/sqleditor/utils/start_running_query.py   |   6 +-
.../utils/tests/test_start_running_query.py|  17 ++-
web/pgadmin/utils/driver/psycopg2/connection.py|  62 ++
.../javascript/sqleditor/execute_query_spec.js |  13 +-
11 files changed, 335 insertions(+), 19 deletions(-)



Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

2018-05-30 Thread Dave Page
Thanks, applied.

On Wed, May 30, 2018 at 1:52 AM, Akshay Joshi  wrote:

> Hi Joao
>
> On Tue, May 29, 2018 at 9:10 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Akshay,
>>
>> The code looks good, we do have some minor notes for next time:
>>
>> . To make the code easier to understand we should decide on 1 term and
>> not have notifies and notifications to reference the same thing.
>>
>  Fixed and used 'notifies' where it reference the same, but still at
> some places 'notifications' is used because the new tab represents the
> 'Notifications'.
>
>
>> . It would be nice if we tried not to use XPATH to get the HTML
>> components that we are testing on. Maybe try to use CSS classes. Selenium
>> also has a driver.select_by_class_name which would work well in this
>> case.
>>
>  Tried to use both CSS_SELECTOR and CLASS_NAME, but it doesn't
> support string comparison(contains method). I have googled for this and
> most of the sites suggested to use XPATH where we can use contains()
> method.
>
>
>> The error that we are seeing in CI is related to pg_notify. This function
>> was introduced in 9.0 and Greenplum is still not there yet. In order to
>> solve this need to skip that part of the tests. There is an example in that
>> same file using the function _test_explain_plan_feature to skip a tests
>> depending on the Version.
>>
> OK. I have skip that part of the tests as per your suggestion. I have
> rename the method "_test_explain_plan_feature" to
> "_supported_server_version" which is more meaningful then the previous one.
>
>Attached is the modified patch. Please review it.
>
>
>> Thanks
>> Anthony && Joao
>> ​
>>
>> On Mon, May 28, 2018 at 1:34 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Hakers,
>>>
>>> On my last patch feature tests were failed for GreenPlum5 database only
>>> not for PostgreSQL. I have verified that on https://gpdb-dev.bosh.pivot
>>> alci.info/teams/pgadmin/pipelines/pgadmin-patch/jobs/run-tests/builds/93
>>> .
>>>
>>> Can someone from Pivotal team help me, as I don't have GreenPlum
>>> database and don't know why it is failing.
>>>
>>> On Sat, May 26, 2018 at 5:47 PM, Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Hackers,

 As per suggestion by Dave and discussion with in the team, I have
 modified the logic again. Following are the modifications:

- Instead of waiting for another query to execute on the session
where 'LISTEN' command has been executed, we fetched the notify 
 messages in
the connection status polling logic. Doing this user will get the notify
messages asap.
- Instead of showing all the notifications in single alertify dialog,
we call *alertify.info ('') *for
individual notifications.
- Created new tab 'Notifications' in Query Tool where all the
notify messages will be recorded with the timestamp and payload.

 Please review the latest patch.

 On Tue, May 22, 2018 at 2:43 PM, Dave Page  wrote:

>
>
> On Tue, May 22, 2018 at 10:01 AM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Dave
>>
>> On Tue, May 22, 2018 at 2:02 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Tue, May 22, 2018 at 9:13 AM, Dave Page 
>>> wrote:
>>>
 Hi

 On Tue, May 22, 2018 at 7:07 AM, Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Hi Hackers,
>
> As per suggestion by Dave, I have modified the logic and now
> notifications are popped up in alertify dialog(refer
> Notify_Messages.png) as and when received on that session where
> "LISTEN" is executed. Attached is the modified patch, please review 
> it.
>
> To test this feature following steps need to perform:
>
>- Apply the patch.
>- Run pgAdmin4
>- Connect to any database server and open query tool.
>- Execute 'LISTEN foo;' command.
>- Open another query tool window and execute 'NOTIFY foo'.
>(This is without payload).
>- Execute 'select pg_notify('foo', 'Hello')' query (with
>payload).
>- Go to the query tool window from where 'LISTEN' was executed
>and run any other query.
>
> I think there was a small misunderstanding here - I was suggesting
 that each notification be displayed in an Alertify notification, e.g. 
 using
 alertify.message('A notification of FOO was received with payload
 '1234'...')

>>>
>>If there are too many notifications then it's annoying for
>> user to popped up N number of alertify dialogs. Notification is only
>> receives when any other query execute on the session where "LISTEN" 
>> command
>> exe

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

2018-05-30 Thread Dave Page
Thanks all, applied.

On Wed, May 30, 2018 at 5:06 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Akshay,
>
> Thanks for taking a look. We did the following changes over your patch:
>
>- Changed the XPATH to CSS_SELECTOR, please look in
>pgadmin/feature_tests/query_tool_tests.py:660 and 667
>- Changed the other places in _query_tool_notify_statements to do not
>use xpath.
>- Moved the skip that previously was around the entire function to
>surround only the pg_notify call
>
> Thanks
> Victoria && Joao
> ​
>
> On Wed, May 30, 2018 at 1:52 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Joao
>>
>> On Tue, May 29, 2018 at 9:10 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hello Akshay,
>>>
>>> The code looks good, we do have some minor notes for next time:
>>>
>>> . To make the code easier to understand we should decide on 1 term and
>>> not have notifies and notifications to reference the same thing.
>>>
>>  Fixed and used 'notifies' where it reference the same, but still at
>> some places 'notifications' is used because the new tab represents the
>> 'Notifications'.
>>
>>
>>> . It would be nice if we tried not to use XPATH to get the HTML
>>> components that we are testing on. Maybe try to use CSS classes. Selenium
>>> also has a driver.select_by_class_name which would work well in this
>>> case.
>>>
>>  Tried to use both CSS_SELECTOR and CLASS_NAME, but it doesn't
>> support string comparison(contains method). I have googled for this and
>> most of the sites suggested to use XPATH where we can use contains()
>> method.
>>
>>
>>> The error that we are seeing in CI is related to pg_notify. This
>>> function was introduced in 9.0 and Greenplum is still not there yet. In
>>> order to solve this need to skip that part of the tests. There is an
>>> example in that same file using the function _test_explain_plan_feature
>>> to skip a tests depending on the Version.
>>>
>> OK. I have skip that part of the tests as per your suggestion. I have
>> rename the method "_test_explain_plan_feature" to
>> "_supported_server_version" which is more meaningful then the previous one.
>>
>>Attached is the modified patch. Please review it.
>>
>>
>>> Thanks
>>> Anthony && Joao
>>> ​
>>>
>>> On Mon, May 28, 2018 at 1:34 AM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Hakers,

 On my last patch feature tests were failed for GreenPlum5 database only
 not for PostgreSQL. I have verified that on https://gpdb-dev.bosh.
 pivotalci.info/teams/pgadmin/pipelines/pgadmin-patch/jobs/
 run-tests/builds/93.

 Can someone from Pivotal team help me, as I don't have GreenPlum
 database and don't know why it is failing.

 On Sat, May 26, 2018 at 5:47 PM, Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Hi Hackers,
>
> As per suggestion by Dave and discussion with in the team, I have
> modified the logic again. Following are the modifications:
>
>- Instead of waiting for another query to execute on the session
>where 'LISTEN' command has been executed, we fetched the notify 
> messages in
>the connection status polling logic. Doing this user will get the 
> notify
>messages asap.
>- Instead of showing all the notifications in single alertify
>dialog, we call *alertify.info ('') *for
>individual notifications.
>- Created new tab 'Notifications' in Query Tool where all the
>notify messages will be recorded with the timestamp and payload.
>
> Please review the latest patch.
>
> On Tue, May 22, 2018 at 2:43 PM, Dave Page  wrote:
>
>>
>>
>> On Tue, May 22, 2018 at 10:01 AM, Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Dave
>>>
>>> On Tue, May 22, 2018 at 2:02 PM, Dave Page 
>>> wrote:
>>>


 On Tue, May 22, 2018 at 9:13 AM, Dave Page 
 wrote:

> Hi
>
> On Tue, May 22, 2018 at 7:07 AM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> As per suggestion by Dave, I have modified the logic and now
>> notifications are popped up in alertify dialog(refer
>> Notify_Messages.png) as and when received on that session where
>> "LISTEN" is executed. Attached is the modified patch, please review 
>> it.
>>
>> To test this feature following steps need to perform:
>>
>>- Apply the patch.
>>- Run pgAdmin4
>>- Connect to any database server and open query tool.
>>- Execute 'LISTEN foo;' command.
>>- Open another query tool window and execute 'NOTIFY foo'.
>>(This is without payload).
>>- Execute 'select pg_no

pgAdmin 4 commit: Add support for source maps in the karma test framewo

2018-05-30 Thread Dave Page
Add support for source maps in the karma test framework to aid debugging.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=86712b1bd2df25525cce923a382963797a1c6e25
Author: Ashesh Vashi 

Modified Files
--
web/karma.conf.js  | 19 +++
web/package.json   |  2 ++
web/webpack.test.config.js |  1 +
web/yarn.lock  | 21 -
4 files changed, 38 insertions(+), 5 deletions(-)



Re: [PATCH] Support for the source-map in Karma test framework

2018-05-30 Thread Dave Page
Thanks, applied.

On Wed, May 30, 2018 at 3:50 AM, Ashesh Vashi  wrote:

> Hi Team,
>
> Debugging the failed jasmine test-cases is very difficult with the current
> implementation.
> The stack-traces does not give the correct information as It does not
> have source-map support for the original code.
> And, that makes it very difficult to debug the issue during development.
>
> Please attached a patch for adding the support for the source-map in the
> karma test framework.
>
> I have also attached another patch, which will definitely fail some of the
> test-cases to show the stack-traces of the failed cases.
>
> Please find the output of 'yarn run test:karma-once' before applying the
> proposed patch as below:
>
> *...*
>
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED*
> * Expected true to be false. at UserContext.
> (regression/javascript/tree/tree_spec.js:780:40)HeadlessChrome 0.0.0 (Mac
> OS X 10.11.6): Executed 534 of 586 (1 FAILED) (0 secs / 10.361
> secs)HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED Expected true to be false.HeadlessChrome
> 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload reloads the node and
> its children FAILED TypeError: Cannot read property 'fakeFail' of undefined
> at TreeFake.addNewNode (regression/javascript/tree/tree_spec.js:237:22)
> at TreeFake.addNewNode
> (regression/javascript/tree/tree_spec.js:465:116) at
> UserContext. (regression/javascript/tree/tree_spec.js:790:14)
> TypeError: Cannot read property 'reload' of undefined at
> UserContext.
> (regression/javascript/tree/tree_spec.js:798:16)HeadlessChrome 0.0.0 (Mac
> OS X 10.11.6): Executed 535 of 586 (2 FAILED) (0 secs / 10.365
> secs)HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
> reloads the node and its children FAILED TypeError: Cannot read property
> 'fakeFail' of undefined at TreeFake.addNewNode
> (regression/javascript/tree/tree_spec.js:237:22) at TreeFake.addNewNode
> (regression/javascript/tree/tree_spec.js:465:116) at
> UserContext. (regression/javascript/tree/tree_spec.js:790:14)
> TypeError: Cannot read property 'reload' of undefined...*
>
>
> After applying the proposed patch:
>
> *...*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED*
> * Expected true to be false.*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:233:40)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 534 of 586 (1 FAILED)
> (0 secs / 8.157 secs)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #hasParent
> parent exists returns true FAILED*
> * Expected true to be false.*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
> reloads the node and its children FAILED*
> * TypeError: Cannot read property 'fakeFail' of undefined*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/pgadmin/static/js/tree/tree.js:96:18)*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_fake.js:25:5)*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:243:14)*
> * TypeError: Cannot read property 'reload' of undefined*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:252:16)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 535 of 586 (2 FAILED)
> (0 secs / 8.179 secs)*
> *HeadlessChrome 0.0.0 (Mac OS X 10.11.6) tree tests TreeNode #reload
> reloads the node and its children FAILED*
> * TypeError: Cannot read property 'fakeFail' of undefined*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/pgadmin/static/js/tree/tree.js:96:18)*
> * at TreeFake.addNewNode
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_fake.js:25:5)*
> * at UserContext.
> (regression/javascript/tree/webpack:/regression/javascript/tree/tree_spec.js:243:14)*
> * TypeError: Cannot read property 'reload' of undefined*
>
> *...*
>
>
>
> As you can see, it gives a lot more relevant information in the stack
> trace.
>
> Please let me know if you have any objection to the proposed patch.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.

2018-05-30 Thread Aditya Toshniwal
Hi Victoria/Joao,

On Thu, May 31, 2018 at 2:06 AM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Aditya,
>
> It looks ok and it passes CI.
>
> We have some recommendations:
> - These look like 2 different changes so they should be in separated
> commits
>

If you are talking of set client_encoding, then its not a bug. Its a choice
given to Postgres DB user to change the encoding of the characters.
Postgres will translate characters from Server Encoding to Client Encoding,
and will throw error like mentioned previously. This link will help better
- https://www.postgresql.org/docs/10/static/multibyte.html
The actual bug was, even after changing the client encoding to SQL_ASCII,
pgAdmin4 was not able to show the output as it was failing in encoding by
psycopg2. The patch is for resolving that.


> - Do we have test coverage for the bug that you are talking about? If not
> we should, to ensure this problem does not happen again in a future change.
>

It is not possible adding test cases for encoding related stuff, as
Postgres support a lot many different types of encoding and conversions
(refer above link)

>
> Thanks
> Victoria && Joao
>
> On Wed, May 30, 2018 at 3:06 AM Aditya Toshniwal  enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> PFA updated patch after all the permutations, combinations for encoding
>> for SQL_ASCII database.  Also fixed a small glitch for sql editor
>> connection status check.
>>
>> Please note, ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x73
>> is a Postgres DB error and not pgAdmin4 error.
>>
>> 
>>
>> You need to change client_encoding to the appropriate. After changing
>> client_encoding using command - set client_encoding='XYZ', it will give not
>> give error.
>>
>> 
>>
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB Software Solutions | Pune
>> "Don't Complain about Heat, Plant a tree"
>>
>> On Wed, May 23, 2018 at 10:13 AM, Aditya Toshniwal > enterprisedb.com> wrote:
>>
>>> Thank you Victoria, Anthony.
>>>
>>> Thanks and Regards,
>>> Aditya Toshniwal
>>> Software Engineer | EnterpriseDB Software Solutions | Pune
>>> "Don't Complain about Heat, Plant a tree"
>>>
>>> On Tue, May 22, 2018 at 7:15 PM, Victoria Henry 
>>> wrote:
>>>
 Hi Aditya,

 We made a minor change to make the patch so the python linter can
 pass.  Attached is the change we made.
 Everything else looks good.

 Sincerely,

 Victoria & Anthony

 On Tue, May 22, 2018 at 4:46 AM Aditya Toshniwal >>> enterprisedb.com> wrote:

> Hi,
>
> PFA updated patch. Linter issues are fixed ( we dont have any linter
> setup for python :-( )
> Regarding test cases, they run successfully on my system and the
> reason it failed for pivotal is timeout exception. I am sorry I can't help
> with that.
>
> Traceback (most recent call last):
>   File "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_
> tests/keyboard_shortcut_test.py", line 52, in runTest
> self._check_shortcuts()
>   File "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_
> tests/keyboard_shortcut_test.py", line 77, in _check_shortcuts
> ") and contains(@class, 'open')]")
>   File "/root/.pyenv/versions/pgadmin36/lib/python3.6/site-
> packages/selenium/webdriver/support/wait.py", line 80, in until
> raise TimeoutException(message, screen, stacktrace)
> selenium.common.exceptions.TimeoutException: Message:
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>
> On Tue, May 22, 2018 at 1:37 PM, Dave Page  wrote:
>
>> Hi
>>
>> Pivotal's buildbot is showing problems with this patch:
>>
>> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/
>> pipelines/pgadmin-patch/jobs/run-linter/builds/66 (linter failed)
>> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/
>> pipelines/pgadmin-patch/jobs/run-tests/builds/84 (tests failed)
>>
>>
>> On Tue, May 22, 2018 at 7:05 AM, Aditya Toshniwal > enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> PFA patch for RM#3289 where decode error was thrown on querying a
>>> SQL_ASCII database table. Please note, this problem occurs only on 
>>> windows.
>>> Sample insert - insert into test_tab values ('é');
>>>
>>> psycopg2 has a encodings dictionary where Postgres Database
>>> Encodings are mapped to python equivalent. It uses 'ascii' decoder of
>>> python to decode for SQL_ASCII encoding. If data has characters beyond 
>>> the
>>> limit of ascii then it failed. The solution would be to use utf_8 
>>> decoder
>>> instead of ascii. I tried setting the client_encoding using
>>> set_client_encoding('UTF8') method of a psycopg2 connection but no luck
>>> (also its not allowed for async connection

Re: [pgAdmin4][Patch#3389] To prevent unwanted model changes in Server dialog

2018-05-30 Thread Murtuza Zabuawala
Hello Victoria & Joao,


On Thu, May 31, 2018 at 2:17 AM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Murtuza,
>
> We are having a hard time understanding the logic on the change.
>
> If tunnel_authentication is not on the model and the tunnel_identify_file
> is present, we change the tunnel_identify_file in the model to null? Is
> this what you mean?
>
​Yes, basically we make use of identity file only in case of tunnel
authentication​ is enabled (true/false).

The earlier logic was written in such way that if tunnel authentication is
set to disbaled/false then set the identity file filed value to empty
string in the model, But as you can see that tunnel authentication is by
default set to '0' in the model, so whenever user opens a edit/properties
dialog the identitiy files sets to empty string even if ssh tunnel is
disbaled. In my patch I choose to nullify the value instead of empty string
so that it will be easy on python side condition checking :)




> Thanks
> Victoria && Joao
> ​
>
> On Wed, May 30, 2018 at 9:27 AM Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA minor patch to fix the issue when you change any field in server
>> dialog 'tunnel_identity_file' model value get included unnecessarily in the
>> update request.
>>
>> eg: Change the server name and click on Save button, Check the request
>> payload in network console.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>