Re: [pgAdmin4][Patch] - RM 5457 - Kerberos Authentication - Phase 1

2021-01-18 Thread Dave Page
Hi

On Mon, Jan 18, 2021 at 7:30 AM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached updated patch with the below changes:
>
> - Dependencies are added into Linux packages in the RPM/DEBs.
> - Dev packages are added in the setup scripts for Linux.
> - The required packages are added in the Dockerfile.
> - Conditional gssapi 1.6.2 dependency is added for Python 3.5 in
> requirements.txt.
>

1.6.9 is the last release that supports Python 3.4+. We should use that
rather than older versions.


> - krb5 libs are not bundled with the Desktop packages, so added the gssapi
> dependency into the try/catch block.
> - .dockerignore is introduced to ignore unwanted files/folders like
> node_modules etc., which will make the docker build fast. (By Ashesh Vashi)
>

Aside from that one comment above, eyeball review of the build changes
looks good.



>
> Thanks,
> Khushboo
>
> On Fri, Jan 15, 2021 at 3:48 PM Dave Page  wrote:
>
>> And another thought...
>>
>> Some of the Jenkins QA jobs setup the virtual environment for running
>> tests themselves. I believe these might actually be the cause of some of
>> the failures we saw initially with the commit - I'll review those, and
>> ensure they won't try to build the gssapi module from source on Windows.
>>
>> On Thu, Jan 14, 2021 at 4:34 PM Dave Page  wrote:
>>
>>> FYI, I did a quick test (and browse of PyPI):
>>>
>>> - On Windows, it seems there is a binary wheel available:
>>>
>>> (gssapi) C:\Users\dpage>pip install gssapi
>>> Collecting gssapi
>>>   Downloading gssapi-1.6.12-cp39-cp39-win_amd64.whl (670 kB)
>>>  || 670 kB 3.3 MB/s
>>> Collecting decorator
>>>   Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
>>> Installing collected packages: decorator, gssapi
>>> Successfully installed decorator-4.4.2 gssapi-1.6.12
>>>
>>> - On macOS, the wheel is built by pip, but it doesn't seem to have any
>>> additional binary dependencies.
>>>
>>> This should simplify things a lot - we just need to ensure the build
>>> scripts use the binary package on Windows, and install the build deps on
>>> the Linux/Docker environments (and update the package builds with the
>>> additional dependencies of course).
>>>
>>>
>>> On Thu, Jan 14, 2021 at 4:04 PM Dave Page  wrote:
>>>
 Hi Khushboo,

 As you know, this has been rolled back as the buildfarm blew up. I
 think there are a number of TODOs that need to be addressed, given that the
 gssapi Python module is dependent on MIT Kerberos:

 In the patch:

 - Linux packages will need the additional dependencies to be declared
 in the RPM/DEBs.
 - The setup scripts for Linux will need to have the -dev packages added
 as appropriate.
 - The various READMEs that describe how to build packages will need to
 be updated.
 - The Dockerfile will need to be modified to add the required packages.
 - The Windows build will need to be updated so the installer ships
 additional required DLLs.
 - Are there any additional macOS dependencies? If so, they need to be
 handled.

 In the buildfarm:

 - All Linux build VMs need to be updated with the additional
 dependencies.
 - On Windows, we need to figure out how to build/ship KfW. It's a pain
 to build, which we would typically do ourselves to ensure we're
 consistently using the same buildchain. If we do build it ourselves:
   - Will the Python package find it during it's build?
   - We'll need to create a Jenkins job to perform the build.
 - Is any work required on macOS, or does it ship with everything that's
 needed? If not, we'll need to build it, and create the Jenkins job.

 One final thought: on Windows/macOS, can we force a binary installation
 from PIP (pip install --only-binary=gssapi gssapi)? If so, will that
 include the required libraries, as psycopg2-binary does?


 On Thu, Jan 14, 2021 at 8:18 AM Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Thanks, patch applied.
>
> On Thu, Jan 14, 2021 at 1:42 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please ignore my previous patch, attached the updated one.
>>
>> Thanks,
>> Khushboo
>>
>> On Thu, Jan 14, 2021 at 12:17 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached updated patch.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Thu, Jan 14, 2021 at 12:00 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Khushboo

 Seems you have attached the wrong patch. Please send the updated
 patch.

 On Wed, Jan 13, 2021 at 2:35 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached updated

Re: [pgAdmin][RM1802] ERD Tool (Beta)

2021-01-18 Thread Aditya Toshniwal
Hi,

The jasmine test cases are working fine on my local machine. The test cases
are successful on jenkins other than on linux, not sure why.
I have made some fixes by looking at the log. Please review and try.

On Mon, Jan 18, 2021 at 1:10 PM Akshay Joshi 
wrote:

> Thanks, patch applied.
>
> On Mon, Jan 18, 2021 at 10:34 AM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> I forgot to remove few of the dependencies which are not required as of
>> now (may be in future). Attached patch removes those dependencies from
>> package.json.
>>
>> On Sat, Jan 16, 2021 at 5:08 PM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Thanks, patch applied.
>>>
>>> On Fri, Jan 15, 2021 at 7:01 PM Aditya Toshniwal <
>>> aditya.toshni...@enterprisedb.com> wrote:
>>>
 Hi,

 I've fixed the issues. You can find the comments inline.
 I've also added PropTypes for the components for increased validation.

 On Tue, Jan 12, 2021 at 12:18 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi Aditya,
>
> The functionalities and the code looks good to me, however some of the 
> comments as below:
>
>
>- Correct the comments at some places (3 occurrences found  in 
> /erd/__init__.py)  which mention Schema diff instead of ERD.
>
> Some comments in the JS/JSX file regarding components/functions (For 
> example, IconButton (forwardRef), Bodywidget etc.) would
>
> be great help as we all are new to React.
>
> Done. Added comments to the components.

>
>- Remove the unused imports (for ex bad_request) in /erd/__init__.py
>
> Removed.

>
>- Remove commented code
>
> # req_args = request.args
> # if ('recreate' in req_args and
> # req_args['recreate'] == '1'):
> # connect = False
>
> Removed.

>
>- TableNode.jsx, below two lines can be combined.
>
> import { PortModelAlignment, DefaultNodeModel } from
> '@projectstorm/react-diagrams';
> import { PortWidget } from '@projectstorm/react-diagrams';
>
> Done.

>
>- onImageClick function in BodyWidget.jsx is no use I think, so it 
> should be removed.
>
> I wanted to keep the code as it will be used in future. Anyway, I've
 removed the code.

>
>- I got some console errors while adding/editing tables. Refer to the 
> attached screenshot.
>
> I tried but I didn't get any. Looking at the screenshot, the error is
 from the underlying library. Can't do much in this.

>
>- In the column Edit Mode, while deleting the primary key, it gives 
> the error, which does not go away with any further modifications.
>
> Fixed.

>
>- While generating the SQL, if the server is disconnected, a proper 
> error message should be thrown, right now some server side error is 
> coming.
>
> It will show connection lost error now. Fixed.

>
>- Please remove ... from the menu title (New ERD Project(Beta)...) as 
> it is not opening a dialog.
>
> Done.

>
>- For large data sets, generate ERD hangs.
>
> It shows the spinner and waits for the response to come from the back
 end. I've used the existing table fetching code which is used at other
 places. I'll create an RM to improve the back end code for fetching the
 tables data which will help the schema diff tool as well.

>
>- Opening the ERD panel in a new window is not working, it opens in 
> the same tab even if you have set the Preference "Open in new browser 
> tab" to True.
>
> Fixed. Added the setting in "Tab settings".

>
>- No shortcut is provided to open the ERD Tool.
>
> A shortcut is helpful if we are using it frequently. ERD tool won't be
 used that frequently. We already have a limited number of keys
 available for shortcuts. I think we should roll out without shortcut for
 now. If there is a user demand for it then we can think of adding it.

>
>- SonarQube fixes required.
>
> Fixed.

>
>-
>
> *Suggestion:*
>
> While removal of the FK link, If any of the table is selected, it is 
> being deleted with FK link.
> Either we should warn the user OR make 2 different buttons for FK removal 
> and table removal as the user may be confused if the selected table is 
> also removed with the FK.
>
> I've added a confirmation dialog which will show the number of tables
 and links selected. This way user will know what he has selected before
 deleting.

> *Observations:*
>
> Lodash has been used in this module in place of Underscore, though the
> dependency is already introduced by another module,
> but we have mentioned it in the package.js

Re: [pgAdmin4][Patch] - RM 5457 - Kerberos Authentication - Phase 1

2021-01-18 Thread Khushboo Vashi
On Mon, Jan 18, 2021 at 2:45 PM Dave Page  wrote:

> Hi
>
> On Mon, Jan 18, 2021 at 7:30 AM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached updated patch with the below changes:
>>
>> - Dependencies are added into Linux packages in the RPM/DEBs.
>> - Dev packages are added in the setup scripts for Linux.
>> - The required packages are added in the Dockerfile.
>> - Conditional gssapi 1.6.2 dependency is added for Python 3.5 in
>> requirements.txt.
>>
>
> 1.6.9 is the last release that supports Python 3.4+. We should use that
> rather than older versions.
>
As per the https://pypi.org/project/gssapi/*1.6.9*/, it says Requires: Python
>=3.6.*


>
>
>> - krb5 libs are not bundled with the Desktop packages, so added the
>> gssapi dependency into the try/catch block.
>> - .dockerignore is introduced to ignore unwanted files/folders like
>> node_modules etc., which will make the docker build fast. (By Ashesh Vashi)
>>
>
> Aside from that one comment above, eyeball review of the build changes
> looks good.
>
>
>
>>
>> Thanks,
>> Khushboo
>>
>> On Fri, Jan 15, 2021 at 3:48 PM Dave Page  wrote:
>>
>>> And another thought...
>>>
>>> Some of the Jenkins QA jobs setup the virtual environment for running
>>> tests themselves. I believe these might actually be the cause of some of
>>> the failures we saw initially with the commit - I'll review those, and
>>> ensure they won't try to build the gssapi module from source on Windows.
>>>
>>> On Thu, Jan 14, 2021 at 4:34 PM Dave Page  wrote:
>>>
 FYI, I did a quick test (and browse of PyPI):

 - On Windows, it seems there is a binary wheel available:

 (gssapi) C:\Users\dpage>pip install gssapi
 Collecting gssapi
   Downloading gssapi-1.6.12-cp39-cp39-win_amd64.whl (670 kB)
  || 670 kB 3.3 MB/s
 Collecting decorator
   Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
 Installing collected packages: decorator, gssapi
 Successfully installed decorator-4.4.2 gssapi-1.6.12

 - On macOS, the wheel is built by pip, but it doesn't seem to have any
 additional binary dependencies.

 This should simplify things a lot - we just need to ensure the build
 scripts use the binary package on Windows, and install the build deps on
 the Linux/Docker environments (and update the package builds with the
 additional dependencies of course).


 On Thu, Jan 14, 2021 at 4:04 PM Dave Page  wrote:

> Hi Khushboo,
>
> As you know, this has been rolled back as the buildfarm blew up. I
> think there are a number of TODOs that need to be addressed, given that 
> the
> gssapi Python module is dependent on MIT Kerberos:
>
> In the patch:
>
> - Linux packages will need the additional dependencies to be declared
> in the RPM/DEBs.
> - The setup scripts for Linux will need to have the -dev packages
> added as appropriate.
> - The various READMEs that describe how to build packages will need to
> be updated.
> - The Dockerfile will need to be modified to add the required packages.
> - The Windows build will need to be updated so the installer ships
> additional required DLLs.
> - Are there any additional macOS dependencies? If so, they need to be
> handled.
>
> In the buildfarm:
>
> - All Linux build VMs need to be updated with the additional
> dependencies.
> - On Windows, we need to figure out how to build/ship KfW. It's a pain
> to build, which we would typically do ourselves to ensure we're
> consistently using the same buildchain. If we do build it ourselves:
>   - Will the Python package find it during it's build?
>   - We'll need to create a Jenkins job to perform the build.
> - Is any work required on macOS, or does it ship with everything
> that's needed? If not, we'll need to build it, and create the Jenkins job.
>
> One final thought: on Windows/macOS, can we force a binary
> installation from PIP (pip install --only-binary=gssapi gssapi)? If so,
> will that include the required libraries, as psycopg2-binary does?
>
>
> On Thu, Jan 14, 2021 at 8:18 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, patch applied.
>>
>> On Thu, Jan 14, 2021 at 1:42 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please ignore my previous patch, attached the updated one.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Thu, Jan 14, 2021 at 12:17 PM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find the attached updated patch.

 Thanks,
 Khushboo

 On Thu, Jan 14, 2021 at 12:00 PM Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Hi Khushboo

Re: [pgAdmin4][Patch] - RM 5457 - Kerberos Authentication - Phase 1

2021-01-18 Thread Dave Page
On Mon, Jan 18, 2021 at 9:37 AM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

>
>
> On Mon, Jan 18, 2021 at 2:45 PM Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Jan 18, 2021 at 7:30 AM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached updated patch with the below changes:
>>>
>>> - Dependencies are added into Linux packages in the RPM/DEBs.
>>> - Dev packages are added in the setup scripts for Linux.
>>> - The required packages are added in the Dockerfile.
>>> - Conditional gssapi 1.6.2 dependency is added for Python 3.5 in
>>> requirements.txt.
>>>
>>
>> 1.6.9 is the last release that supports Python 3.4+. We should use that
>> rather than older versions.
>>
> As per the https://pypi.org/project/gssapi/*1.6.9*/, it says Requires: Python
> >=3.6.*
>

I think that's the metadata for the latest package version on the left. If
you read the main text, it says:
Requirements
Basic

   - A working implementation of GSSAPI (such as from MIT Kerberos) which
   includes header files
   - a C compiler (such as GCC)
   - either the enum34 Python package or Python 3.4+
   - the six and decorator python package


For 1.6.10, that changed to:
Requirements
Basic

   - A working implementation of GSSAPI (such as from MIT Kerberos) which
   supports delegation and includes header files
   - a C compiler (such as GCC)
   - Python 3.6+ (older releases support older versions, but are
   unsupported)
   - the decorator python package



>
>>
>>
>>> - krb5 libs are not bundled with the Desktop packages, so added the
>>> gssapi dependency into the try/catch block.
>>> - .dockerignore is introduced to ignore unwanted files/folders like
>>> node_modules etc., which will make the docker build fast. (By Ashesh Vashi)
>>>
>>
>> Aside from that one comment above, eyeball review of the build changes
>> looks good.
>>
>>
>>
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Fri, Jan 15, 2021 at 3:48 PM Dave Page  wrote:
>>>
 And another thought...

 Some of the Jenkins QA jobs setup the virtual environment for running
 tests themselves. I believe these might actually be the cause of some of
 the failures we saw initially with the commit - I'll review those, and
 ensure they won't try to build the gssapi module from source on Windows.

 On Thu, Jan 14, 2021 at 4:34 PM Dave Page  wrote:

> FYI, I did a quick test (and browse of PyPI):
>
> - On Windows, it seems there is a binary wheel available:
>
> (gssapi) C:\Users\dpage>pip install gssapi
> Collecting gssapi
>   Downloading gssapi-1.6.12-cp39-cp39-win_amd64.whl (670 kB)
>  || 670 kB 3.3 MB/s
> Collecting decorator
>   Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
> Installing collected packages: decorator, gssapi
> Successfully installed decorator-4.4.2 gssapi-1.6.12
>
> - On macOS, the wheel is built by pip, but it doesn't seem to have any
> additional binary dependencies.
>
> This should simplify things a lot - we just need to ensure the build
> scripts use the binary package on Windows, and install the build deps on
> the Linux/Docker environments (and update the package builds with the
> additional dependencies of course).
>
>
> On Thu, Jan 14, 2021 at 4:04 PM Dave Page  wrote:
>
>> Hi Khushboo,
>>
>> As you know, this has been rolled back as the buildfarm blew up. I
>> think there are a number of TODOs that need to be addressed, given that 
>> the
>> gssapi Python module is dependent on MIT Kerberos:
>>
>> In the patch:
>>
>> - Linux packages will need the additional dependencies to be declared
>> in the RPM/DEBs.
>> - The setup scripts for Linux will need to have the -dev packages
>> added as appropriate.
>> - The various READMEs that describe how to build packages will need
>> to be updated.
>> - The Dockerfile will need to be modified to add the required
>> packages.
>> - The Windows build will need to be updated so the installer ships
>> additional required DLLs.
>> - Are there any additional macOS dependencies? If so, they need to be
>> handled.
>>
>> In the buildfarm:
>>
>> - All Linux build VMs need to be updated with the additional
>> dependencies.
>> - On Windows, we need to figure out how to build/ship KfW. It's a
>> pain to build, which we would typically do ourselves to ensure we're
>> consistently using the same buildchain. If we do build it ourselves:
>>   - Will the Python package find it during it's build?
>>   - We'll need to create a Jenkins job to perform the build.
>> - Is any work required on macOS, or does it ship with everything
>> that's needed? If not, we'll need to build it, and create the Jenkins 
>> job.
>>
>> One final thought: on Windows/macOS, can we force a binary
>> installation

pgAdmin 4 commit: Fixed an issue while checking the major version of se

2021-01-18 Thread Akshay Joshi
Fixed an issue while checking the major version of servers in schema diff.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=a60cfd3cc33a9ba0486ae4fb517ea8187ebf8fda
Author: Huang Jun 

Modified Files
--
web/pgadmin/tools/schema_diff/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Fixed jasmine test cases of ERD Tool.

2021-01-18 Thread Akshay Joshi
Fixed jasmine test cases of ERD Tool.

Branch
--
master

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

Modified Files
--
web/regression/javascript/erd/onetomany_port_spec.js | 2 +-
web/regression/javascript/erd/table_node_spec.js | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)



pgAdmin 4 commit: 1) Added support for Kerberos authentication, using S

2021-01-18 Thread Akshay Joshi
1) Added support for Kerberos authentication, using SPNEGO to forward the 
Kerberos tickets through a browser. Fixes #5457
2) Fixed incorrect log information for AUTHENTICATION_SOURCES. Fixes #5829

Branch
--
master

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

Modified Files
--
.dockerignore  |   6 +
Dockerfile |   4 +
docs/en_US/release_notes_4_30.rst  |   2 +
pkg/debian/build.sh|   2 +-
pkg/debian/setup.sh|   2 +-
pkg/redhat/build.sh|   4 +-
pkg/redhat/setup.sh|   4 +-
requirements.txt   |   2 +
web/config.py  |  22 ++-
web/pgAdmin4.py|   8 +-
web/pgadmin/__init__.py|  10 ++
web/pgadmin/authenticate/__init__.py   |  82 ++-
web/pgadmin/authenticate/internal.py   |  10 +-
web/pgadmin/authenticate/kerberos.py   | 152 +
web/pgadmin/authenticate/ldap.py   |   6 +-
web/pgadmin/browser/__init__.py|  23 +++-
.../browser/server_groups/servers/__init__.py  |  13 +-
.../servers/templates/servers/password.html|   2 +-
.../servers/templates/servers/tunnel_password.html |   4 +-
.../browser/templates/browser/kerberos_login.html  |  16 +++
.../browser/templates/browser/kerberos_logout.html |  16 +++
.../browser/tests/test_kerberos_with_mocking.py| 104 ++
web/pgadmin/tools/datagrid/__init__.py |   5 +-
web/pgadmin/tools/user_management/__init__.py  |  25 ++--
web/pgadmin/utils/constants.py |   9 ++
web/pgadmin/utils/master_password.py   |   8 +-
.../python_test_utils/csrf_test_client.py  |   6 +-
web/regression/runtests.py |   1 -
28 files changed, 502 insertions(+), 46 deletions(-)



Re: [pgAdmin][RM1802] ERD Tool (Beta)

2021-01-18 Thread Akshay Joshi
Thanks, patch applied.

On Mon, Jan 18, 2021 at 2:58 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi,
>
> The jasmine test cases are working fine on my local machine. The test
> cases are successful on jenkins other than on linux, not sure why.
> I have made some fixes by looking at the log. Please review and try.
>
> On Mon, Jan 18, 2021 at 1:10 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, patch applied.
>>
>> On Mon, Jan 18, 2021 at 10:34 AM Aditya Toshniwal <
>> aditya.toshni...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> I forgot to remove few of the dependencies which are not required as of
>>> now (may be in future). Attached patch removes those dependencies from
>>> package.json.
>>>
>>> On Sat, Jan 16, 2021 at 5:08 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Thanks, patch applied.

 On Fri, Jan 15, 2021 at 7:01 PM Aditya Toshniwal <
 aditya.toshni...@enterprisedb.com> wrote:

> Hi,
>
> I've fixed the issues. You can find the comments inline.
> I've also added PropTypes for the components for increased validation.
>
> On Tue, Jan 12, 2021 at 12:18 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi Aditya,
>>
>> The functionalities and the code looks good to me, however some of the 
>> comments as below:
>>
>>
>>- Correct the comments at some places (3 occurrences found  in 
>> /erd/__init__.py)  which mention Schema diff instead of ERD.
>>
>> Some comments in the JS/JSX file regarding components/functions (For 
>> example, IconButton (forwardRef), Bodywidget etc.) would
>>
>> be great help as we all are new to React.
>>
>> Done. Added comments to the components.
>
>>
>>- Remove the unused imports (for ex bad_request) in /erd/__init__.py
>>
>> Removed.
>
>>
>>- Remove commented code
>>
>> # req_args = request.args
>> # if ('recreate' in req_args and
>> # req_args['recreate'] == '1'):
>> # connect = False
>>
>> Removed.
>
>>
>>- TableNode.jsx, below two lines can be combined.
>>
>> import { PortModelAlignment, DefaultNodeModel } from
>> '@projectstorm/react-diagrams';
>> import { PortWidget } from '@projectstorm/react-diagrams';
>>
>> Done.
>
>>
>>- onImageClick function in BodyWidget.jsx is no use I think, so it 
>> should be removed.
>>
>> I wanted to keep the code as it will be used in future. Anyway, I've
> removed the code.
>
>>
>>- I got some console errors while adding/editing tables. Refer to the 
>> attached screenshot.
>>
>> I tried but I didn't get any. Looking at the screenshot, the error is
> from the underlying library. Can't do much in this.
>
>>
>>- In the column Edit Mode, while deleting the primary key, it gives 
>> the error, which does not go away with any further modifications.
>>
>> Fixed.
>
>>
>>- While generating the SQL, if the server is disconnected, a proper 
>> error message should be thrown, right now some server side error is 
>> coming.
>>
>> It will show connection lost error now. Fixed.
>
>>
>>- Please remove ... from the menu title (New ERD Project(Beta)...) as 
>> it is not opening a dialog.
>>
>> Done.
>
>>
>>- For large data sets, generate ERD hangs.
>>
>> It shows the spinner and waits for the response to come from the back
> end. I've used the existing table fetching code which is used at other
> places. I'll create an RM to improve the back end code for fetching the
> tables data which will help the schema diff tool as well.
>
>>
>>- Opening the ERD panel in a new window is not working, it opens in 
>> the same tab even if you have set the Preference "Open in new browser 
>> tab" to True.
>>
>> Fixed. Added the setting in "Tab settings".
>
>>
>>- No shortcut is provided to open the ERD Tool.
>>
>> A shortcut is helpful if we are using it frequently. ERD tool won't
> be used that frequently. We already have a limited number of keys
> available for shortcuts. I think we should roll out without shortcut for
> now. If there is a user demand for it then we can think of adding it.
>
>>
>>- SonarQube fixes required.
>>
>> Fixed.
>
>>
>>-
>>
>> *Suggestion:*
>>
>> While removal of the FK link, If any of the table is selected, it is 
>> being deleted with FK link.
>> Either we should warn the user OR make 2 different buttons for FK 
>> removal and table removal as the user may be confused if the selected 
>> table is also removed with the FK.
>>
>> I've added a confirmation dialog which will show the number of tables
>>>

Re: There is an error when checking the major version of servers in schema diff

2021-01-18 Thread Akshay Joshi
Thanks, patch applied.

On Sun, Jan 17, 2021 at 6:28 PM Huang, Jun 
wrote:

> Hi,
>
> The function get_round_val() outputs the wrong value when major version is
> before 10.
> For example,
>Source server version: 90500
>Target server version: 90502
> Or
>Source server version: 90502
>Target server version: 90602
>
> The attached patch shows the changes.
> --
> Thanks && regards
> HuangJ
>
>
>
>

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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM1802] ERD Tool (Beta)

2021-01-18 Thread Aditya Toshniwal
OK, So the changes have worked. But still failing at one more place.
Attached the patch fixes it.

On Mon, Jan 18, 2021 at 4:40 PM Akshay Joshi 
wrote:

> Thanks, patch applied.
>
> On Mon, Jan 18, 2021 at 2:58 PM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> The jasmine test cases are working fine on my local machine. The test
>> cases are successful on jenkins other than on linux, not sure why.
>> I have made some fixes by looking at the log. Please review and try.
>>
>> On Mon, Jan 18, 2021 at 1:10 PM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Thanks, patch applied.
>>>
>>> On Mon, Jan 18, 2021 at 10:34 AM Aditya Toshniwal <
>>> aditya.toshni...@enterprisedb.com> wrote:
>>>
 Hi Akshay,

 I forgot to remove few of the dependencies which are not required as of
 now (may be in future). Attached patch removes those dependencies from
 package.json.

 On Sat, Jan 16, 2021 at 5:08 PM Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Thanks, patch applied.
>
> On Fri, Jan 15, 2021 at 7:01 PM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> I've fixed the issues. You can find the comments inline.
>> I've also added PropTypes for the components for increased validation.
>>
>> On Tue, Jan 12, 2021 at 12:18 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Aditya,
>>>
>>> The functionalities and the code looks good to me, however some of the 
>>> comments as below:
>>>
>>>
>>>- Correct the comments at some places (3 occurrences found  in 
>>> /erd/__init__.py)  which mention Schema diff instead of ERD.
>>>
>>> Some comments in the JS/JSX file regarding components/functions (For 
>>> example, IconButton (forwardRef), Bodywidget etc.) would
>>>
>>> be great help as we all are new to React.
>>>
>>> Done. Added comments to the components.
>>
>>>
>>>- Remove the unused imports (for ex bad_request) in /erd/__init__.py
>>>
>>> Removed.
>>
>>>
>>>- Remove commented code
>>>
>>> # req_args = request.args
>>> # if ('recreate' in req_args and
>>> # req_args['recreate'] == '1'):
>>> # connect = False
>>>
>>> Removed.
>>
>>>
>>>- TableNode.jsx, below two lines can be combined.
>>>
>>> import { PortModelAlignment, DefaultNodeModel } from
>>> '@projectstorm/react-diagrams';
>>> import { PortWidget } from '@projectstorm/react-diagrams';
>>>
>>> Done.
>>
>>>
>>>- onImageClick function in BodyWidget.jsx is no use I think, so it 
>>> should be removed.
>>>
>>> I wanted to keep the code as it will be used in future. Anyway, I've
>> removed the code.
>>
>>>
>>>- I got some console errors while adding/editing tables. Refer to 
>>> the attached screenshot.
>>>
>>> I tried but I didn't get any. Looking at the screenshot, the error
>> is from the underlying library. Can't do much in this.
>>
>>>
>>>- In the column Edit Mode, while deleting the primary key, it gives 
>>> the error, which does not go away with any further modifications.
>>>
>>> Fixed.
>>
>>>
>>>- While generating the SQL, if the server is disconnected, a proper 
>>> error message should be thrown, right now some server side error is 
>>> coming.
>>>
>>> It will show connection lost error now. Fixed.
>>
>>>
>>>- Please remove ... from the menu title (New ERD Project(Beta)...) 
>>> as it is not opening a dialog.
>>>
>>> Done.
>>
>>>
>>>- For large data sets, generate ERD hangs.
>>>
>>> It shows the spinner and waits for the response to come from the
>> back end. I've used the existing table fetching code which is used at 
>> other
>> places. I'll create an RM to improve the back end code for fetching the
>> tables data which will help the schema diff tool as well.
>>
>>>
>>>- Opening the ERD panel in a new window is not working, it opens in 
>>> the same tab even if you have set the Preference "Open in new browser 
>>> tab" to True.
>>>
>>> Fixed. Added the setting in "Tab settings".
>>
>>>
>>>- No shortcut is provided to open the ERD Tool.
>>>
>>> A shortcut is helpful if we are using it frequently. ERD tool won't
>> be used that frequently. We already have a limited number of keys
>> available for shortcuts. I think we should roll out without shortcut for
>> now. If there is a user demand for it then we can think of adding it.
>>
>>>
>>>- SonarQube fixes required.
>>>
>>> Fixed.
>>
>>>
>>>-
>>>
>>> *Suggestion:*
>>>
>>> While removal of the FK link, If any of the table is selected, it is 

pgAdmin 4 commit: One more attempt to fix jasmine test cases of ERD Too

2021-01-18 Thread Akshay Joshi
One more attempt to fix jasmine test cases of ERD Tool.

Branch
--
master

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

Modified Files
--
web/regression/javascript/erd/ui_components/loader_spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin][RM1802] ERD Tool (Beta)

2021-01-18 Thread Akshay Joshi
Thanks, patch applied.

On Mon, Jan 18, 2021 at 5:08 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> OK, So the changes have worked. But still failing at one more place.
> Attached the patch fixes it.
>
> On Mon, Jan 18, 2021 at 4:40 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, patch applied.
>>
>> On Mon, Jan 18, 2021 at 2:58 PM Aditya Toshniwal <
>> aditya.toshni...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> The jasmine test cases are working fine on my local machine. The test
>>> cases are successful on jenkins other than on linux, not sure why.
>>> I have made some fixes by looking at the log. Please review and try.
>>>
>>> On Mon, Jan 18, 2021 at 1:10 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Thanks, patch applied.

 On Mon, Jan 18, 2021 at 10:34 AM Aditya Toshniwal <
 aditya.toshni...@enterprisedb.com> wrote:

> Hi Akshay,
>
> I forgot to remove few of the dependencies which are not required as
> of now (may be in future). Attached patch removes those dependencies from
> package.json.
>
> On Sat, Jan 16, 2021 at 5:08 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, patch applied.
>>
>> On Fri, Jan 15, 2021 at 7:01 PM Aditya Toshniwal <
>> aditya.toshni...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> I've fixed the issues. You can find the comments inline.
>>> I've also added PropTypes for the components for increased
>>> validation.
>>>
>>> On Tue, Jan 12, 2021 at 12:18 PM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi Aditya,

 The functionalities and the code looks good to me, however some of the 
 comments as below:


- Correct the comments at some places (3 occurrences found  in 
 /erd/__init__.py)  which mention Schema diff instead of ERD.

 Some comments in the JS/JSX file regarding components/functions (For 
 example, IconButton (forwardRef), Bodywidget etc.) would

 be great help as we all are new to React.

 Done. Added comments to the components.
>>>

- Remove the unused imports (for ex bad_request) in /erd/__init__.py

 Removed.
>>>

- Remove commented code

 # req_args = request.args
 # if ('recreate' in req_args and
 # req_args['recreate'] == '1'):
 # connect = False

 Removed.
>>>

- TableNode.jsx, below two lines can be combined.

 import { PortModelAlignment, DefaultNodeModel } from
 '@projectstorm/react-diagrams';
 import { PortWidget } from '@projectstorm/react-diagrams';

 Done.
>>>

- onImageClick function in BodyWidget.jsx is no use I think, so it 
 should be removed.

 I wanted to keep the code as it will be used in future. Anyway,
>>> I've removed the code.
>>>

- I got some console errors while adding/editing tables. Refer to 
 the attached screenshot.

 I tried but I didn't get any. Looking at the screenshot, the error
>>> is from the underlying library. Can't do much in this.
>>>

- In the column Edit Mode, while deleting the primary key, it gives 
 the error, which does not go away with any further modifications.

 Fixed.
>>>

- While generating the SQL, if the server is disconnected, a proper 
 error message should be thrown, right now some server side error is 
 coming.

 It will show connection lost error now. Fixed.
>>>

- Please remove ... from the menu title (New ERD Project(Beta)...) 
 as it is not opening a dialog.

 Done.
>>>

- For large data sets, generate ERD hangs.

 It shows the spinner and waits for the response to come from the
>>> back end. I've used the existing table fetching code which is used at 
>>> other
>>> places. I'll create an RM to improve the back end code for fetching the
>>> tables data which will help the schema diff tool as well.
>>>

- Opening the ERD panel in a new window is not working, it opens in 
 the same tab even if you have set the Preference "Open in new browser 
 tab" to True.

 Fixed. Added the setting in "Tab settings".
>>>

- No shortcut is provided to open the ERD Tool.

 A shortcut is helpful if we are using it frequently. ERD tool won't
>>> be used that frequently. We already have a limited number of keys
>>> available for shortcuts. I think we should roll out without shortcut fo

[pgAdmin] RM6098 Manually deleting from table view hangs

2021-01-18 Thread Rahul Shirsat
Hi Hackers,

Please find the attached patch which resolves the issue of deleting records
when the user tries to delete multiple records step by step.

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


RM6098.patch
Description: Binary data


[pgAdmin]: Fix for kerberos test cases.

2021-01-18 Thread Nikhil Mohite
Hi Team,

Please find the patch to fix the failing test cases.


-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* 
*Mob.No: +91-7798364578.*


test_case_fix.patch
Description: Binary data


[pgAdmin]: Patch for SonarQube fixes

2021-01-18 Thread Nikhil Mohite
Hi Team,

I have fixed a few sonarQube issues, PFA patch
Details as follows:

Schema diff:

   - Refactor this function to reduce its Cognitive Complexity from 17 to
   the 15 allowed.
   - Refactor this function to reduce its Cognitive Complexity from 44 to
   the 15 allowed.
   - Refactor this function to reduce its Cognitive Complexity from 32 to
   the 15 allowed.

bg-process:

   - Refactor this function to reduce its Cognitive Complexity from 46 to
   the 15 allowed.
   - Refactor this function to reduce its Cognitive Complexity from 36 to
   the 15 allowed.


-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* 
*Mob.No: +91-7798364578.*


SonarQubeCodeSmellFixes.patch
Description: Binary data