Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwQOw-0004ES-83 for pgadmin-hackers@arkaria.postgresql.org; Thu, 24 Jun 2021 14:32:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwQOv-0003Yj-67 for pgadmin-hackers@arkaria.postgresql.org; Thu, 24 Jun 2021 14:32:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwQOu-0003YV-UV for pgadmin-hackers@lists.postgresql.org; Thu, 24 Jun 2021 14:32:17 +0000 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lwQOr-0006RR-Ew for pgadmin-hackers@postgresql.org; Thu, 24 Jun 2021 14:32:16 +0000 Received: by mail-il1-x12b.google.com with SMTP id s19so6526270ilj.1 for ; Thu, 24 Jun 2021 07:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wLcYJB+0WH0miU7sNwmW7M722D5QMfdE79n4j4T5y9M=; b=BP9DfOD9HcEFdxJ6c4EfmTCKIzJ0C4FZyz95WkCZ+vH8Qto6s34S0BjH4yKCZgxMmS 2WdRU0d+o1qYnH18aOCBH+pR1X8Jrvm56wYhMiojuLzcVkwValpfCnhOYxxr3UO+XVkC RfeUf3FyxQRKzmh67o/lfQiZ2f6Nec5ia2zttI4G7XtHZ4UgjzO073T08Wm+6dTHVwb+ fuLRuwDfAx5/lAtXRGPneK92pRuRfG551YoMiGpuoQcyygyepWgaIGEVzMJRLSItYM59 SiiemQkfVGsy/zsDpX8fusU2yKjekdO3596CugYqIs+AnK7g6uL79PuVVB18xzFQtB9o mUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wLcYJB+0WH0miU7sNwmW7M722D5QMfdE79n4j4T5y9M=; b=bnqI890IyhfJOeb4KApcXh+uz3Lgwlzzi2+PGBapQL6OgIkWi9brEmkgW4SeEz9rmH Jp2Au5rxD3eHqGeAhE9E+GoTgNRNddy3C4x1p5qhao6lP0YcwZ/M4V6aRG8fio293WAK CCod97DubhP2AyOcxlULjwB69+ROT4o16AeNJ0B+2DnAvmttSNm8y7Y65KsVTV/CDe1H oCYKKTDwpkvVTx1qlDLYbkb+Eqn4AbvMW0QehkV9c5aDxnR4QJwJOn7ys5Yt5cPbCtND +8DgO50xR+WpG5mtYKagb4CGVjNMRhwyq/aBHRqq9GNrJBDQqkrzhFSWim2MO3JPg46b pUKw== X-Gm-Message-State: AOAM532nBUK8zy2UzlJGp+U/qze7wHx9FkI75mMfjOO+LjfV1Sh7RkNi eEAmMicD2mynH0GKQdLFs4tsQEIfxtmrXnk01Jfb/MN6J68LC2TCNYG0s4K2ztZPKBsqYvImD0v YGCjz8NJjwGjxApRFdl1Kjvx6CcmQfCJEPc0gQPCsWZm280YUlj/M/So6vJNVYoi/mMDQkZSFHP KrxtUoIOzT5FhV4t9/iD1yrjfOcsyC05MfE6NpqskScgSO66kKyyh292/dIg== X-Google-Smtp-Source: ABdhPJwGB2FBgYbspn9cCQR2zt7Mey06W+DjLUNSlfsGkM/aEXQqcTSuO7SMhjcT5FGvnHKhg0Sy+T+c8SUoa1or6Q0= X-Received: by 2002:a92:b004:: with SMTP id x4mr3933784ilh.121.1624545131070; Thu, 24 Jun 2021 07:32:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Akshay Joshi Date: Thu, 24 Jun 2021 20:02:00 +0530 Message-ID: Subject: Re: Refactor: Registry Classes To: Khushboo Vashi Cc: Ashesh Vashi , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000075a00b05c583e3d3" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000075a00b05c583e3d3 Content-Type: text/plain; charset="UTF-8" Thanks, the patch applied. On Thu, Jun 24, 2021 at 3:51 PM Khushboo Vashi < khushboo.vashi@enterprisedb.com> wrote: > Hi, > > This patch introduced the server mode api test case failure, please find > the attached patch to fix those as well as some of the old issues in the > server mode. > Patch by: Ashesh Vashi > > Thanks, > Khushboo > > > On Thu, Jun 24, 2021 at 11:31 AM Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> Thanks, the patch applied. >> >> On Wed, Jun 23, 2021 at 7:54 PM Ashesh Vashi < >> ashesh.vashi@enterprisedb.com> wrote: >> >>> On Wed, Jun 23, 2021 at 1:22 PM Akshay Joshi < >>> akshay.joshi@enterprisedb.com> wrote: >>> >>>> Hi Ashesh >>>> >>>> Following are the review comments: >>>> >>>> - Fixed PEP8 issues. >>>> >>>> Done. >>> >>>> >>>> - In "dynamic_registry/__init__.py" decorator @classmethod used for >>>> "*_get*" and "*_load_modules*" methods which are actually outside >>>> of the class. Even constructor also outside of the class. >>>> >>>> 'create_registry_metaclass' is not a class, but a method to create the >>> dynamic classes. >>> If I move these methods in 'create_registry_metaclass' method, SonarQube >>> raises issues about complexity of the functions, hence - they're best kept >>> outside of that method. >>> >>>> >>>> - Remove unused imports from "driver/registry.py" >>>> >>>> Done >>> >>>> >>>> - >>>> - Fixed sonarqube issues in >>>> "dynamic_registry/tests/registry/__init__.py" >>>> >>>> Done >>> As discussed, SonarQube is not able to understand that the result object >>> is a class, and not an object, hence - showing linter issues. >>> I've disabled them in those lines by adding the comment '# NOSNAR' at >>> the end. >>> >>> -- Thanks, Ashesh >>> >>>> >>>> On Sat, Jun 19, 2021 at 11:27 AM Ashesh Vashi < >>>> ashesh.vashi@enterprisedb.com> wrote: >>>> >>>>> On Sat, Jun 19, 2021 at 1:39 AM Ashesh Vashi < >>>>> ashesh.vashi@enterprisedb.com> wrote: >>>>> >>>>>> Hi Akshay, >>>>>> >>>>>> We do have a couple of classes, which does automatic registration of >>>>>> the base classes, >>>>>> and which creates single-ton objects for these base classes, when >>>>>> needed. >>>>>> >>>>>> I would be working on a patch sooner, which will be using similar >>>>>> functionality for loading >>>>>> the multi-factor authentication. >>>>>> >>>>>> I realized - it will be a duplicate code at three places for the same >>>>>> functionalities. >>>>>> Hence - I worked on refactoring this registry class. >>>>>> >>>>>> Please find the patch for the same. >>>>>> >>>>> Found issues - some test files were using the old function >>>>> 'Driver.load_drivers(...)'. >>>>> They're fixed now. >>>>> >>>>> -- Thanks, Ashesh >>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Thanks & Regards, >>>>>> >>>>>> Ashesh Vashi >>>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company >>>>>> >>>>>> >>>>>> >>>>>> *http://www.linkedin.com/in/asheshvashi* >>>>>> >>>>>> >>>>> >>>> >>>> -- >>>> *Thanks & Regards* >>>> *Akshay Joshi* >>>> *pgAdmin Hacker | Principal Software Architect* >>>> *EDB Postgres * >>>> >>>> *Mobile: +91 976-788-8246* >>>> >>> >> >> -- >> *Thanks & Regards* >> *Akshay Joshi* >> *pgAdmin Hacker | Principal Software Architect* >> *EDB Postgres * >> >> *Mobile: +91 976-788-8246* >> > -- *Thanks & Regards* *Akshay Joshi* *pgAdmin Hacker | Principal Software Architect* *EDB Postgres * *Mobile: +91 976-788-8246* --00000000000075a00b05c583e3d3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, the patch applied.

On Thu, Jun 24, 2021 at 3:51= PM Khushboo Vashi <k= hushboo.vashi@enterprisedb.com> wrote:
Hi,

This = patch introduced the server mode api test case failure, please find the att= ached patch to fix those as well as some of the old issues in the server mo= de.=C2=A0
Patch by: Ashesh Vashi

Thanks,=
Khushboo


On Thu, Jun 24, 2021 at 11:31 AM Ak= shay Joshi <akshay.joshi@enterprisedb.com> wrote:
Thanks, the patch appl= ied.

On Wed, Jun 23, 2021 at 7:54 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com<= /a>> wrote:
<= div dir=3D"ltr">
Hi= =C2=A0Ashesh

Following are the review comments:
  • Fixed PEP8 issues.
Done.
  • In "dynamic_registry/__init__.py" decorator @classmethod= used for "_get" and "_load_modules" meth= ods which are actually outside of the class. Even constructor also outside = of the class.
'create_regist= ry_metaclass' is not a class, but a method to create the dynamic classe= s.
If I move these methods in 'create_registry_metaclass'= method, SonarQube raises issues about complexity of the functions, hence -= they're best kept outside of that method.=C2=A0
  • Remove unused imp= orts from "driver/registry.py"
Done
  • Fixed sonarqube issues in "dynamic_registry/test= s/registry/__init__.py"
Done
As discussed, SonarQube is not able to understand that the result obj= ect is a class, and not an object, hence - showing linter issues.
=
I've disabled them in those lines by adding the comment '# NOS= NAR' at the end.

-- Thanks, Ashesh

=
On Sat, Jun 19, 2021 at 11:27 AM Ashe= sh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Sat,= Jun 19, 2021 at 1:39 AM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wro= te:
Hi Akshay,

We do have a = couple of classes, which does automatic registration of the base classes,
and which creates single-ton objects for these base classes, when = needed.

I would be working on a patch sooner, whic= h will be using similar functionality for loading
the multi-facto= r authentication.

I realized - it will be a duplic= ate code at three places for the same functionalities.
Hence - I = worked on refactoring this registry class.

Please = find the patch for the same.=C2=A0
Found issue= s - some test files were using the old function 'Driver.load_drivers(..= .)'.
They're fixed now.

-- Thank= s, Ashesh

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
=


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



--
Thank= s & Regards
Akshay Joshi
pgAdmin Hacker | Principal Softw= are Architect
EDB Po= stgres
Mobile: +91 976-788-8246



--
Thank= s & Regards
Akshay Joshi
pgAdmin Hacker | Principal Softw= are Architect
EDB Po= stgres
Mobile: +91 976-788-8246



--
Thanks & Regards
Akshay Joshi
pgAdmi= n Hacker | Principal Software Architect
EDB Postgres
Mobile: +91 976-788-8246

--00000000000075a00b05c583e3d3--