Skip to content

Commit e441068

Browse files
pranavJ23shardgupta
authored andcommitted
[OSS-ONLY] [TESTS-ONLY] Adding patch file during JDBC Tests With PG AUDIT Enable WorkFlow (#4329)
Adding the patch file in the pgaudit Workflow itself instead of having a separate patch file for different version Signed-off-by: pranav jain <pranav23iitd@gmail.com>
1 parent ab6b502 commit e441068

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.github/scripts/pgaudit_executor_hook_null_check.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/jdbc-tests-pgaudit-enable.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ jobs:
7777
with:
7878
wal_level: logical
7979

80+
- name: Adding PgAudit Patch
81+
run: |
82+
cat > ~/pgaudit_executor_hook_null_check.patch << 'EOF'
83+
--- a/pgaudit.c
84+
+++ b/pgaudit.c
85+
@@ -1529,7 +1529,7 @@ pgaudit_ExecutorCheckPerms_hook(List *rangeTabls,
86+
auditEventStack->auditEvent.permInfos = permInfos;
87+
}
88+
}
89+
- else
90+
+ else if (auditEventStack != NULL)
91+
{
92+
STACK_NOT_EMPTY();
93+
log_select_dml(auditOid, rangeTabls, permInfos);
94+
EOF
95+
shell: bash
96+
8097
- name: Build and Install PgAudit
8198
run: |
8299
cd ~
@@ -86,13 +103,13 @@ jobs:
86103
git clone --depth 1 --branch REL_17_STABLE https://github.com/pgaudit/pgaudit.git
87104
cd pgaudit
88105
# Apply patch to fix BABEL-4600
89-
patch -p1 < ${{ github.workspace }}/.github/scripts/pgaudit_executor_hook_null_check.patch
106+
patch -p1 < ~/pgaudit_executor_hook_null_check.patch
90107
make install USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config
91108
elif [[ "${{ matrix.extension_branch }}" == 'BABEL_4_X_DEV' ]]; then
92109
git clone --depth 1 --branch REL_16_STABLE https://github.com/pgaudit/pgaudit.git
93110
cd pgaudit
94111
# Apply patch to fix BABEL-4600
95-
patch -p1 < ${{ github.workspace }}/.github/scripts/pgaudit_executor_hook_null_check.patch
112+
patch -p1 < ~/pgaudit_executor_hook_null_check.patch
96113
make install USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config
97114
else
98115
echo "Unsupported branch: ${{ matrix.extension_branch }}"

0 commit comments

Comments
 (0)