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 Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang Walther
80f83f0366
nix: Update to latest nixpkgs#master
2024-04-20 17:06:29 +02:00
Wolfgang Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang 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 Walther and Wolfgang Walther
11accb760a
ci: Pass cachix token to all nix jobs
2024-02-24 19:59:46 +01:00
Wolfgang Walther and Wolfgang 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 Walther and Wolfgang Walther
79e172a65c
ci: Fix failing Upload Reports job
2024-02-24 17:27:01 +01:00
Wolfgang Walther and Wolfgang 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 Walther and Wolfgang Walther
2c2513b9cd
deps: Use libpq v16 for freebsd build
2024-02-24 13:46:05 +01:00
Wolfgang Walther and Wolfgang 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
Wolfgang Walther
22e8906c40
nix: Run faster tasks first in postgrest-lint
...
This avoid long waiting times when waiting for the result of shellcheck or actionlint.
2024-02-23 14:02:05 +01:00
Wolfgang Walther and Wolfgang Walther
0b3f6de015
ci: Merge docs-spellcheck and docs-dictcheck jobs
...
Both jobs run really quick, running them separate is just a waste of resources. Plus,
they are semantically closely related anyway.
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
c59736b902
ci: Rename release jobs for consistency
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
19423b0c0a
ci: Only run PR workflows when files have changed
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
e9abb64fc0
ci: Split Build workflow from CI workflow
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
57ef98a316
ci: Split Test workflow from CI workflow
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
31a3864f85
ci: Remove files from arm server immediately on non-release push
...
While this duplicates code a little bit, it makes it much simpler to refactor later on.
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
073280ad32
ci: Require docs job to pass before making a release
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
333f8cf592
ci: Cancel all workflows consistently in pull requests without blocking main
...
The previous setup would cause multiple commits on main to be stuck in a pending
state, waiting for the previous run to be finished.
The new group specification is taken from:
https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
This also adds the same settings for the docs workflow.
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
f9fdf666ad
ci: Use if without ${{ }} where possible
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
c54e0d3353
ci: Use actions/download-artifact instead of dawidd6/action-download-artifact
...
The "default" action now supports downloading from different workflow runs, too, so
we might as well use it.
2024-02-22 20:12:18 +01:00
Wolfgang Walther and Wolfgang Walther
1a141c19df
nix: Add postgrest-docs-render to render latex documents
2024-02-21 09:40:11 +01:00
Wolfgang Walther and Wolfgang Walther
b8f35d880f
docs: Fix broken redirects in api.rst
2024-02-21 09:40:11 +01:00
Wolfgang Walther and Wolfgang Walther
791b86cbf6
docs: Add note about not support Stored Procedures
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/147
2024-02-21 09:40:11 +01:00
Wolfgang Walther and Wolfgang Walther
944b02fbb8
docs: Rename Stored Procedures to Functions consistently
...
This avoids confusing our RPCs with actual CREATE PROCEDURE, which we don't
support.
References https://github.com/PostgREST/postgrest-docs/issues/147
2024-02-21 09:40:11 +01:00
Wolfgang Walther and Wolfgang Walther
95b8751496
docs: Simplify SQL for user management how-tos
...
All those DROP IF EXISTS and CREATE IF NOT EXISTS etc. just give a lot more text to
read and understand. If in fact a user creates the same thing twice, they should be
able to understand the error message from postgres.
2024-02-21 09:40:11 +01:00
Wolfgang Walther and Wolfgang Walther
9b1ff2235a
docs: Simplify auth examples with OUT parameter
...
The jwt_token type was not created consistently in all examples, which can
be confusing when following those. To return an object with a single key
named token, it's enough to have an OUT parameter to the function.
Resolves https://github.com/PostgREST/postgrest-docs/issues/280
2024-02-21 09:40:11 +01:00
Wolfgang Walther and Wolfgang Walther
8a21a9c34e
fix: Dump media handlers and timezones with --dump-schema
...
Those were left out of the schema dump when the features were introduced, probably
because ByteString doesn't have a toJSON instance. Changing the type to Text solves
this easily.
Resolves #3237
2024-02-20 18:44:17 +01:00
Wolfgang Walther and Wolfgang Walther
fac7acafa3
chore: Add docs/_build to .gitignore again to allow switching to old release branches easily
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
645217333b
docs: Display version number more prominently
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/734
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
fcd29caecf
docs: Use code-block postgres consistently
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
553ac79d9b
docs: Add example on how to automatically store mimetype in files table
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/612
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
b2ad914435
docs: Improve introduction for datatypes how-to
...
Not all examples on this page are strictly using string representation, especially bytea.
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
8ee4e9f0bb
docs: Sort datatypes how-to alphabetically
...
The examples in this sections were in seemingly random order before.
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
8f2b6b1652
docs: Add hint about schema reloading with db-config=true
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/490
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
b1deb049c8
docs: Clarify behavior of jwt-aud and tokens without aud claim
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/479
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
51db5ce26f
docs: Add example for ordering by json field
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/364
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
e7dde2806c
docs: Change tutorials to use identity column instead of serial/sequence
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/311
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
4325a4f9d5
docs: Add links to resource embedding from insert/update/delete sections
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/277
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
77715dcabf
docs: Rename remaining instances of computed columns to computed fields
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/368
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
aaaf0572ce
docs: Remove deprecated auth0 features
...
As mentioned in https://github.com/PostgREST/postgrest/discussions/3088 rules and hooks are not
available to new tenants anymore, so the note is not helpful anymore.
Resolves #3088
Resolves https://github.com/PostgREST/postgrest-docs/issues/85
Resolves https://github.com/PostgREST/postgrest-docs/issues/715
2024-02-19 21:54:15 +01:00
Wolfgang Walther and Wolfgang Walther
500aad3360
docs: Clarify secret wording in tutorial 1
...
Resolves https://github.com/PostgREST/postgrest-docs/issues/108
2024-02-19 21:54:15 +01:00