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

Cherry pick non-breaking fixes for a PATCH version release #2296

Merged
merged 62 commits into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
ab90bd2
nix(feat): Add `postgrest-with-git` and `postgrest-with-pgrst` tools
wolfgangwalther Apr 18, 2021
32ff9df
nix(feat): Add `postgrest-loadtest`
wolfgangwalther Apr 12, 2021
5a8d9b1
nix(feat): Add bash completion for git references
wolfgangwalther Apr 18, 2021
94115ff
ci: Disable update of dockerhub description on release
wolfgangwalther Nov 27, 2021
defdcb8
ci: Run IO tests against all postgres versions
wolfgangwalther Nov 27, 2021
9c6597c
ci: Use matrix strategy to test against postgres versions
wolfgangwalther Nov 27, 2021
bbc07d3
fix: Link to latest docs in pre-release openapi output
wolfgangwalther Nov 28, 2021
1cb00d3
fix: Execute deferred constraint triggers when using `Prefer: tx=roll…
wolfgangwalther Nov 28, 2021
c6943a2
refactor: Make asJsonSingleF "safe", by accessing only the first elem…
wolfgangwalther Nov 30, 2021
c2a99b7
nix: Add weeder to postgrest-coverage
wolfgangwalther Dec 3, 2021
cbeb7ab
nix(feat): Add postgrest-git-hooks to enable pre-commit and pre-push …
wolfgangwalther Nov 28, 2021
199714c
fix: Dump db-config option without quotes as it's a boolean
wolfgangwalther Dec 10, 2021
610ef2d
build(deps): bump actions/download-artifact from 2.0.10 to 2.1.0
dependabot[bot] Dec 13, 2021
c99ecb6
build(deps): bump actions/upload-artifact from 2.2.4 to 2.3.0
dependabot[bot] Dec 13, 2021
f0fcf2a
fix: `is` not working with upper/mixed case values (#2081)
steve-chavez Dec 15, 2021
98cbfc1
build(deps): bump actions/upload-artifact from 2.3.0 to 2.3.1 (#2094)
dependabot[bot] Dec 20, 2021
fe5f24d
fix: Make recursive view parsing work with XMLTABLE + DEFAULT
wolfgangwalther Dec 24, 2021
e2513cb
fix: Fix wrong CORS header Authentication -> Authorization
wolfgangwalther Jan 3, 2021
474167d
cov: Improve jwt claims test-cases
wolfgangwalther Jan 3, 2021
fcc6b66
Remove outdated heroku manifest
wolfgangwalther Nov 26, 2021
2c8b5c2
nix: Fix nested postgrest-with-postgresql-x calls when -f is used
wolfgangwalther Jan 3, 2022
9a5f8df
test: Use .encode() end .decode default values in io-tests
wolfgangwalther Jan 3, 2022
19597a9
test: Refactor invalid_role_claim_key_notify_reload test to properly …
wolfgangwalther Dec 26, 2021
5ae86af
test: Improve log output for failing io-tests
wolfgangwalther Jan 3, 2022
42ce326
test: Move io-tests SQL fixtures to a separate file
wolfgangwalther Jan 3, 2022
a4ffc12
test: Improve io test perfomance
wolfgangwalther Jan 3, 2022
2fc3cea
test: Remove unused unix-socket.config file
wolfgangwalther Jan 3, 2022
6cc6a7b
cov: Add tests for request logging
wolfgangwalther Dec 26, 2021
e7f46f9
cov: Remove unreachable static icon
wolfgangwalther Jan 3, 2021
ebb7887
refactor: simplify logger middleware
wolfgangwalther Jan 3, 2021
3e01150
cov: Add coverage overlay for impossible case in corsPolicy
wolfgangwalther Jan 5, 2022
a739bb6
Remove unused dependencies from postgrest.cabal
wolfgangwalther Jan 7, 2022
dc96a63
test: Reorganize test/ folder into one subdirectory for each test type
wolfgangwalther Jan 7, 2022
1e4d44b
cov: empty coverage overlay (#2119)
steve-chavez Jan 7, 2022
fd6f8e4
refactor: Move each Wai Middleware to a separate file
wolfgangwalther Jan 5, 2022
de2c8c7
refactor: Reformat db-config query
wolfgangwalther Jan 10, 2022
5f5a8e4
fix: Read database configuration properly when `=` is present in value
wolfgangwalther Jan 10, 2022
a7da373
Align columns in postgrest.cabal
wolfgangwalther Jan 10, 2022
fa42f22
ci: Add -with-rtsopts=-KxK option to prevent introducing space leaks
wolfgangwalther Jan 10, 2022
27c4b43
fix: Remove trigger functions from schema cache and OpenAPI output
wolfgangwalther Jan 24, 2022
a56b663
ci: Fix windows build failing because of outdated keyring
wolfgangwalther Jan 28, 2022
1c80ffc
fix: Take PG version into account in --dump-schema
wolfgangwalther Feb 5, 2022
f9ce595
fix: Remove aggregates, procedures and window functions from schema c…
wolfgangwalther Feb 5, 2022
92a3041
fix: Keep working when EMFILE is reached (#2158)
steve-chavez Feb 9, 2022
06f2911
fix: Using GET with certain Content-Type headers now correctly calls …
laurenceisla Feb 28, 2022
7b4120b
build(deps): bump actions/download-artifact from 2.1.0 to 3 (#2185)
dependabot[bot] Mar 7, 2022
4e65a6f
build(deps): bump actions/upload-artifact from 2.3.1 to 3 (#2187)
dependabot[bot] Mar 8, 2022
10a8828
build(deps): bump actions/checkout from 2.4.0 to 3 (#2186)
dependabot[bot] Mar 8, 2022
15a6eeb
fix: json/jsonb columns should not have type "string" in OpenAPI spec…
clrnd Mar 26, 2022
092e831
Bypass FreeBSD builds due to timeouts
laurenceisla Mar 26, 2022
1cc3f61
build(deps): bump actions/cache from 2.1.7 to 3
dependabot[bot] Mar 28, 2022
0c14403
build(deps): bump codecov/codecov-action from 2.1.0 to 3.0.0
dependabot[bot] Apr 11, 2022
ba7bdbd
Fix misleading disambiguation error where `relationship` looks like v…
laurenceisla Apr 11, 2022
8aa96b9
Add CI for ARM architectures (#2127)
laurenceisla Apr 18, 2022
5174e61
ci: remove armv7 architectures for ARM builds
laurenceisla Apr 23, 2022
f02e33f
build(deps): bump codecov/codecov-action from 3.0.0 to 3.1.0
dependabot[bot] Apr 25, 2022
022db48
ci: Fix Windows build using Stack
laurenceisla May 5, 2022
5a000da
ci: Run ARM builds on releases
laurenceisla May 16, 2022
132a642
ci: run on branches starting with "rel-"
laurenceisla May 31, 2022
a3d4cb1
fix: disable parallel GC for perf on high-core CPU
steve-chavez May 31, 2022
cc73644
fix: using CPU while idle
steve-chavez May 31, 2022
78eeb41
bump version to 9.0.1
steve-chavez Jun 4, 2022
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
63 changes: 63 additions & 0 deletions .github/scripts/arm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

# This script builds PostgREST in a remote ARM server

[ -z "$1" ] && { echo "Missing 1st argument: PostgREST github commit SHA"; exit 1; }
[ -z "$2" ] && { echo "Missing 2nd argument: Build environment directory name"; exit 1; }

PGRST_GITHUB_COMMIT="$1"
SCRIPT_DIR="$2"

DOCKER_BUILD_DIR="$SCRIPT_DIR/docker-env"

install_packages() {
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y git build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 llvm libnuma-dev zlib1g-dev libpq-dev jq gcc
sudo apt-get clean
}

install_ghcup() {
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
export BOOTSTRAP_HASKELL_MINIMAL=1
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
source ~/.ghcup/env
}

install_cabal() {
ghcup upgrade
ghcup install cabal 3.6.0.0
ghcup set cabal 3.6.0.0
}

install_ghc() {
ghcup install ghc 8.10.7
ghcup set ghc 8.10.7
}

install_packages

# Add ghcup to the PATH for this session
[ -f ~/.ghcup/env ] && source ~/.ghcup/env

ghcup --version || install_ghcup
cabal --version || install_cabal
ghc --version || install_ghc

cd ~/$SCRIPT_DIR

# Clone the repository and build the project
git clone https://github.com/PostgREST/postgrest.git
cd postgrest
git checkout $PGRST_GITHUB_COMMIT
cabal v2-update && cabal v2-build

# Copy the built binary to the Dockerfile directory
PGRST_BIN=$(cabal exec which postgrest | tail -1)
cp $PGRST_BIN ~/$DOCKER_BUILD_DIR

# Move and compress the built binary
mkdir -p ~/$SCRIPT_DIR/result
mv $PGRST_BIN ~/$SCRIPT_DIR/result
cd ~/$SCRIPT_DIR
tar -cJf result.tar.xz result
16 changes: 16 additions & 0 deletions .github/scripts/arm/docker-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PostgREST docker hub image

FROM ubuntu:focal AS postgrest

RUN apt-get update -y \
&& apt install -y --no-install-recommends libpq-dev zlib1g-dev jq gcc libnuma-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY postgrest /usr/bin/postgrest

EXPOSE 3000

USER 1000

CMD postgrest
50 changes: 50 additions & 0 deletions .github/scripts/arm/docker-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# This script publishes the Docker ARM images to Docker Hub.

[ -z "$1" ] && { echo "Missing 1st argument: PostgREST github commit SHA"; exit 1; }
[ -z "$2" ] && { echo "Missing 2nd argument: Docker repo"; exit 1; }
[ -z "$3" ] && { echo "Missing 3rd argument: Docker username"; exit 1; }
[ -z "$4" ] && { echo "Missing 4th argument: Docker password"; exit 1; }
[ -z "$5" ] && { echo "Missing 5th argument: Build environment directory name"; exit 1; }
[ -z "$6" ] && { echo "Missing 6th argument: PostgREST version"; exit 1; }

PGRST_GITHUB_COMMIT="$1"
DOCKER_REPO="$2"
DOCKER_USER="$3"
DOCKER_PASS="$4"
SCRIPT_DIR="$5"
PGRST_VERSION="v$6"
IS_PRERELEASE="$7"

DOCKER_BUILD_DIR="$SCRIPT_DIR/docker-env"

clean_env()
{
sudo docker logout
}

# Login to Docker
sudo docker logout
{ echo $DOCKER_PASS | sudo docker login -u $DOCKER_USER --password-stdin; } || { echo "Couldn't login to docker"; exit 1; }

trap clean_env sigint sigterm exit

# Move to the docker build environment
cd ~/$DOCKER_BUILD_DIR

# Push final images to Docker hub
# NOTE: This command publishes a separate ARM image because the builds cannot
# be added to the manifest if they are not in the registry beforehand.
# This image must be manually deleted from Docker Hub at the end of the process.
sudo docker buildx build --build-arg PGRST_GITHUB_COMMIT=$PGRST_GITHUB_COMMIT \
-t $DOCKER_REPO/postgrest:$PGRST_VERSION-arm \
--push .

# Add the arm images to the manifest
# NOTE: This assumes that there already is a `postgrest:<version>` image
# for the amd64 architecture pushed to Docker Hub
sudo docker buildx imagetools create --append -t $DOCKER_REPO/postgrest:$PGRST_VERSION $DOCKER_REPO/postgrest:$PGRST_VERSION-arm
[ -z $IS_PRERELEASE ] && sudo docker buildx imagetools create --append -t $DOCKER_REPO/postgrest:latest $DOCKER_REPO/postgrest:$PGRST_VERSION-arm

sudo docker logout
Loading