Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDN-2062: Add support for Postgres 15 #23

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/pr-validator.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/pr-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "PR Title and Description Check"
on:
pull_request:
types: [opened, edited, synchronize]

jobs:
check-title-and-description:
runs-on: ubuntu-latest
steps:
- name: Check PR title and description
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const payload = context.payload;
const prTitle = payload.pull_request.title;
const prDescription = payload.pull_request.body;

// The pattern for JIRA ticket format
const jiraPattern = /\b[A-Z]+-\d+\b|breakglass/gi;

// Check PR title
const hasJiraTitle = jiraPattern.test(prTitle);
console.log(`PR title: ${hasJiraTitle ? 'Valid' : 'Invalid'}`);

// Check PR description
const hasJiraDescription = prDescription ? prDescription.match(jiraPattern) : false;
console.log(`PR description: ${hasJiraDescription ? 'Valid' : 'Invalid'}`);

if (hasJiraTitle || hasJiraDescription) {
console.log('PR title or description format is correct.');
} else {
const errorMessage = [];
errorMessage.push('The PR title and description do not include a valid JIRA ticket!');
console.log(errorMessage.join('\n'));

core.setFailed(errorMessage.join('\n'));
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# for caching, see: http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html
# sudo:false necessary for travis container-based infra, allowing caching
sudo: false
dist: jammy
services:
- docker
script:
- docker build .
- docker build -f Dockerfile-15 .
branches:
only:
- main
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM flowdocker/postgresql:0.1.63
FROM flowdocker/postgresql:latest

ADD . /opt/schema
WORKDIR /opt/schema
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile-15
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM flowdocker/postgresql15:latest

ADD . /opt/schema
WORKDIR /opt/schema

RUN service postgresql start && \
./install.sh && \
service postgresql stop

USER "postgres"
CMD ["/usr/lib/postgresql/15/bin/postgres", "-i", "-D", "/var/lib/postgresql/15/main"]
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
psql -U postgres -c 'create database dependencydb' postgres
psql -U postgres -c 'create role api login PASSWORD NULL' postgres > /dev/null
psql -U postgres -c 'GRANT ALL ON DATABASE dependencydb TO api' postgres
psql -U postgres -c 'grant all on schema public to api' dependencydb
sem-apply --url postgresql://api@localhost/dependencydb
16 changes: 0 additions & 16 deletions scripts/20151107-131159.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2361,14 +2361,6 @@ FOREACH v_id IN ARRAY p_partition_ids LOOP
, v_partition_name
, v_parent_schema
, v_parent_tablename);
SELECT relhasoids INTO v_hasoids
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE c.relname = v_parent_tablename
AND n.nspname = v_parent_schema;
IF v_hasoids IS TRUE THEN
v_sql := v_sql || ' WITH (OIDS)';
END IF;
EXECUTE v_sql;
IF v_parent_tablespace IS NOT NULL THEN
EXECUTE format('ALTER TABLE %I.%I SET TABLESPACE %I', v_parent_schema, v_partition_name, v_parent_tablespace);
Expand Down Expand Up @@ -2694,14 +2686,6 @@ FOREACH v_time IN ARRAY p_partition_times LOOP
, v_partition_name
, v_parent_schema
, v_parent_tablename);
SELECT relhasoids INTO v_hasoids
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE c.relname = v_parent_tablename
AND n.nspname = v_parent_schema;
IF v_hasoids IS TRUE THEN
v_sql := v_sql || ' WITH (OIDS)';
END IF;
EXECUTE v_sql;
IF v_parent_tablespace IS NOT NULL THEN
EXECUTE format('ALTER TABLE %I.%I SET TABLESPACE %I', v_parent_schema, v_partition_name, v_parent_tablespace);
Expand Down
2 changes: 1 addition & 1 deletion scripts/20181029-115650.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
create or replace function journal.quote_column(name in varchar) returns varchar language plpgsql as $$
create or replace function journal.quote_column(name in information_schema.sql_identifier) returns text language plpgsql as $$
begin
return '"' || name || '"';
end;
Expand Down
11 changes: 11 additions & 0 deletions scripts/20240201-173934.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Drop the function first, can't replace it because the signature changed.
-- Can't assume the function exists either (e.g., tokendb doesn't have it).
DROP FUNCTION IF EXISTS journal.quote_column;
CREATE FUNCTION journal.quote_column(name information_schema.sql_identifier)
RETURNS text
LANGUAGE plpgsql
AS $function$
begin
return '"' || name || '"';
end;
$function$
Loading
Loading