pgAdmin 4 commit: Fixed code smell 'String literals should not be dupli

2020-08-06 Thread Akshay Joshi
Fixed code smell 'String literals should not be duplicated' reported by 
SonarQube.

Branch
--
master

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

Modified Files
--
.../feature_tests/pg_datatype_validation_test.py   |  7 +--
.../pg_utilities_backup_restore_test.py|  9 ++--
.../query_tool_auto_complete_tests.py  | 19 
.../feature_tests/query_tool_journey_test.py   | 50 --
web/pgadmin/feature_tests/query_tool_tests.py  | 27 ++--
web/pgadmin/feature_tests/view_data_dml_queries.py |  5 ++-
.../xss_checks_panels_and_query_tool_test.py   | 16 ---
7 files changed, 73 insertions(+), 60 deletions(-)



pgAdmin 4 commit: Fixed an issue where the user is not able to insert t

2020-08-06 Thread Akshay Joshi
Fixed an issue where the user is not able to insert the data if the table and 
columns name contains special characters. Fixes #4387

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_4_25.rst  | 1 +
web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 2 +-
.../tools/sqleditor/templates/sqleditor/sql/default/select.sql | 2 +-
web/pgadmin/tools/sqleditor/tests/test_view_data_templates.py  | 2 ++
web/pgadmin/tools/sqleditor/utils/save_changed_data.py | 7 ++-
5 files changed, 11 insertions(+), 3 deletions(-)



pgAdmin 4 commit: Fixed cognitive complexity issues reported by SonarQu

2020-08-06 Thread Akshay Joshi
Fixed cognitive complexity issues reported by SonarQube.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=1122e06f48ad2740868a92bbcbd6c0a290909c04
Author: Nikhil Mohite  

Modified Files
--
.../databases/foreign_data_wrappers/__init__.py| 123 --
.../databases/schemas/foreign_tables/__init__.py   | 158 --
.../tables/constraints/index_constraint/utils.py   | 180 ++---
3 files changed, 306 insertions(+), 155 deletions(-)



Re: [pgAdmin4][Patch] - SonarQube Issues - 13 (String literals should not be duplicated)

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

On Wed, Aug 5, 2020 at 7:47 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hi,
>
> Please find patch which fixes 15 issues related to rule from feature test
> modules -
> 1.String literals should not be duplicated
>
> 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: Patch for SonarQube code scan fixes.

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

On Wed, Aug 5, 2020 at 6:03 PM Nikhil Mohite 
wrote:

> Hi Team,
>
> I have fixed some code smell issues in the SonarQube scan, PFA patch.
> Details as follows:
> 1. Index Constraint:
>
>- Refactor this function to reduce its Cognitive Complexity from 31 to
>the 15 allowed.
>- Refactor this function to reduce its Cognitive Complexity from 41 to
>the 15 allowed.
>
> 2. Foreign Tables:
>
>- Refactor this function to reduce its Cognitive Complexity from 45 to
>the 15 allowed.
>- Refactor this function to reduce its Cognitive Complexity from 17 to
>the 15 allowed.
>- Refactor this function to reduce its Cognitive Complexity from 32 to
>the 15 allowed.
>
> 3. Foreign Data Wrappers:
>
>1. Refactor this function to reduce its Cognitive Complexity from 47
>to the 15 allowed.
>
>
> Regards,
> Nikhil Mohite.
>


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

*Mobile: +91 976-788-8246*


Re: Bug #4387 - User can not insert any value on view data if table and column name contains *SELECT '<alert("XSS ");//<';*

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

On Wed, Aug 5, 2020 at 1:39 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hello,
>
> Please find patch which fixes 2 issues reported in Bug #4387
> 
>   1.Incorrect Column name when column name is like *'SELECT
> '   2.Unable to enter data when the above column is primary key.
>
> 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*


[pgAdmin][RM5716] AJAX to generate the charts continues to fire after we disconnect the server

2020-08-06 Thread Aditya Toshniwal
Hi Hackers,

Attached is the patch to fix the issue mentioned in the subject.
Regarding hiding the color legend when the server is disconnected, I feel
it's good to have the legend visible as it says it's a graph. Otherwise, a
box with error is ambiguous. Plus, it's not going to change anyway even if
graph data is available or not.

Please review.

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

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


RM5716.patch
Description: Binary data


pgAdmin debugger failure when search_path set

2020-08-06 Thread Aditya Toshniwal
Hi Dave/Team,

I've been working on an issue to make debugger work no matter what the
search patch is set. I've managed to call the appropriate functions from
pgAdmin using a schema qualified name with no issues. However, the internal
calls in the function don't look schema qualified.
For instance,
I have two schemas "public" where the debugger is installed and "other"
where my user defined function is. I set the search_path to "other" on the
database. Calling plpgsql_oid_debug directly fails because of the search
path set, but I can call the debugger functions with
public.plpgsql_oid_debug, but it fails with:
ERROR: function pldbg_oid_debug(oid) does not exist LINE 1: SELECT
pldbg_oid_debug($1) ^ HINT: No function matches the given name and argument
types. You might need to add explicit type casts. QUERY: SELECT
pldbg_oid_debug($1) CONTEXT: SQL function "plpgsql_oid_debug" during
inlining

How to approach this ? It is inconvenient for users to remove their
search_path to make debugger work.

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

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


pgAdmin 4 commit: Fixed an issue where ajax call continues to fire even

2020-08-06 Thread Akshay Joshi
Fixed an issue where ajax call continues to fire even after disconnect the 
database server. Fixes #5716

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_4_25.rst | 3 ++-
web/pgadmin/dashboard/static/js/ChartsDOM.jsx | 8 
web/pgadmin/dashboard/static/js/dashboard.js  | 3 +--
web/pgadmin/dashboard/static/scss/_dashboard.scss | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)



Re: [pgAdmin][RM5716] AJAX to generate the charts continues to fire after we disconnect the server

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

On Thu, Aug 6, 2020 at 2:32 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the patch to fix the issue mentioned in the subject.
> Regarding hiding the color legend when the server is disconnected, I feel
> it's good to have the legend visible as it says it's a graph. Otherwise, a
> box with error is ambiguous. Plus, it's not going to change anyway even if
> graph data is available or not.
>
> 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*


pgAdmin 4 commit: Fixed ssh tunnel hang issue when the user tries to di

2020-08-06 Thread Akshay Joshi
Fixed ssh tunnel hang issue when the user tries to disconnect the server. Fixes 
#4361

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_4_25.rst   | 1 +
web/pgadmin/utils/driver/psycopg2/server_manager.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)



pgAdmin 4 commit: Update the sshtunnel version to v0.1.5.

2020-08-06 Thread Akshay Joshi
Update the sshtunnel version to v0.1.5.

refs #4361

Branch
--
master

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

Modified Files
--
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin][SonarQube] Replace the generic exception class with a more specific one

2020-08-06 Thread Aditya Toshniwal
Hi Hackers,

Attached is the followup patch to fix all the remaining issues (around 30)
related to replacing the generic exception class with more specific ones.
Please review.

On Wed, Aug 5, 2020 at 12:42 PM Akshay Joshi 
wrote:

> Thanks, patch applied.
>
> On Wed, Aug 5, 2020 at 11:09 AM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Attached is the patch to replace the generic exception class with a newly
>> added ExecuteError class for all the places where error occurs when a SQL
>> is executed.
>> This fixes around 34 issues.
>>
>> 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*
>


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

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


sonarqube.exception.patch
Description: Binary data