[pgAdmin][SonarQube] Cognitive complexity roles + test cases

2020-08-27 Thread Aditya Toshniwal
Hi Hackers,

Attached is the patch to reduce the cognitive complexity for
validate_request function in roles module from 258 to 15. I've also added a
few more test scenarios in the roles RE-SQL test cases to make sure the
changes are tested.

Please review.

-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*

"Don't Complain about Heat, Plant a TREE"


sonarqube.cognitive.roles.patch
Description: Binary data


Re: SCSS Minor SonarQube fixes

2020-08-27 Thread Akshay Joshi
Hi Aditya

Can you please review the patch?

On Thu, Aug 27, 2020 at 11:25 AM Pramod Ahire 
wrote:

> Hi,
>
>
>
> Please find attached minor fixes for sonarqube, which includes changes as
> below:
>
>
>
>- Removed duplicate CSS declaration
>- Added proper font with font-family
>
>
>
> Please do let me know if any changes or missed.
>
>
>
> *Pramod Ahire*
>
> *Software Engineer*
>
>
>
> [image:
> https://lh4.googleusercontent.com/U1erEuyI_d0xEUA0CrKjwx9aWQ52HNCxc38dMsLP-ZrLgfVNrhsrNobxlmeOdb1kMPtrrxcUwEHZgbGJC4R0qR4r1sBZa_z9R8ihFRaP2Hr_Wnhq6HcIQHe1ZoviDPwUkTdzNcg]
>
>
>
> C: +91-020-66449600/601
>
> D: +91-9028697679
>
> *edbpostgres.com *
>
>
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: SCSS Minor SonarQube fixes

2020-08-27 Thread Aditya Toshniwal
Hi Pramod,

-  font-family: monospace, monospace;
+  font-family: 'Roboto Mono', monospace;

We do not use Roboto for codemirror. Please revert the change. Regarding
"monospace, monospace;", this is required by firefox.

On Thu, Aug 27, 2020 at 1:06 PM Akshay Joshi 
wrote:

> Hi Aditya
>
> Can you please review the patch?
>
> On Thu, Aug 27, 2020 at 11:25 AM Pramod Ahire <
> pramod.ah...@enterprisedb.com> wrote:
>
>> Hi,
>>
>>
>>
>> Please find attached minor fixes for sonarqube, which includes changes as
>> below:
>>
>>
>>
>>- Removed duplicate CSS declaration
>>- Added proper font with font-family
>>
>>
>>
>> Please do let me know if any changes or missed.
>>
>>
>>
>> *Pramod Ahire*
>>
>> *Software Engineer*
>>
>>
>>
>> [image:
>> https://lh4.googleusercontent.com/U1erEuyI_d0xEUA0CrKjwx9aWQ52HNCxc38dMsLP-ZrLgfVNrhsrNobxlmeOdb1kMPtrrxcUwEHZgbGJC4R0qR4r1sBZa_z9R8ihFRaP2Hr_Wnhq6HcIQHe1ZoviDPwUkTdzNcg]
>>
>>
>>
>> C: +91-020-66449600/601
>>
>> D: +91-9028697679
>>
>> *edbpostgres.com *
>>
>>
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Sr. Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*

"Don't Complain about Heat, Plant a TREE"


pgAdmin 4 commit: Modified the 'Commit' and 'Rollback' query tool butto

2020-08-27 Thread Akshay Joshi
Modified the 'Commit' and 'Rollback' query tool button icons. Fixes #5662

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8222bf64200b7fe2ae02f0a97ed22b8414b71a23
Author: Chethana Kumar 

Modified Files
--
docs/en_US/release_notes_4_26.rst  |  1 +
web/pgadmin/tools/sqleditor/static/img/commit.svg  | 23 +-
.../tools/sqleditor/static/img/rollback.svg| 23 +-
3 files changed, 3 insertions(+), 44 deletions(-)



pgAdmin 4 commit: Fixed cognitive complexity issues and added some more

2020-08-27 Thread Akshay Joshi
Fixed cognitive complexity issues and added some more RESQL test cases for 
roles module.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=53a54103379840795fc03f5940cb53dd99ff0ee9
Author: Aditya Toshniwal 

Modified Files
--
.../server_groups/servers/roles/__init__.py| 609 +
.../templates/roles/sql/9.4_plus/properties.sql|   1 +
..._role_options.msql => alter_role_options1.msql} |   4 +-
.../roles/tests/9.4_plus/alter_role_options1.sql   |  20 +
.../roles/tests/9.4_plus/alter_role_options2.msql  |   2 +
.../roles/tests/9.4_plus/alter_role_options2.sql   |  20 +
.../roles/tests/9.4_plus/alter_role_options3.msql  |   1 +
...er_role_options.sql => alter_role_options3.sql} |   4 +-
.../roles/tests/9.4_plus/alter_role_options4.msql  |   1 +
.../roles/tests/9.4_plus/alter_role_options4.sql   |  19 +
.../servers/roles/tests/9.4_plus/test.json |  54 +-
11 files changed, 370 insertions(+), 365 deletions(-)



pgAdmin 4 commit: Ensure that schema names starting with 'pg' should be

2020-08-27 Thread Akshay Joshi
Ensure that schema names starting with 'pg' should be visible in browser tree 
when standard_conforming_strings is set to off. Fixes #4216

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=f3bde7b5f184f8a6a5861212991d15dfa9651265
Author: Yogesh Mahajan 

Modified Files
--
docs/en_US/release_notes_4_26.rst   | 1 +
.../databases/schemas/templates/schemas/pg/9.2_plus/sql/nodes.sql   | 2 +-
.../databases/schemas/templates/schemas/pg/default/sql/nodes.sql| 2 +-
.../databases/schemas/templates/schemas/ppas/9.1_plus/sql/nodes.sql | 2 +-
.../databases/schemas/templates/schemas/ppas/9.2_plus/sql/nodes.sql | 2 +-
5 files changed, 5 insertions(+), 4 deletions(-)



pgAdmin 4 commit: Fixed an issue where the application ignores the fixe

2020-08-27 Thread Akshay Joshi
Fixed an issue where the application ignores the fixed port configuration 
value. Fixes #5773

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0998d349cae23c48324d5b8b53f5ed609ba834a5
Author: Chris Mayo 

Modified Files
--
docs/en_US/release_notes_4_26.rst |  3 ++-
runtime/Runtime.cpp   | 24 +++-
runtime/Runtime.h |  3 +--
3 files changed, 18 insertions(+), 12 deletions(-)



Re: [pgAdmin][Patch] RM4216 - Schema list does not support standard_conforming_strings set to off

2020-08-27 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Aug 26, 2020 at 4:09 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hello,
>
> Please find a patch which enables pgAdmin4 to show schema names starting
> with 'pg' under schema node when 'standard_conforming_strings = off'.
> (Default is on) for database.
>
>
> Thanks,
> Yogesh Mahajan
> QA - Team
> EnterpriseDB Corporation
>
> Phone: +91-9741705709
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][SonarQube] Cognitive complexity roles + test cases

2020-08-27 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Aug 27, 2020 at 12:49 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the patch to reduce the cognitive complexity for
> validate_request function in roles module from 258 to 15. I've also added a
> few more test scenarios in the roles RE-SQL test cases to make sure the
> changes are tested.
>
> Please review.
>
> --
> Thanks,
> Aditya Toshniwal
> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
> 
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [PATCH] Fix pgAdmin4 v4.25 ignoring user configuration. Fixes #5773

2020-08-27 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Aug 26, 2020 at 11:13 PM Chris Mayo  wrote:

> ---
>  runtime/Runtime.cpp | 22 ++
>  runtime/Runtime.h   |  1 -
>  2 files changed, 14 insertions(+), 9 deletions(-)
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: pgAdmin 4 commit: Fixed cognitive complexity issues and added some more

2020-08-27 Thread Murtuza Zabuawala
Hi,

RE-SQL test for the role node is failing if the timezone of DB is different.

Traceback (most recent call last):
  File
"/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
line 500, in check_re_sql
self.assertEquals(sql, resp_sql)
  File "/usr/lib/python3.6/unittest/case.py", line 1321, in deprecated_func
return original_func(*args, **kwargs)
  File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.6/unittest/case.py", line 1203, in
assertMultiLineEqual
self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
raise self.failureException(msg)
AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
pg_si[300 chars]n\';' != '-- R[313 chars] \'2049-12-31
10:30:00-08\';\n\nGRANT pg_signa[297 chars]n\';'
  -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
  -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";

  CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
NOLOGIN
SUPERUSER
INHERIT
CREATEDB
NOCREATEROLE
NOREPLICATION
CONNECTION LIMIT 100
ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
-   VALID UNTIL '2050-01-01 00:00:00+05:30';
+   VALID UNTIL '2049-12-31 10:30:00-08';

  GRANT pg_signal_backend TO "Role2_$%{}[]()&*^!@""'`\/#";
  GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;

  ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
application_name TO 'pg4';

  COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
description';
Alter Role options 2  Expected SQL File:alter_role_options2.sql... FAIL
Alter Role options 3 (MSQL) ... ok
Traceback (most recent call last):
  File
"/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
line 500, in check_re_sql
self.assertEquals(sql, resp_sql)
  File "/usr/lib/python3.6/unittest/case.py", line 1321, in deprecated_func
return original_func(*args, **kwargs)
  File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.6/unittest/case.py", line 1203, in
assertMultiLineEqual
self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
raise self.failureException(msg)
AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
pg_mo[240 chars]n\';' != '-- R[313 chars] \'2049-12-31
10:30:00-08\';\n\nGRANT pg_monit[237 chars]n\';'
  -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
  -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";

  CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
NOLOGIN
SUPERUSER
INHERIT
CREATEDB
NOCREATEROLE
NOREPLICATION
CONNECTION LIMIT 100
ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
-   VALID UNTIL '2050-01-01 00:00:00+05:30';
+   VALID UNTIL '2049-12-31 10:30:00-08';

  GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;

  ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
application_name TO 'pg4';

  COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
description';
Alter Role options 3  Expected SQL File:alter_role_options3.sql... FAIL
Alter Role options 4 (MSQL) ... ok
Traceback (most recent call last):
  File
"/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
line 500, in check_re_sql
self.assertEquals(sql, resp_sql)
  File "/usr/lib/python3.6/unittest/case.py", line 1321, in deprecated_func
return original_func(*args, **kwargs)
  File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.6/unittest/case.py", line 1203, in
assertMultiLineEqual
self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
raise self.failureException(msg)
AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
pg_mo[259 chars]n\';' != '-- R[313 chars] \'2049-12-31
10:30:00-08\';\n\nGRANT pg_monit[256 chars]n\';'
  -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
  -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";

  CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
NOLOGIN
SUPERUSER
INHERIT
CREATEDB
NOCREATEROLE
NOREPLICATION
CONNECTION LIMIT 100
ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
-   VALID UNTIL '2050-01-01 00:00:00+05:30';
+   VALID UNTIL '2049-12-31 10:30:00-08';

  GRANT pg_monitor, pg_signal_backend TO "Role2_$%{}[]()&*^!@""'`\/#" WITH
ADMIN OPTION;

  ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
application_name TO 'pg4';

  COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
description';
Alter Role options 4  Expected SQL File:alter_role_options4.sql... FAIL


--
Regards,
Murtuza Zabuawala
*EDB*
*POWER TO POSTGRES*
https://www.edbpostgres.com


On Thu, Aug 27, 2020 at 1:10 PM Akshay Joshi 
wrote:

> Fixed cognitive com

Re: pgAdmin 4 commit: Fixed cognitive complexity issues and added some more

2020-08-27 Thread Aditya Toshniwal
Hi,

I'll look into it.

On Thu, Aug 27, 2020 at 2:41 PM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> RE-SQL test for the role node is failing if the timezone of DB is
> different.
>
> Traceback (most recent call last):
>   File
> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
> line 500, in check_re_sql
> self.assertEquals(sql, resp_sql)
>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in deprecated_func
> return original_func(*args, **kwargs)
>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
> assertion_func(first, second, msg=msg)
>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
> assertMultiLineEqual
> self.fail(self._formatMessage(msg, standardMsg))
>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
> raise self.failureException(msg)
> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
> pg_si[300 chars]n\';' != '-- R[313 chars] \'2049-12-31
> 10:30:00-08\';\n\nGRANT pg_signa[297 chars]n\';'
>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>
>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
> NOLOGIN
> SUPERUSER
> INHERIT
> CREATEDB
> NOCREATEROLE
> NOREPLICATION
> CONNECTION LIMIT 100
> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
> +   VALID UNTIL '2049-12-31 10:30:00-08';
>
>   GRANT pg_signal_backend TO "Role2_$%{}[]()&*^!@""'`\/#";
>   GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;
>
>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
> application_name TO 'pg4';
>
>   COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
> description';
> Alter Role options 2  Expected SQL File:alter_role_options2.sql... FAIL
> Alter Role options 3 (MSQL) ... ok
> Traceback (most recent call last):
>   File
> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
> line 500, in check_re_sql
> self.assertEquals(sql, resp_sql)
>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in deprecated_func
> return original_func(*args, **kwargs)
>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
> assertion_func(first, second, msg=msg)
>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
> assertMultiLineEqual
> self.fail(self._formatMessage(msg, standardMsg))
>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
> raise self.failureException(msg)
> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
> pg_mo[240 chars]n\';' != '-- R[313 chars] \'2049-12-31
> 10:30:00-08\';\n\nGRANT pg_monit[237 chars]n\';'
>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>
>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
> NOLOGIN
> SUPERUSER
> INHERIT
> CREATEDB
> NOCREATEROLE
> NOREPLICATION
> CONNECTION LIMIT 100
> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
> +   VALID UNTIL '2049-12-31 10:30:00-08';
>
>   GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;
>
>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
> application_name TO 'pg4';
>
>   COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
> description';
> Alter Role options 3  Expected SQL File:alter_role_options3.sql... FAIL
> Alter Role options 4 (MSQL) ... ok
> Traceback (most recent call last):
>   File
> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
> line 500, in check_re_sql
> self.assertEquals(sql, resp_sql)
>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in deprecated_func
> return original_func(*args, **kwargs)
>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
> assertion_func(first, second, msg=msg)
>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
> assertMultiLineEqual
> self.fail(self._formatMessage(msg, standardMsg))
>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
> raise self.failureException(msg)
> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
> pg_mo[259 chars]n\';' != '-- R[313 chars] \'2049-12-31
> 10:30:00-08\';\n\nGRANT pg_monit[256 chars]n\';'
>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>
>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
> NOLOGIN
> SUPERUSER
> INHERIT
> CREATEDB
> NOCREATEROLE
> NOREPLICATION
> CONNECTION LIMIT 100
> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
> +   VALID UNTIL '2049-12-31 10:30:00-08';
>
>   GRANT pg_monitor, pg_signal_backend TO "Role2_$%{}[]()&*^!@""'`\/#" WITH
> ADMIN OPTION;
>
>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE po

Re: #4059 Query tool new tab recurrence

2020-08-27 Thread Rahul Shirsat
*Removing DL not related PG directly.*

++pgadmin-hackers.

On Thu, Aug 27, 2020 at 1:48 PM Rahul Shirsat <
rahul.shir...@enterprisedb.com> wrote:

> Hi Dave,
>
> Working on one of the features #4059
> , assume that query tool is
> open in a new tab, and the main application window is closed, with the help
> of Nidhi, I was able to write a warning popup message as given below:
>
> [image: Screen Shot 2020-08-27 at 12.08.58 PM.png]
>
> Can we go ahead with this message or else could you please suggest if you
> have any?
>
> --
> *Rahul Shirsat*
> Software Engineer | EnterpriseDB Corporation.
>


-- 
*Rahul Shirsat*
Software Engineer | EnterpriseDB Corporation.


Re: pgAdmin 4 commit: Fixed cognitive complexity issues and added some more

2020-08-27 Thread Aditya Toshniwal
Hi Hackers,

Attached patch introduces a new key - replace_regex_pattern for RE-SQL test
cases. It will synchronize the expected SQL with the backend SQL based on
the regex string.
This will help fix the timezone mismatch issue occurring in RESQL test cases
for roles.
Please review.


On Thu, Aug 27, 2020 at 10:12 AM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi,
>
> I'll look into it.
>
> On Thu, Aug 27, 2020 at 2:41 PM Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> RE-SQL test for the role node is failing if the timezone of DB is
>> different.
>>
>> Traceback (most recent call last):
>>   File
>> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
>> line 500, in check_re_sql
>> self.assertEquals(sql, resp_sql)
>>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in
>> deprecated_func
>> return original_func(*args, **kwargs)
>>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
>> assertion_func(first, second, msg=msg)
>>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
>> assertMultiLineEqual
>> self.fail(self._formatMessage(msg, standardMsg))
>>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
>> raise self.failureException(msg)
>> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
>> pg_si[300 chars]n\';' != '-- R[313 chars] \'2049-12-31
>> 10:30:00-08\';\n\nGRANT pg_signa[297 chars]n\';'
>>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>>
>>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
>> NOLOGIN
>> SUPERUSER
>> INHERIT
>> CREATEDB
>> NOCREATEROLE
>> NOREPLICATION
>> CONNECTION LIMIT 100
>> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
>> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
>> +   VALID UNTIL '2049-12-31 10:30:00-08';
>>
>>   GRANT pg_signal_backend TO "Role2_$%{}[]()&*^!@""'`\/#";
>>   GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;
>>
>>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
>> application_name TO 'pg4';
>>
>>   COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
>> description';
>> Alter Role options 2  Expected SQL File:alter_role_options2.sql... FAIL
>> Alter Role options 3 (MSQL) ... ok
>> Traceback (most recent call last):
>>   File
>> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
>> line 500, in check_re_sql
>> self.assertEquals(sql, resp_sql)
>>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in
>> deprecated_func
>> return original_func(*args, **kwargs)
>>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
>> assertion_func(first, second, msg=msg)
>>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
>> assertMultiLineEqual
>> self.fail(self._formatMessage(msg, standardMsg))
>>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
>> raise self.failureException(msg)
>> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
>> pg_mo[240 chars]n\';' != '-- R[313 chars] \'2049-12-31
>> 10:30:00-08\';\n\nGRANT pg_monit[237 chars]n\';'
>>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>>
>>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
>> NOLOGIN
>> SUPERUSER
>> INHERIT
>> CREATEDB
>> NOCREATEROLE
>> NOREPLICATION
>> CONNECTION LIMIT 100
>> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
>> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
>> +   VALID UNTIL '2049-12-31 10:30:00-08';
>>
>>   GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;
>>
>>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
>> application_name TO 'pg4';
>>
>>   COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
>> description';
>> Alter Role options 3  Expected SQL File:alter_role_options3.sql... FAIL
>> Alter Role options 4 (MSQL) ... ok
>> Traceback (most recent call last):
>>   File
>> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
>> line 500, in check_re_sql
>> self.assertEquals(sql, resp_sql)
>>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in
>> deprecated_func
>> return original_func(*args, **kwargs)
>>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
>> assertion_func(first, second, msg=msg)
>>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
>> assertMultiLineEqual
>> self.fail(self._formatMessage(msg, standardMsg))
>>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
>> raise self.failureException(msg)
>> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
>> pg_mo[259 chars]n\';' != '-- R[313 chars] \'2049-12-31
>> 10:30:00-08\';\n\nGRANT pg_monit[256 chars]n\';'
>>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>>   -- DROP ROLE "Role2_$

Bug #5775: setup-web.sh don't works in debian 10?

2020-08-27 Thread Dave Page
Here's a patch for $SUBJECT. I've done some testing here, but please double
check it's correct before committing!

Thanks.

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

EDB: http://www.enterprisedb.com


RM_5775.diff
Description: Binary data


Re: #4059 Query tool new tab recurrence

2020-08-27 Thread Dave Page
On Thu, Aug 27, 2020 at 10:20 AM Rahul Shirsat <
rahul.shir...@enterprisedb.com> wrote:

> *Removing DL not related PG directly.*
>
> ++pgadmin-hackers.
>
> On Thu, Aug 27, 2020 at 1:48 PM Rahul Shirsat <
> rahul.shir...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Working on one of the features #4059
>> , assume that query tool is
>> open in a new tab, and the main application window is closed, with the help
>> of Nidhi, I was able to write a warning popup message as given below:
>>
>> [image: Screen Shot 2020-08-27 at 12.08.58 PM.png]
>>
>> Can we go ahead with this message or else could you please suggest if you
>> have any?
>>
>
"The pgAdmin browser window has been closed and the connection to the
server lost. Please close this window and open a new pgAdmin session."

-- 
Dave Page
VP & Chief Architect, Database Infrastructure
EDB: http://www.enterprisedb.com

Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake


pgAdmin 4 commit: Ensure that 'setup-web.sh' should work in Debian 10.

2020-08-27 Thread Akshay Joshi
Ensure that 'setup-web.sh' should work in Debian 10. Fixes #5775.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8368eed645ebd710d48124c322cfff1acc8e27c0
Author: Dave Page 

Modified Files
--
docs/en_US/release_notes_4_26.rst |  3 ++-
pkg/linux/setup-web.sh| 14 ++
2 files changed, 12 insertions(+), 5 deletions(-)



pgAdmin 4 commit: Fixed RE-SQL test cases failed due to the previous co

2020-08-27 Thread Akshay Joshi
Fixed RE-SQL test cases failed due to the previous commit.

Introduces a new key - replace_regex_pattern to synchronize the
expected SQL with the backend SQL based on the regex string

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=28b637c99c60d33f9b22704f6fff732ed7c4a348
Author: Aditya Toshniwal 

Modified Files
--
.../browser/server_groups/servers/roles/tests/9.4_plus/test.json | 9 ++---
web/pgadmin/static/scss/_alertify.overrides.scss | 2 +-
web/regression/re_sql/tests/test_resql.py| 6 ++
3 files changed, 13 insertions(+), 4 deletions(-)



Re: pgAdmin 4 commit: Fixed cognitive complexity issues and added some more

2020-08-27 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Aug 27, 2020 at 4:31 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached patch introduces a new key - replace_regex_pattern for RE-SQL
> test cases. It will synchronize the expected SQL with the backend SQL based
> on the regex string.
> This will help fix the timezone mismatch issue occurring in RESQL test
> cases for roles.
> Please review.
>
>
> On Thu, Aug 27, 2020 at 10:12 AM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> I'll look into it.
>>
>> On Thu, Aug 27, 2020 at 2:41 PM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> RE-SQL test for the role node is failing if the timezone of DB is
>>> different.
>>>
>>> Traceback (most recent call last):
>>>   File
>>> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
>>> line 500, in check_re_sql
>>> self.assertEquals(sql, resp_sql)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in
>>> deprecated_func
>>> return original_func(*args, **kwargs)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
>>> assertion_func(first, second, msg=msg)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
>>> assertMultiLineEqual
>>> self.fail(self._formatMessage(msg, standardMsg))
>>>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
>>> raise self.failureException(msg)
>>> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
>>> pg_si[300 chars]n\';' != '-- R[313 chars] \'2049-12-31
>>> 10:30:00-08\';\n\nGRANT pg_signa[297 chars]n\';'
>>>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>>>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>>>
>>>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
>>> NOLOGIN
>>> SUPERUSER
>>> INHERIT
>>> CREATEDB
>>> NOCREATEROLE
>>> NOREPLICATION
>>> CONNECTION LIMIT 100
>>> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
>>> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
>>> +   VALID UNTIL '2049-12-31 10:30:00-08';
>>>
>>>   GRANT pg_signal_backend TO "Role2_$%{}[]()&*^!@""'`\/#";
>>>   GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;
>>>
>>>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
>>> application_name TO 'pg4';
>>>
>>>   COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
>>> description';
>>> Alter Role options 2  Expected SQL File:alter_role_options2.sql... FAIL
>>> Alter Role options 3 (MSQL) ... ok
>>> Traceback (most recent call last):
>>>   File
>>> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
>>> line 500, in check_re_sql
>>> self.assertEquals(sql, resp_sql)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in
>>> deprecated_func
>>> return original_func(*args, **kwargs)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
>>> assertion_func(first, second, msg=msg)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
>>> assertMultiLineEqual
>>> self.fail(self._formatMessage(msg, standardMsg))
>>>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
>>> raise self.failureException(msg)
>>> AssertionError: '-- R[313 chars] \'2050-01-01 00:00:00+05:30\';\n\nGRANT
>>> pg_mo[240 chars]n\';' != '-- R[313 chars] \'2049-12-31
>>> 10:30:00-08\';\n\nGRANT pg_monit[237 chars]n\';'
>>>   -- Role: "Role2_$%{}[]()&*^!@""'`\/#"
>>>   -- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#";
>>>
>>>   CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH
>>> NOLOGIN
>>> SUPERUSER
>>> INHERIT
>>> CREATEDB
>>> NOCREATEROLE
>>> NOREPLICATION
>>> CONNECTION LIMIT 100
>>> ENCRYPTED PASSWORD 'md5cc9a2576a43b841dcacea0f65d961e41'
>>> -   VALID UNTIL '2050-01-01 00:00:00+05:30';
>>> +   VALID UNTIL '2049-12-31 10:30:00-08';
>>>
>>>   GRANT pg_monitor TO "Role2_$%{}[]()&*^!@""'`\/#" WITH ADMIN OPTION;
>>>
>>>   ALTER ROLE "Role2_$%{}[]()&*^!@""'`\/#" IN DATABASE postgres SET
>>> application_name TO 'pg4';
>>>
>>>   COMMENT ON ROLE "Role2_$%{}[]()&*^!@""'`\/#" IS 'This is detailed
>>> description';
>>> Alter Role options 3  Expected SQL File:alter_role_options3.sql... FAIL
>>> Alter Role options 4 (MSQL) ... ok
>>> Traceback (most recent call last):
>>>   File
>>> "/home/murtuza/projects/PEM/web/regression/re_sql/tests/test_resql.py",
>>> line 500, in check_re_sql
>>> self.assertEquals(sql, resp_sql)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 1321, in
>>> deprecated_func
>>> return original_func(*args, **kwargs)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual
>>> assertion_func(first, second, msg=msg)
>>>   File "/usr/lib/python3.6/unittest/case.py", line 1203, in
>>> assertMultiLineEqual
>>> self.fail(self._formatMessage(msg, standardMsg))
>>>   File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
>>> raise self.failureException(msg)
>>>

Re: Bug #5775: setup-web.sh don't works in debian 10?

2020-08-27 Thread Akshay Joshi
Thanks, patch applied. I don't have Debian 10 machine but on eyeball,
review code looks good to me.

On Thu, Aug 27, 2020 at 6:14 PM Dave Page  wrote:

> Here's a patch for $SUBJECT. I've done some testing here, but please
> double check it's correct before committing!
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EDB: http://www.enterprisedb.com
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


[pgAdmin][Patch] RM5426 - [pgagent]: Codemirror control height should use maximum space while creating jobstep

2020-08-27 Thread Yogesh Mahajan
Hello,

Attached patch shows maximum available space in code tab in job-step
creation while creating a job.

Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


RM5426_v1.patch
Description: Binary data