Skip to content

Commit 3ff82c8

Browse files
committed
Merge commit '7f47b0427ea56214d9b0199f0fcfa4af38794e02'
* commit '7f47b0427ea56214d9b0199f0fcfa4af38794e02': Add page localization (parse-community#7128) Improve contribution guide (parse-community#7075) fix: upgrade pg-promise from 10.9.0 to 10.9.1 (parse-community#7170) Add tests against multiple MongoDB versions (parse-community#7161) fix: upgrade mime from 2.4.7 to 2.5.0 (parse-community#7166) fix: upgrade pg-promise from 10.8.7 to 10.9.0 (parse-community#7168) fix: upgrade apollo-server-express from 2.19.1 to 2.19.2 (parse-community#7165) Upgrade @node-rs/bcrypt to latest version (parse-community#7159) Run Prettier after Definitions (parse-community#7164)
2 parents ed2944f + 7f47b04 commit 3ff82c8

Some content is hidden

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

51 files changed

+5097
-3125
lines changed

.github/workflows/ci.yml

+45-6
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,62 @@ env:
1111
NODE_VERSION: 10
1212
PARSE_SERVER_TEST_TIMEOUT: 20000
1313
jobs:
14+
check-ci:
15+
name: CI Self-Check
16+
timeout-minutes: 30
17+
runs-on: ubuntu-18.04
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- name: Cache Node.js modules
25+
uses: actions/cache@v2
26+
with:
27+
path: ~/.npm
28+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
31+
- name: Install dependencies
32+
run: npm ci
33+
- name: CI Self-Check
34+
run: npm run ci:check
1435
check-mongo:
1536
strategy:
1637
matrix:
1738
include:
18-
- name: Mongo 4.0.4, ReplicaSet, WiredTiger
19-
MONGODB_VERSION: 4.0.4
39+
- name: Mongo 4.4, ReplicaSet, WiredTiger
40+
MONGODB_VERSION: 4.4.3
41+
MONGODB_TOPOLOGY: replicaset
42+
MONGODB_STORAGE_ENGINE: wiredTiger
43+
NODE_VERSION: 10
44+
- name: Mongo 4.2, ReplicaSet, WiredTiger
45+
MONGODB_VERSION: 4.2.12
46+
MONGODB_TOPOLOGY: replicaset
47+
MONGODB_STORAGE_ENGINE: wiredTiger
48+
NODE_VERSION: 10
49+
- name: Mongo 4.0, ReplicaSet, WiredTiger
50+
MONGODB_VERSION: 4.0.22
2051
MONGODB_TOPOLOGY: replicaset
2152
MONGODB_STORAGE_ENGINE: wiredTiger
2253
NODE_VERSION: 10
23-
- name: Mongo 3.6.21
24-
MONGODB_VERSION: 3.6.21
54+
- name: Mongo 3.6, Standalone, MMAPv1
55+
MONGODB_VERSION: 3.6.22
56+
MONGODB_TOPOLOGY: standalone
57+
MONGODB_STORAGE_ENGINE: mmapv1
2558
NODE_VERSION: 10
2659
- name: Redis Cache
2760
PARSE_SERVER_TEST_CACHE: redis
61+
MONGODB_VERSION: 4.4.3
62+
MONGODB_TOPOLOGY: standalone
63+
MONGODB_STORAGE_ENGINE: wiredTiger
2864
NODE_VERSION: 10
29-
- name: Node 12.12.0
30-
NODE_VERSION: 12.12.0
65+
- name: Node 12.20
66+
MONGODB_VERSION: 4.4.3
67+
MONGODB_TOPOLOGY: standalone
68+
MONGODB_STORAGE_ENGINE: wiredTiger
69+
NODE_VERSION: 12.20.1
3170
name: ${{ matrix.name }}
3271
timeout-minutes: 30
3372
runs-on: ubuntu-18.04

CHANGELOG.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.5.0...master)
55

66
__BREAKING CHANGES:__
7-
- NEW: Added file upload restriction. File upload is now only allowed for authenticated users by default for improved security. To allow file upload also for Anonymous Users or Public, set the `fileUpload` parameter in the [Parse Server Options](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html). [#7071](https://github.com/parse-community/parse-server/pull/7071). Thanks to [dblythy](https://github.com/dblythy).
7+
- NEW: Added file upload restriction. File upload is now only allowed for authenticated users by default for improved security. To allow file upload also for Anonymous Users or Public, set the `fileUpload` parameter in the [Parse Server Options](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html). [#7071](https://github.com/parse-community/parse-server/pull/7071). Thanks to [dblythy](https://github.com/dblythy), [Manuel Trezza](https://github.com/mtrezza).
88
___
9+
- NEW (EXPERIMENTAL): Added new page router with placeholder rendering and localization of custom and feature pages such as password reset and email verification. **Caution, this is an experimental feature that may not be appropriate for production.** [#6891](https://github.com/parse-community/parse-server/issues/6891). Thanks to [Manuel Trezza](https://github.com/mtrezza).
10+
- NEW: Added convenience method `Parse.Cloud.sendEmail(...)` to send email via email adapter in Cloud Code. [#7089](https://github.com/parse-community/parse-server/pull/7089). Thanks to [dblythy](https://github.com/dblythy)
11+
- NEW: LiveQuery support for $and, $nor, $containedBy, $geoWithin, $geoIntersects queries [#7113](https://github.com/parse-community/parse-server/pull/7113). Thanks to [dplewis](https://github.com/dplewis)
12+
- NEW: Supporting patterns in LiveQuery server's config parameter `classNames` [#7131](https://github.com/parse-community/parse-server/pull/7131). Thanks to [Nes-si](https://github.com/Nes-si)
913
- IMPROVE: Added new account lockout policy option `accountLockout.unlockOnPasswordReset` to automatically unlock account on password reset. [#7146](https://github.com/parse-community/parse-server/pull/7146). Thanks to [Manuel Trezza](https://github.com/mtrezza).
14+
- IMPROVE: Parse Server will from now on be continuously tested against all relevant MongoDB versions (minor versions). Added MongoDB compatibility table to Parse Server docs. [7161](https://github.com/parse-community/parse-server/pull/7161). Thanks to [Manuel Trezza](https://github.com/mtrezza).
1015
- IMPROVE: Optimize queries on classes with pointer permissions. [#7061](https://github.com/parse-community/parse-server/pull/7061). Thanks to [Pedro Diaz](https://github.com/pdiaz)
1116
- FIX: request.context for afterFind triggers. [#7078](https://github.com/parse-community/parse-server/pull/7078). Thanks to [dblythy](https://github.com/dblythy)
12-
- NEW: Added convenience method Parse.Cloud.sendEmail(...) to send email via email adapter in Cloud Code. [#7089](https://github.com/parse-community/parse-server/pull/7089). Thanks to [dblythy](https://github.com/dblythy)
1317
- FIX: Winston Logger interpolating stdout to console [#7114](https://github.com/parse-community/parse-server/pull/7114). Thanks to [dplewis](https://github.com/dplewis)
14-
- NEW: LiveQuery support for $and, $nor, $containedBy, $geoWithin, $geoIntersects queries [#7113](https://github.com/parse-community/parse-server/pull/7113). Thanks to [dplewis](https://github.com/dplewis)
15-
- NEW: Supporting patterns in LiveQuery server's config parameter `classNames` [#7131](https://github.com/parse-community/parse-server/pull/7131). Thanks to [Nes-si](https://github.com/Nes-si)
1618

1719
### 4.5.0
1820
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)

CONTRIBUTING.md

+36-6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ If your pull request introduces a change that may affect the storage or retrieva
7171
- `it_only_db('postgres')` // will make a test that only runs on postgres
7272
- `it_exclude_dbs(['mongo'])` // will make a test that runs against all DB's but mongo
7373

74+
* If your feature is intended to work with MongoDB and PostgreSQL, you can include or exclude tests more granularly with:
75+
76+
- `it_only_mongodb_version('>=4.4')` // will test with any version of Postgres but only with version >=4.4 of MongoDB; accepts semver notation to specify a version range
77+
- `it_exclude_mongodb_version('<4.4')` // will test with any version of Postgres and MongoDB, excluding version <4.4 of MongoDB; accepts semver notation to specify a version range
78+
7479
#### Run Postgres setup for Parse with Docker
7580

7681
[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:
@@ -94,12 +99,6 @@ RUN chmod +x /docker-entrypoint-initdb.d/setup-dbs.sh
9499

95100
Note that the script above will ONLY be executed during initialization of the container with no data in the database, see the official [Postgres image](https://hub.docker.com/_/postgres) for details. If you want to use the script to run again be sure there is no data in the /var/lib/postgresql/data of the container.
96101

97-
### Generate Parse Server Config Definition
98-
99-
If you want to make changes to [Parse Server Configuration][config] add the desired configuration to [src/Options/index.js][config-index] and run `npm run definitions`. This will output [src/Options/Definitions.js][config-def] and [src/Options/docs.js][config-docs].
100-
101-
To view docs run `npm run docs` and check the `/out` directory.
102-
103102
## Feature Considerations
104103
### Security Checks
105104

@@ -111,6 +110,37 @@ For example, allowing public read and write to a class may be useful to simplify
111110

112111
Security checks are added in [SecurityChecks.js](https://github.com/parse-community/parse-server/blob/master/src/SecurityChecks.js).
113112

113+
### Parse Error
114+
115+
Introducing new Parse Errors requires the following steps:
116+
117+
1. Research whether an existing Parse Error already covers the error scenario. Keep in mind that reusing an already existing Parse Error does not allow to distinguish between scenarios in which the same error is thrown, so it may be necessary to add a new and more specific Parse Error, eventhough an more general Parse Error already exists.
118+
⚠️ Currently (as of Dec. 2020), there are inconsistencies between the Parse Errors documented in the Parse Guides, coded in the Parse JS SDK and coded in Parse Server, therefore research regarding the availability of error codes has to be conducted in all of these sources.
119+
1. Add the new Parse Error to [/src/ParseError.js](https://github.com/parse-community/Parse-SDK-JS/blob/master/src/ParseError.js) in the Parse JavaScript SDK. This is the primary reference for Parse Errors for the Parse JavaScript SDK and Parse Server.
120+
1. Create a pull request for the Parse JavaScript SDK including the new Parse Errors. The PR needs to be merged and a new Parse JS SDK version needs to be released.
121+
1. Change the Parse JS SDK dependency in [package.json](https://github.com/parse-community/parse-server/blob/master/package.json) of Parse Server to the newly released Parse JS SDK version, so that the new Parse Error is recognized by Parse Server.
122+
1. When throwing the new Parse Error in code, do not hard-code the error code but instead reference the error code from the Parse Error. For example:
123+
```javascript
124+
throw new Parse.Error(Parse.Error.EXAMPLE_ERROR_CODE, 'Example error message.');
125+
```
126+
1. Choose a descriptive error message that provdes more details about the specific error scenario. Different error messages may be used for the same error code. For example:
127+
```javascript
128+
throw new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'The file could not be saved because it exceeded the maximum allowed file size.');
129+
throw new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'The file could not be saved because the file format was incorrect.');
130+
```
131+
1. Add the new Parse Error to the [docs](https://github.com/parse-community/docs/blob/gh-pages/_includes/common/errors.md).
132+
133+
### Parse Server Configuration
134+
135+
Introducing new [Parse Server configuration][config] parameters requires the following steps:
136+
137+
1. Add parameters definitions in [/src/Options/index.js][config-index].
138+
1. If a nested configuration object has been added, add the environment variable option prefix to `getENVPrefix` in [/resources/buildConfigDefinition.js](https://github.com/parse-community/parse-server/blob/master/resources/buildConfigDefinition.js).
139+
1. Execute `npm run definitions` to automatically create the definitions in [/src/Options/Definitions.js][config-def] and [/src/Options/docs.js][config-docs].
140+
1. Add parameter value validation in [/src/Config.js](https://github.com/parse-community/parse-server/blob/master/src/Config.js).
141+
1. Add test cases to ensure the correct parameter value validation. Parse Server throws an error at launch if an invalid value is set for any configuration parameter.
142+
1. Execute `npm run docs` to generate the documentation in the `/out` directory. Take a look at the documentation whether the description and formatting of the newly introduced parameters is satisfactory.
143+
114144
## Code of Conduct
115145

116146
This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/parse-community/parse-server/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to honor this code.

0 commit comments

Comments
 (0)