Bug 255969

Summary: www/hs-postgrest: Added an option for support database connection poolers and small cleanup
Product: Ports & Packages Reporter: Dmitry Wagin <dmitry.wagin>
Component: Individual Port(s)Assignee: Li-Wen Hsu <lwhsu>
Status: Closed FIXED    
Severity: Affects Only Me CC: lwhsu
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
hs-postgrest.diff
dmitry.wagin: maintainer-approval+
hs-postgrest.patch dmitry.wagin: maintainer-approval+

Description Dmitry Wagin 2021-05-18 09:38:56 UTC
Created attachment 225058 [details]
hs-postgrest.diff

- Added a POOLER option for support connection poolers (like PgBouncer, Odyssey, etc) in transaction mode. The option disables usage of prepared statements.

- Moved a plist from pkg-plist to Makefile.

- Added nginx before-condition to rc-script.


Some discussions about this:

https://github.com/PostgREST/postgrest/pull/1633

https://github.com/PostgREST/postgrest/pull/1542
Comment 1 Dmitry Wagin 2021-06-01 08:58:23 UTC
ping
Comment 2 Li-Wen Hsu freebsd_committer 2021-06-02 08:27:27 UTC
(In reply to Dmitry Wagin from comment #1)
I got this:

===>  Patching for hs-postgrest-7.0.1_4
===>  Applying extra patch /usr/ports/www/hs-postgrest/files/extra-patch-hasql-1.4.2_library_Hasql_Private_IO.hs
No file to patch.  Skipping...
1 out of 1 hunks ignored--saving rejects to hasql-1.4.2/library/Hasql/Private/IO.hs.rej
Can't create hasql-1.4.2/library/Hasql/Private/IO.hs.rej, output is in /tmp/patchrq64xKQVnY9: No such file or directory
===>  FAILED Applying extra patch /usr/ports/www/hs-postgrest/files/extra-patch-hasql-1.4.2_library_Hasql_Private_IO.hs


Can you help to check this one?

BTW, if possible, please submit the patch with `git format-patch` which is easier for committer and other tools to apply. It's preferred but not strict requirement.

Thanks.
Comment 3 Dmitry Wagin 2021-06-02 13:17:20 UTC
Created attachment 225498 [details]
hs-postgrest.patch

The problem has been occurred after 1db88699b09ff53bf0029cb8a01dad1e7f646a4c ( https://cgit.freebsd.org/ports/commit/?id=1db88699b09ff53bf0029cb8a01dad1e7f646a4c )
Comment 4 Dmitry Wagin 2021-06-15 09:21:26 UTC
ping
Comment 5 Li-Wen Hsu freebsd_committer 2021-06-15 16:08:42 UTC
Testing in my poudriere.
Comment 6 Li-Wen Hsu freebsd_committer 2021-06-16 06:38:31 UTC
Is this part also necessary? nginx isn't listed as a dependency of this port:

diff --git a/www/hs-postgrest/files/postgrest.in b/www/hs-postgrest/files/postgrest.in
index 7dac382dd80a..7ad89ce8615a 100644
--- a/www/hs-postgrest/files/postgrest.in
+++ b/www/hs-postgrest/files/postgrest.in
@@ -2,6 +2,7 @@
 
 # PROVIDE: postgrest
 # REQUIRE: LOGIN
+# BEFORE: nginx
 # KEYWORD: shutdown
 #
 # Add postgrest_enable="YES" to /etc/rc.conf to enable PostgREST:
Comment 7 Dmitry Wagin 2021-06-16 13:49:16 UTC
(In reply to Li-Wen Hsu from comment #6)

In most cases PostgREST (as a backend) are used with nginx (as a frontend). This change avoids race conditions at the start and stop.
Comment 8 commit-hook freebsd_committer 2021-06-19 09:56:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a45ed18ebabb5a37a5b3552bb1acda8d6f285721

commit a45ed18ebabb5a37a5b3552bb1acda8d6f285721
Author:     Dmitry Wagin <dmitry.wagin@ya.ru>
AuthorDate: 2021-06-02 11:45:46 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-06-19 09:54:12 +0000

    www/hs-postgrest: Added an option for support database connection poolers

    Small cleanups included

    PR:             255969

 www/hs-postgrest/Makefile                          | 33 +++++++++++++---------
 ...s_hasql-1.4.2_library_Hasql_Private_IO.hs (new) | 13 +++++++++
 www/hs-postgrest/files/postgrest.in                |  1 +
 www/hs-postgrest/pkg-plist (gone)                  |  2 --
 4 files changed, 34 insertions(+), 15 deletions(-)