Skip to content

Commit 9b74205

Browse files
authored
Merge branch 'alpha' into snyk-upgrade-c97562de90cebc943957a538dd01b70b
2 parents 03b1712 + 2830021 commit 9b74205

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2767
-1752
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,17 @@ jobs:
187187
- name: PostgreSQL 11, PostGIS 3.1
188188
POSTGRES_IMAGE: postgis/postgis:11-3.1
189189
NODE_VERSION: 16.13.0
190-
- name: PostgreSQL 12, PostGIS 3.1
191-
POSTGRES_IMAGE: postgis/postgis:12-3.1
190+
- name: PostgreSQL 11, PostGIS 3.2
191+
POSTGRES_IMAGE: postgis/postgis:11-3.2
192192
NODE_VERSION: 16.13.0
193-
- name: PostgreSQL 13, PostGIS 3.1
194-
POSTGRES_IMAGE: postgis/postgis:13-3.1
193+
- name: PostgreSQL 12, PostGIS 3.2
194+
POSTGRES_IMAGE: postgis/postgis:12-3.2
195195
NODE_VERSION: 16.13.0
196-
- name: PostgreSQL 14, PostGIS 3.1
197-
POSTGRES_IMAGE: postgis/postgis:14-3.1
196+
- name: PostgreSQL 13, PostGIS 3.2
197+
POSTGRES_IMAGE: postgis/postgis:13-3.2
198+
NODE_VERSION: 16.13.0
199+
- name: PostgreSQL 14, PostGIS 3.2
200+
POSTGRES_IMAGE: postgis/postgis:14-3.2
198201
NODE_VERSION: 16.13.0
199202
fail-fast: false
200203
name: ${{ matrix.name }}

.github/workflows/release-automated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- run: npx semantic-release
3131
env:
3232
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
3434
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3535
- name: Determine tag on current commit
3636
id: tag

.madgerc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"detectiveOptions": {
3+
"ts": {
4+
"skipTypeImports": true
5+
},
6+
"es6": {
7+
"skipTypeImports": true
8+
}
9+
}
10+
}

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Details:
4242
- Suitable environment: experimental
4343

4444

45-
[log_release]: https://github.com/parse-community/parse-server/blob/release/CHANGELOG.md
46-
<!--[log_release]: https://github.com/parse-community/parse-server/blob/release/changelogs/CHANGELOG_release.md -->
45+
[log_release]: https://github.com/parse-community/parse-server/blob/release/changelogs/CHANGELOG_release.md
4746
[log_beta]: https://github.com/parse-community/parse-server/blob/beta/changelogs/CHANGELOG_beta.md
4847
[log_alpha]: https://github.com/parse-community/parse-server/blob/alpha/changelogs/CHANGELOG_alpha.md
4948
[branch_release]: https://github.com/parse-community/parse-server/tree/release

CONTRIBUTING.md

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
- [Pull Request](#pull-request)
2323
- [Breaking Change](#breaking-change)
2424
- [Merging](#merging)
25+
- [Breaking Change](#breaking-change-1)
26+
- [Reverting](#reverting)
27+
- [Major Release / Long-Term-Support](#major-release--long-term-support)
2528
- [Versioning](#versioning)
2629
- [Code of Conduct](#code-of-conduct)
2730

@@ -154,15 +157,15 @@ If your pull request introduces a change that may affect the storage or retrieva
154157
[PostGIS images (select one with v2.2 or higher) on docker dashboard](https://hub.docker.com/r/postgis/postgis) is based off of the official [postgres](https://registry.hub.docker.com/_/postgres/) image and will work out-of-the-box (as long as you create a user with the necessary extensions for each of your Parse databases; see below). To launch the compatible Postgres instance, copy and paste the following line into your shell:
155158

156159
```
157-
docker run -d --name parse-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password --rm postgis/postgis:13-3.1-alpine && sleep 20 && docker exec -it parse-postgres psql -U postgres -c 'CREATE DATABASE parse_server_postgres_adapter_test_database;' && docker exec -it parse-postgres psql -U postgres -c 'CREATE EXTENSION pgcrypto; CREATE EXTENSION postgis;' -d parse_server_postgres_adapter_test_database && docker exec -it parse-postgres psql -U postgres -c 'CREATE EXTENSION postgis_topology;' -d parse_server_postgres_adapter_test_database
160+
docker run -d --name parse-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password --rm postgis/postgis:13-3.2-alpine && sleep 20 && docker exec -it parse-postgres psql -U postgres -c 'CREATE DATABASE parse_server_postgres_adapter_test_database;' && docker exec -it parse-postgres psql -U postgres -c 'CREATE EXTENSION pgcrypto; CREATE EXTENSION postgis;' -d parse_server_postgres_adapter_test_database && docker exec -it parse-postgres psql -U postgres -c 'CREATE EXTENSION postgis_topology;' -d parse_server_postgres_adapter_test_database
158161
```
159162
To stop the Postgres instance:
160163

161164
```
162165
docker stop parse-postgres
163166
```
164167

165-
You can also use the [postgis/postgis:13-3.1-alpine](https://hub.docker.com/r/postgis/postgis) image in a Dockerfile and copy this [script](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) to the image by adding the following lines:
168+
You can also use the [postgis/postgis:13-3.2-alpine](https://hub.docker.com/r/postgis/postgis) image in a Dockerfile and copy this [script](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) to the image by adding the following lines:
166169

167170
```
168171
#Install additional scripts. These are run in abc order during initial start
@@ -303,7 +306,7 @@ For release automation, the title of pull requests needs to be written in a defi
303306
```
304307

305308
The _type_ is the category of change that is made, possible types are:
306-
- `feat` - add a new feature
309+
- `feat` - add a new feature or improve an existing feature
307310
- `fix` - fix a bug
308311
- `refactor` - refactor code without impact on features or performance
309312
- `docs` - add or edit code comments, documentation, GitHub pages
@@ -335,17 +338,63 @@ If a pull request contains a braking change, the description of the pull request
335338

336339
The following guide is for anyone who merges a contributor pull request into the working branch, the working branch into a release branch, a release branch into another release branch, or any other direct commits such as hotfixes into release branches or the working branch.
337340

338-
- For changelog generation, only the commit message set when merging the pull request is relevant. The title and description of the GitHub pull request as authored by the contributor have no influence on the changelog generation. However, the title of the GitHub pull request should be used as the commit message.
339-
- If the pull request contains a breaking change, the commit message must contain the phrase `BREAKING CHANGE`, capitalized and without any formatting, followed by a short description of the breaking change and ideally how the developer should address it, all in a single line. This line should contain more details focusing on the "breaking” aspect of the change and is intended to assist the developer in adapting. Keep it concise, as it will become part of the changelog entry, for example:
341+
- A contributor pull request must be merged into the working branch using `Squash and Merge`, to create a single commit message that describes the change.
342+
- A release branch or the default branch must be merged into another release branch using `Merge Commit`, to preserve each individual commit message that describes its respective change.
343+
- For changelog generation, only the commit message set when merging the pull request is relevant. The title and description of the GitHub pull request as authored by the contributor have no influence on the changelog generation. However, the title of the GitHub pull request should be used as the commit message. See the following chapters for considerations in special scenarios, e.g. merging a breaking change or reverting a commit.
344+
345+
### Breaking Change
346+
347+
If the pull request contains a breaking change, the commit message must contain the phrase `BREAKING CHANGE`, capitalized and without any formatting, followed by a short description of the breaking change and ideally how the developer should address it, all in a single line. This line should contain more details focusing on the "breaking” aspect of the change and is intended to assist the developer in adapting. Keep it concise, as it will become part of the changelog entry, for example:
340348
341349
```
342350
fix: remove handle from door
343351
344352
BREAKING CHANGE: You cannot open the door anymore by using a handle. See the [#migration guide](http://example.com) for more details.
345353
```
346354
Keep in mind that in a repository with release automation, merging such a commit message will trigger a release with a major version increment.
347-
- A contributor pull request must be merged into the working branch using `Squash and Merge`, to create a single commit message that describes the change.
348-
- A release branch or the default branch must be merged into another release branch using `Merge Commit`, to preserve each individual commit message that describes its respective change.
355+
356+
### Reverting
357+
358+
If the commit reverts a previous commit, use the prefix `revert:`, followed by the header of the reverted commit. In the body of the commit message add `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted. For example:
359+
360+
```
361+
revert: fix: remove handle from door
362+
363+
This reverts commit 1234567890abcdef.
364+
```
365+
366+
⚠️ A `revert` prefix will *always* trigger a release. Generally, a commit that did not trigger a release when it was initially merged should also not trigger a release when it is reverted. For example, do not use the `revert` prefix when reverting a commit that has a `ci` prefix:
367+
368+
```
369+
ci: add something
370+
```
371+
is reverted with:
372+
```
373+
ci: remove something
374+
```
375+
instead of:
376+
```
377+
revert: ci: add something
378+
379+
This reverts commit 1234567890abcdef.
380+
```
381+
382+
### Major Release / Long-Term-Support
383+
384+
Long-Term-Support (LTS) is provided for the previous Parse Server major version. For example, Parse Server 4.x will receive security updates until Parse Server 5.x is superseded by Parse Server 6.x and becomes the new LTS version. While the current major version is published on branch `release`, a LTS version is published on branch `release-#.x.x`, for example `release-4.x.x` for the Parse Server 4.x LTS branch.
385+
386+
#### Preparing Release
387+
388+
The following changes are done in the `alpha` branch, before publishing the last `beta` version that will eventually become the major release. This way the changes trickle naturally through all branches and code consistency is ensured among branches.
389+
390+
- Make sure all [deprecations](https://github.com/parse-community/parse-server/blob/alpha/DEPRECATIONS.md) are reflected in code, old code is removed and the deprecations table is updated.
391+
- Add the future LTS branch `release-#.x.x` to the branch list in [release.config.js](https://github.com/parse-community/parse-server/blob/alpha/release.config.js) so that the branch will later be recognized for release automation.
392+
393+
#### Publishing Release
394+
395+
1. Create LTS branch `release-#.x.x` off the latest version tag on `release` branch.
396+
2. Create temporary branch `build-release` off branch `beta` and create a pull request with `release` as the base branch.
397+
3. Merge branch `build-release` into `release`. Given that there will be breaking changes, a new major release will be created. In the unlikely case that there have been no breaking changes between the previous major release and the upcoming release, a major version increment has to be triggered manually. See the docs of the release automation framework for how to do that.
349398
350399
## Versioning
351400

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ Parse Server is continuously tested with the most recent releases of PostgreSQL
134134

135135
| Version | PostGIS Version | End-of-Life | Parse Server Support End | Compatible |
136136
|-------------|-----------------|---------------|--------------------------|------------|
137-
| Postgres 11 | 3.0, 3.1 | November 2023 | April 2022 | ✅ Yes |
138-
| Postgres 12 | 3.1 | November 2024 | April 2023 | ✅ Yes |
139-
| Postgres 13 | 3.1 | November 2025 | April 2024 | ✅ Yes |
140-
| Postgres 14 | 3.1 | November 2026 | April 2025 | ✅ Yes |
137+
| Postgres 11 | 3.0, 3.1, 3.2 | November 2023 | April 2022 | ✅ Yes |
138+
| Postgres 12 | 3.2 | November 2024 | April 2023 | ✅ Yes |
139+
| Postgres 13 | 3.2 | November 2025 | April 2024 | ✅ Yes |
140+
| Postgres 14 | 3.2 | November 2026 | April 2025 | ✅ Yes |
141141

142142
### Locally
143143
```bash
@@ -525,9 +525,26 @@ let api = new ParseServer({
525525
| `idempotencyOptions.paths` | yes | `Array<String>` | `[]` | `.*` (all paths, includes the examples below), <br>`functions/.*` (all functions), <br>`jobs/.*` (all jobs), <br>`classes/.*` (all classes), <br>`functions/.*` (all functions), <br>`users` (user creation / update), <br>`installations` (installation creation / update) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS | An array of path patterns that have to match the request path for request deduplication to be enabled. The mount path must not be included, for example to match the request path `/parse/functions/myFunction` specify the path pattern `functions/myFunction`. A trailing slash of the request path is ignored, for example the path pattern `functions/myFunction` matches both `/parse/functions/myFunction` and `/parse/functions/myFunction/`. |
526526
| `idempotencyOptions.ttl` | yes | `Integer` | `300` | `60` (60 seconds) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL | The duration in seconds after which a request record is discarded from the database. Duplicate requests due to network issues can be expected to arrive within milliseconds up to several seconds. This value must be greater than `0`. |
527527
528-
### Notes <!-- omit in toc -->
528+
### Postgres <!-- omit in toc -->
529+
530+
To use this feature in Postgres, you will need to create a cron job using [pgAdmin](https://www.pgadmin.org/docs/pgadmin4/development/pgagent_jobs.html) or similar to call the Postgres function `idempotency_delete_expired_records()` that deletes expired idempotency records. You can find an example script below. Make sure the script has the same privileges to log into Postgres as Parse Server.
531+
532+
```bash
533+
#!/bin/bash
534+
535+
set -e
536+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
537+
SELECT idempotency_delete_expired_records();
538+
EOSQL
529539
530-
- This feature is currently only available for MongoDB and not for Postgres.
540+
exec "$@"
541+
```
542+
543+
Assuming the script above is named, `parse_idempotency_delete_expired_records.sh`, a cron job that runs the script every 2 minutes may look like:
544+
545+
```bash
546+
2 * * * * /root/parse_idempotency_delete_expired_records.sh >/dev/null 2>&1
547+
```
531548
532549
## Localization
533550

0 commit comments

Comments
 (0)