Commit Graph
100 Commits
Author SHA1 Message Date
Wolfgang Walther fc7f715aeb ci: Update cirrus' freebsd image to 14.1
This should fix CI which is failing lately like this:
https://cirrus-ci.com/task/4665005218463744

ld-elf.so.1: /lib/libc.so.7: version FBSD_1.8 required by
/usr/local/bin/stack not found
2024-10-26 14:52:13 +02:00
Wolfgang Walther 5b755b2877 docs: Remove broken link
https://github.com/PostgREST/postgrest/actions/runs/11136795565/job/30949162312
2024-10-04 16:02:33 +02:00
Wolfgang Walther 53593824a8 fix: Embed One-to-One relationship with different column order properly 2024-07-13 22:27:04 +02:00
Wolfgang Walther e642086d27 chore: Fix changelog after 13868983 2024-07-13 17:16:06 +02:00
Wolfgang WaltherandWolfgang Walther 9a40bc266e fix: List correct enum options when multiple types with same name are present
The schema cache and OpenAPI output would currently list the first found
enum with the same name instead of the correct type. One other case
where this comes up is when a regular type and an enum type have the
same name. For example in the spec fixtures, we have an enum called
"bit". Every "bit" type, no matter whether it's that enum or the
built-in bit type, will show those enum options in the OpenApi output.

Not adding a test, because OpenAPI is supposed to go away in the future
anyway.
2024-07-09 09:09:22 +02:00
Wolfgang WaltherandWolfgang Walther e67461b991 fix: Show number of loaded timezones in log output
There is no reason to hide those, right?
2024-07-09 09:09:22 +02:00
Wolfgang WaltherandWolfgang Walther 420933ceba fix: Make --dump-schema work with in-database pgrst.db_schemas setting
This needs to be loaded from in-database configuration first, otherwise
the dump-schema output will be for the default (public) schema.
2024-07-09 09:09:22 +02:00
Wolfgang WaltherandSteve Chavez 7860e7287f docs: Fix punctuation in install.rst 2024-06-27 14:08:16 -05:00
Wolfgang Walther 16d0e1ca8c fix: Treat pre-release and docs versions correctly for new release workflow
Since we changed our release workflow, we have adjusted:
- the docs to use postgrest.org/en/v12/ -style URLs, i.e. only using the
major component.
- the pre-release / devel versions to contain only two instead of four
version parts, i.e. currently 12.3.
2024-06-19 08:42:34 +02:00
Wolfgang Walther 9657d46c42 docs: Fix linkcheck
Some URLs are still forbidden for our linkcheck tool, so disabling them
again.

Others are permanently redirected, so adjusting them.
2024-06-19 08:40:58 +02:00
Wolfgang Walther 49a7aa9933 bump docs version to 12.2 2024-06-12 07:47:17 +02:00
Wolfgang Walther a2d00e305a nix: Make postgrest-release work on remotes without .git suffix 2024-06-05 21:32:41 +02:00
Wolfgang Walther 70a8a80491 Revert "fix: Build static postgrest with GSSAPI support"
This reverts commit c94aa9ccd9.
2024-06-05 19:59:07 +02:00
Wolfgang Walther b4d235f72a nix: refactor to remove TODO
We have meanwhile received the commit in question.
2024-06-05 19:53:29 +02:00
Wolfgang WaltherandWolfgang Walther 71711bb935 ci: Prevent caching cabal and stack cache in PRs
This was supposed to happen in c4b0bd34 and 279febe2, but somehow didn't
work, yet.
2024-05-21 20:44:41 +02:00
Wolfgang Walther ad5bb38d70 ci: Don't cancel previous runs for tag pipelines
Those create annoying "cancelled" notifications which looks like CI on
main was failing. It's not, though.

By just disabling the cancel-in-progress setting, but keeping the group
intact, this should queue multiple tag jobs / tag workflows behind each
other and still avoids the underlying problem which occurs when running
them in parallel.
2024-05-21 20:43:18 +02:00
Wolfgang Walther 89eae607f5 ci: Run build workflow in PRs which change composite actions
This should have been added in c4b0bd34 for cache-on-main and way before
that for artifact-from-cirrus.
2024-05-21 19:57:39 +02:00
Wolfgang Walther dcfc6673b7 ci: Fix out-of-sync GHC version for stack jobs 2024-05-21 19:39:15 +02:00
Wolfgang WaltherandWolfgang Walther 9e6a89ffb8 ci: Install GHC/stack via haskell-actions/setup consistently
This action makes sure to always have the correct GHC and/or stack
version installed in all environments. This solves problem where ghc or
stack might not be available on newer macos images anymore or where
ghcup is not available by default on our new custom github runner on
arm.
2024-05-20 15:43:00 +02:00
Wolfgang WaltherandWolfgang Walther d08e5959a0 ci: Reduce stack cache size
This removes the GHC install from stack caches to reduce size.
2024-05-20 15:43:00 +02:00
Wolfgang WaltherandWolfgang Walther 279febe26b ci: Split cabal and stack work caches from regular cache
This is a first step to split up the cabal and stack caches in separate
pieces. Here we split the work folder, which just contains the
postgrest-specific build artifacts, into a separate cache.

More fine-grained caching should give us better cache hits and much
fewer upload size in the regular case, improving CI performance.

Since the work file caches are very small (about 30-40 MB) they are
cached for PRs, too. This will allow the majority of PRs, which only
change source code files, but no dependencies, to still have cached
their build files for additional commits.
2024-05-20 15:43:00 +02:00
Wolfgang WaltherandWolfgang Walther c4b0bd347b ci: Only save caches on main and release branches
This restores caches on all branches and pull requests, but only stores
them on the main branch and release branches. This prevents those caches
from being evicted early when we hit the 10 GB limit quickly.
2024-05-20 15:43:00 +02:00
Wolfgang WaltherandWolfgang Walther f6b2aa5a5d chore(deps): Update stackage extra deps 2024-05-13 08:08:18 +02:00
Wolfgang WaltherandWolfgang Walther 923a271105 chore(deps): Update stackage snapshot to lts-22.20
The freebsd build is kept at 21.7 / GHC 9.4.5, because no newer GHC
versioin is supported here.
2024-05-13 08:08:18 +02:00
Wolfgang Walther b8fe512def ci: Avoid trying to upload loadtest reports for tag pipelines
In this case the loadtest doesn't run anymore, so the job would fail.
2024-05-12 15:28:13 +02:00
Wolfgang Walther 271b3b273d ci: Disable tagging releases in forks 2024-05-12 15:10:28 +02:00
Wolfgang Walther 5c040e74f5 ci: Prevent running check, docs and test suites on tags
This doesn't make sense, because each tag is only pushed when those
pipelines have already passed. Thus, we can save time and avoid wasting
resources and don't run those again.
2024-05-12 15:01:20 +02:00
Wolfgang Walther 4a3fdc175c ci: Skip release jobs on outdated tags
This happens a commit is pushed to main while the pipelines have not
finished for the previous commit. In this case the devel-tag pipelines
will run concurrently, leading to unpredictable results for the devel
release.
2024-05-12 14:58:27 +02:00
Wolfgang Walther aef29d49ba docs: Mark db_tx_end as db-configurable 2024-05-12 11:53:59 +02:00
Wolfgang Walther c6f152f5b4 refactor: Remove left-over raw_media_types from Database.hs
This was removed in #2825.
2024-05-12 11:53:45 +02:00
Wolfgang WaltherandWolfgang Walther 71885bdba6 test: Avoid freeport() collisions in io tests
It's very unlikely, but it can (and did) happen that both the server and
admin ports have the same number returned from freeport(). This then
leads to a situation where PostgREST will accept the same port in both
cases, because the host "localhost" will allow binding to ipv4 or ipv6
respectively. This will make the IO tests fail.

This change makes sure that the admin port will never be the same as the
server port and thus avoids this problem.
2024-05-12 11:45:06 +02:00
Wolfgang WaltherandWolfgang Walther 8392357863 test: Fix internal_schema_cache_sleep after 747c78f6
The $subject commit broke internal_schema_cache_sleep for other tests.
This reverts the order change, but keeps the scaling by x1000 to ms and
thus changes other users of this setting to the new scale.
2024-05-12 11:44:43 +02:00
Wolfgang Walther 07222cff7b chore: Restrict macos to v12 2024-05-10 08:19:29 +02:00
Wolfgang Walther d03b321659 ci: Actually pass GHC_VERSION to arm build script 2024-05-09 21:58:37 +02:00
Wolfgang Walther 5580fe0040 ci: Make arm scripts fail on error 2024-05-09 21:46:10 +02:00
Wolfgang Walther 7d713b8c53 ci: Tag arm docker image properly for releases 2024-05-09 21:46:10 +02:00
Wolfgang Walther 2cb45bd5f8 ci: Extract changelog properly for releases 2024-05-09 21:46:10 +02:00
Wolfgang Walther 1fa35cb3b8 test: Fix coverage & style check from c4295b3d 2024-05-09 18:50:00 +02:00
Wolfgang Walther 01a56db7d8 test: Make unicode insert test work in parallel mode
Changing the PK here will avoid duplicate conflicts with another test.

References #1799
2024-05-09 18:05:44 +02:00
Wolfgang Walther 577a7c7598 test: Move limited delete/update tests into separate spec file
This potentially allows to run the remaining tests in those files in
parallel mode.

References #1799
2024-05-09 18:05:44 +02:00
Wolfgang Walther c4295b3d63 test: Make PgSafeUpdateSpec parallel-ready 2024-05-09 18:05:44 +02:00
Wolfgang Walther aa94e436fa test: Missing space 2024-05-09 18:05:44 +02:00
Wolfgang Walther cf7a789e9e test: Improve failing test output for requestMutation 2024-05-09 18:05:44 +02:00
Wolfgang Walther a7ed5db78a test: Sort test suites in spec/Main.hs 2024-05-09 18:05:44 +02:00
Wolfgang WaltherandWolfgang Walther d903a8a115 nix: Adjust postgrest-release to new release workflow
This changes the postgrest-release tool to work with our new workflow.
It can be run on main and the v* release branches. When on a release
branch, it will bump a patch version and push to that branch only.

When on main, it will bump a minor version by default. To bump a major
version, pass --major. This first bump will be force-pushed to the
v<major> branch. A second bump to the current development version will
then be pushed to the main branch.

The tool will not tag commits anymore - this happens in CI
automatically.

References #3113
Resolves #3082
2024-05-09 18:05:04 +02:00
Wolfgang Walther a427fb67f6 ci: Fetch tags before checking whether tag exists 2024-05-09 14:53:38 +02:00
Wolfgang Walther 3afa5f6a36 ci: Move docker-hub-readme.md to base folder
This is not related to nix tooling anymore, because a github action
without any nix tooling is updating this now.
2024-05-09 14:35:52 +02:00
Wolfgang WaltherandWolfgang Walther 747c78f6f4 test: Prevent test_admin_ready_includes_schema_cache_state from timing out
By increasing the delays in this test by factor 400x, postgrest will not
swamp pg with connection retries after the failed schema cache anymore.

This would happen because there is no backoff included after fatal
errors. Once it does, the io tests hang indefinitely in CI.
2024-05-09 13:36:03 +02:00
Wolfgang WaltherandWolfgang Walther e96e16fa27 test: Reset statement timeout after each test
The statement timeout needs to be cleaned up after each test that
modifies it instead of before the test. Otherwise the changed timeout
leaks into other tests.
2024-05-09 13:36:03 +02:00
Wolfgang WaltherandWolfgang Walther 1374178f27 ci: Improve performance for nix jobs in CI
Defaulting to max-jobs = auto should improve build times by using more
cores.

Setting always-allow-substitutes to true should cause all nix
derivations to be cached on cachix, which should improve performance of
the MacOS job dramatically, when no rebuilds need to happen.
2024-05-07 14:42:12 +02:00
Wolfgang Walther cb6151eb1b ci: Make artifact-from-cirrus action succeed when cirrus job doesn't start up in PR 2024-05-07 08:29:31 +02:00
Wolfgang Walther b006016d07 ci: Make "release / tag" job detect existing tags
The release / tag job has logic to decide whether to push a new tag on
stable branches, which depends on the all the tags being fetched. The
checkout action doesn't do that by default, so enable that.
2024-05-07 08:09:00 +02:00
Wolfgang Walther 463dfb552d chore(deps): update actions/checkout hash for release/prepare job
Accidentally committed an outdated version, this aligns it with all the
other references to the same action.
2024-05-05 17:48:44 +02:00
Wolfgang Walther a57d12b102 ci: Use the new DOCKER_ vars for docker-arm job 2024-05-05 17:11:22 +02:00
Wolfgang Walther d9ba9a8208 ci: Avoid devel release failure when no assets to clean up exist 2024-05-05 14:35:40 +02:00
Wolfgang Walther 8433f9812b ci: Replace assets of existing devel release properly 2024-05-05 13:38:58 +02:00
Wolfgang Walther c67f1c398c ci: Fix docker release job after 2f98d837 2024-05-05 13:33:48 +02:00
Wolfgang Walther 2f98d837ff ci: Push docker hub description automatically on main branch 2024-05-04 21:55:52 +02:00
Wolfgang Walther eec35d4569 ci: Avoid recreating devel release
Instead, the existing release is edited, which avoids notifications
for pre-releases.
2024-05-04 21:54:46 +02:00
Wolfgang Walther 9fe90bf9a8 ci: Fix pushing of devel-arm docker tag 2024-05-04 21:53:36 +02:00
Wolfgang Walther 58d8133454 ci: Enable docker push for releases 2024-05-04 21:14:40 +02:00
Wolfgang Walther fe0f2f708a ci: Use "devel" as the pre-release name instead of the commit title 2024-05-04 21:14:23 +02:00
Wolfgang WaltherandWolfgang Walther dd8d51ab71 ci: Automate patch releases and pre-releases
This work by automatically pushing a new tag on main and release
branches after each commit. The tag will be "devel" on main and the
version from postgrest.cabal for release branches. The release
workflow then runs as a tag pipeline, making the actual release.

For release branches, the tag will only be created if a tag for this
version doesn't exist, yet. This means to actually make a new patch
release, we still need to bump the version in postgrest.cabal. We
can automate this later as part of our backport-bot.

Resolves #2006
Resolves #2997
2024-05-04 20:42:45 +02:00
Wolfgang Walther cdcab34852 nix: Make postgrest-lint fail on dead nix code 2024-05-04 20:34:59 +02:00
Wolfgang Walther 1ca2d1f8be ci: Refactor get_cirrusci_freebsd script to GitHub action
This should make it more reliable and also easier to re-use, if we need
to.

Resolves #2555
2024-05-04 14:56:57 +02:00
Wolfgang Walther 5aa62d944d ci: Force running FreeBSD build in tag and push pipelines
This now behaves similar to other CI build jobs, which always run on the
main branches, but only conditionally on PRs, depending on which files
changed.
2024-05-04 14:56:57 +02:00
Wolfgang Walther 6858693291 ci: Be explicit about the version of linux and windows runner images
Using the -latest tag is potentially prone to errors, because an update of the tag
could break our CI. This recently happend with macos-latest, which we downgraded
to macos-12 earlier.

Using an explicit version reference makes this problem much less likely - in fact
renovate will pick up new versions once they exist and will suggest updates for it.
Thus, we will see the failures in a related PR instead of randomly everywhere.
2024-04-22 21:20:30 +02:00
Wolfgang WaltherandWolfgang Walther 81ceac8ba3 ci: revert to macos-12
GitHub Actions updated the latest macos image to macos-14 [1], which made both
of our macos build jobs fail.

This reverts to macos-12, which should fix CI for the moment. We can then look
into migrating to macos-14 explicitly.

[1]: https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
2024-04-22 21:11:03 +02:00
Wolfgang WaltherandWolfgang Walther 80f83f0366 nix: Update to latest nixpkgs#master 2024-04-20 17:06:29 +02:00
Wolfgang WaltherandWolfgang Walther b6a50ab8ed nix: Allow changing to a fork in nixpkgs-version.nix 2024-04-20 17:06:29 +02:00
Wolfgang Walther 87a463f857 test: fix broken io tests after last commit
Forgot to update the snapshots.
2024-04-20 16:03:53 +02:00
Wolfgang Walther ed407350ad fix: hoist function settings with memory units properly
f9ee1f7e introduced the hoisting of function settings as transaction-scoped
settings. However, this currently doesn't work with memory units, which are
case-sensitive according to the docs [1]. This removes the lowercasing of
values to make them work.

This is not added to the CHANGELOG, because this feature was not released, yet.

[1]: https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-NAMES-VALUES
2024-04-20 13:58:04 +02:00
Wolfgang Walther 07dc37e66f chore: limit docutils to <0.21.0
sphinx-rtd-theme currently does not support docutils 0.21.x.

This restriction can be lifted once the upstream issue has been resolved:
https://github.com/readthedocs/sphinx_rtd_theme/issues/1557
2024-04-20 12:38:24 +02:00
Wolfgang Walther 6de3ba543d nix: Use minimal set of texlive dependencies for docs-render 2024-03-31 22:05:02 +02:00
Wolfgang Walther ee359192fa ci: Fix duplicated version number for actions/cache 2024-03-19 21:57:30 +01:00
Wolfgang Walther d5cb6b57ea chore: Prevent unnecessary rebases for renovate PRs
This saves a few CI cycles.
2024-03-01 08:57:47 +01:00
Wolfgang Walther f72b47c485 chore: Add full semver comment to used actions 2024-03-01 08:54:27 +01:00
Wolfgang WaltherandWolfgang Walther 29ffb9329b ci: Build on FreeBSD only when build workflow runs
This prevents running the freebsd build when only tests or docs change.
2024-02-29 21:27:05 +01:00
Wolfgang Walther a1480c758e ci: Run postgrest-test-doctests without nix-shell
Resolves #3183
2024-02-27 10:02:42 +01:00
Wolfgang Walther 629ace0103 ci: Replace actions cache for macos build job with smart cachix lookup 2024-02-26 22:06:01 +01:00
Wolfgang Walther 73199127bb chore: Remove cabal.project.non-nix
We don't have any source-repository-package stanzas in there anymore, so there's no
need to keep it around anymore.
2024-02-26 22:06:01 +01:00
Wolfgang Walther a090f28cea ci: Install only the required nix tools
A previous commit allowed to select each tool separately on the toolbox.

This commit makes use of that for CI to possibly speed up loading from cachix
a little bit. It will also cause fewer cache misses when nix code is changed.

Resolves #3183
2024-02-26 22:06:01 +01:00
Wolfgang Walther c7eb4036a1 nix: Export all tools on each toolbox
This allows targeting each tool separately for installs.
2024-02-26 22:06:01 +01:00
Wolfgang Walther 08901323a3 nix: Move parallelCurl to devTools
This is not a with-tool, because it doesn't wrap another command.
2024-02-26 22:06:01 +01:00
Wolfgang Walther 1db6c04a28 ci: Remove unused .github/release script 2024-02-26 22:06:01 +01:00
Wolfgang Walther e70f001cfc ci: Remove matrix build for GHC 9.4.8 via Cabal on Linux
This is to reduce storage requirements for GitHub Actions cache. We already build with GHC 9.4.x
via Nix on Linux x64, via stack on FreeBSD, MacOS and Windows and via Cabal on Linux ARM. That
should cover 9.4.x enough.
2024-02-26 22:06:01 +01:00
Wolfgang Walther 3b497a5db4 ci: Remove useless cache- prefix for cache names
This just makes the name longer than needed.
2024-02-26 22:06:01 +01:00
Wolfgang Walther e5aee49891 ci: Prevent Upload Reports job from running on release branches
This won't work, since the workflows on the backbranches are structured differently
and thus the job can't find the loadtest.md file anywhere.
2024-02-24 23:33:25 +01:00
Wolfgang WaltherandWolfgang Walther d6153be67a ci: Split Lint & Style from Test workflow
The Lint & Style job needs to run on all PRs, not only when something "test" related
changes. Otherwise not all workflow, nix or other files are style-checked and linted.
2024-02-24 20:38:25 +01:00
Wolfgang WaltherandWolfgang Walther 11accb760a ci: Pass cachix token to all nix jobs 2024-02-24 19:59:46 +01:00
Wolfgang WaltherandWolfgang Walther 44e041282c ci: Switch action-get-latest-tag to github-action-get-previous-tag
The former is not maintained anymore and produces deprecation warnings in CI.
2024-02-24 19:59:46 +01:00
Wolfgang WaltherandWolfgang Walther 79e172a65c ci: Fix failing Upload Reports job 2024-02-24 17:27:01 +01:00
Wolfgang WaltherandWolfgang Walther b49e3b1e5b ci: Only run ARM-related jobs if related settings are present
This allows CI to properly run through in a fork, which doesn't have the SSH_ARM_xxx settings.
2024-02-24 17:27:01 +01:00
Wolfgang Walther 6caaee777b nix: Simplify static.nix
The enable-executable-static flag is set by default, so doesn't make a difference.

The pkg-config improvement for libpq was merged upstream, so we can use the same
here already.
2024-02-24 15:38:02 +01:00
Wolfgang Walther 86b2e59f6f chore: Add tested-with field to postgrest.cabal
This documents supported GHC versions. GHC 9.8.1 is currently commented
out to reflect the fact that PostgREST can't currently be built with it
straight from hackage - we still require some overrides in cabal.project
for that.
2024-02-24 14:07:55 +01:00
Wolfgang Walther 0738785d72 test: Improve dump-schema snapshot test formatting
Splitting the output into separate files and adding top-level newlines makes this
much better to read and understand when looking at diffs.

Inspired by #1699
2024-02-24 14:01:19 +01:00
Wolfgang WaltherandWolfgang Walther 2c2513b9cd deps: Use libpq v16 for freebsd build 2024-02-24 13:46:05 +01:00
Wolfgang WaltherandWolfgang Walther 9314dede2d ci: Build with GHC 9.8.2 2024-02-24 13:37:24 +01:00
Wolfgang Walther ccc386cf38 nix: Add deadnix to postgrest-lint and remove dead nix code 2024-02-24 13:08:04 +01:00
Wolfgang Walther caf0a70171 nix: Clarify pkg-config usage in static.nix a bit
This will make it easier to make the switch from pkgsCross.libpq to pkgsStatic.libpq,
once that is possible to build upstream - if ever.
2024-02-24 12:08:40 +01:00