Skip to content

Commit 77b2810

Browse files
authored
Merge branch 'master' into fixDockerImage
2 parents ec9aefb + 2b9b336 commit 77b2810

27 files changed

+1400
-513
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ jobs:
3232
run: npm ci
3333
- name: CI Self-Check
3434
run: npm run ci:check
35+
check-lint:
36+
name: Lint
37+
timeout-minutes: 30
38+
runs-on: ubuntu-18.04
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: ${{ matrix.node-version }}
45+
- name: Cache Node.js modules
46+
uses: actions/cache@v2
47+
with:
48+
path: ~/.npm
49+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
50+
restore-keys: |
51+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
52+
- name: Install dependencies
53+
run: npm ci
54+
- run: npm run lint
3555
check-mongo:
3656
strategy:
3757
matrix:
@@ -40,43 +60,43 @@ jobs:
4060
MONGODB_VERSION: 4.4.4
4161
MONGODB_TOPOLOGY: replicaset
4262
MONGODB_STORAGE_ENGINE: wiredTiger
43-
NODE_VERSION: 14.15.5
63+
NODE_VERSION: 14.16.0
4464
- name: Mongo 4.2, ReplicaSet, WiredTiger
4565
MONGODB_VERSION: 4.2.12
4666
MONGODB_TOPOLOGY: replicaset
4767
MONGODB_STORAGE_ENGINE: wiredTiger
48-
NODE_VERSION: 14.15.5
68+
NODE_VERSION: 14.16.0
4969
- name: Mongo 4.0, ReplicaSet, WiredTiger
50-
MONGODB_VERSION: 4.0.22
70+
MONGODB_VERSION: 4.0.23
5171
MONGODB_TOPOLOGY: replicaset
5272
MONGODB_STORAGE_ENGINE: wiredTiger
53-
NODE_VERSION: 14.15.5
73+
NODE_VERSION: 14.16.0
5474
- name: Mongo 3.6, Standalone, MMAPv1
5575
MONGODB_VERSION: 3.6.22
5676
MONGODB_TOPOLOGY: standalone
5777
MONGODB_STORAGE_ENGINE: mmapv1
58-
NODE_VERSION: 14.15.5
78+
NODE_VERSION: 14.16.0
5979
- name: Redis Cache
6080
PARSE_SERVER_TEST_CACHE: redis
6181
MONGODB_VERSION: 4.4.4
6282
MONGODB_TOPOLOGY: standalone
6383
MONGODB_STORAGE_ENGINE: wiredTiger
64-
NODE_VERSION: 14.15.5
84+
NODE_VERSION: 14.16.0
6585
- name: Node 10
6686
MONGODB_VERSION: 4.4.4
6787
MONGODB_TOPOLOGY: standalone
6888
MONGODB_STORAGE_ENGINE: wiredTiger
69-
NODE_VERSION: 10.23.3
89+
NODE_VERSION: 10.24.0
7090
- name: Node 12
7191
MONGODB_VERSION: 4.4.4
7292
MONGODB_TOPOLOGY: standalone
7393
MONGODB_STORAGE_ENGINE: wiredTiger
74-
NODE_VERSION: 12.20.2
94+
NODE_VERSION: 12.21.0
7595
- name: Node 15
7696
MONGODB_VERSION: 4.4.4
7797
MONGODB_TOPOLOGY: standalone
7898
MONGODB_STORAGE_ENGINE: wiredTiger
79-
NODE_VERSION: 15.8.0
99+
NODE_VERSION: 15.10.0
80100
name: ${{ matrix.name }}
81101
timeout-minutes: 30
82102
runs-on: ubuntu-18.04
@@ -106,8 +126,6 @@ jobs:
106126
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
107127
- name: Install dependencies
108128
run: npm ci
109-
- if: ${{ matrix.name == 'Mongo 3.6.21' }}
110-
run: npm run lint
111129
- run: npm run pretest
112130
- run: npm run coverage
113131
env:

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
## Parse Server Changelog
2+
<!--
3+
Please make sure you add your feature at the bottom of the associated group.
4+
Groups should be ordered:
5+
- NEW (EXPERIMENTAL)
6+
- NEW
7+
- IMPROVE
8+
- FIX
9+
Thanks for contributing to Parse Server!
10+
-->
211

312
### master
413
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.5.0...master)
@@ -7,16 +16,22 @@ __BREAKING CHANGES:__
716
- 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).
817
___
918
- FIX: Move graphql-tag from devDependencies to dependencies. [7183](https://github.com/parse-community/parse-server/pull/7183). Thanks to [Antonio Davi Macedo Coelho de Castro](https://github.com/davimacedo).
10-
- UPGRADE: Bump tests to use Mongo 4.4.4 [#7184](https://github.com/parse-community/parse-server/pull/7184). Thanks to [Antonio Davi Macedo Coelho de Castro](https://github.com/davimacedo).
19+
- IMPROVE: Allow Cloud Validator `options` to be async [#7155](https://github.com/parse-community/parse-server/pull/7155). Thanks to [dblythy](https://github.com/dblythy)
1120
- 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).
1221
- 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)
1322
- 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)
1423
- 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)
24+
- NEW: `requireAnyUserRoles` and `requireAllUserRoles` for Parse Cloud validator. [#7097](https://github.com/parse-community/parse-server/pull/7097). Thanks to [dblythy](https://github.com/dblythy)
25+
- NEW: Support Facebook Limited Login [#7219](https://github.com/parse-community/parse-server/pull/7219). Thanks to [miguel-s](https://github.com/miguel-s)
26+
- IMPROVE: Retry transactions on MongoDB when it fails due to transient error [#7187](https://github.com/parse-community/parse-server/pull/7187). Thanks to [Antonio Davi Macedo Coelho de Castro](https://github.com/davimacedo).
27+
- IMPROVE: Bump tests to use Mongo 4.4.4 [#7184](https://github.com/parse-community/parse-server/pull/7184). Thanks to [Antonio Davi Macedo Coelho de Castro](https://github.com/davimacedo).
1528
- 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).
1629
- IMPROVE: Parse Server is from now on continuously tested against all recent MongoDB versions that have not reached their end-of-life support date. 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).
1730
- IMPROVE: Parse Server is from now on continuously tested against all recent Node.js versions that have not reached their end-of-life support date. [7161](https://github.com/parse-community/parse-server/pull/7177). Thanks to [Manuel Trezza](https://github.com/mtrezza).
31+
- IMPROVE: Allow Cloud Validator `options` to be async [#7155](https://github.com/parse-community/parse-server/pull/7155). Thanks to [dblythy](https://github.com/dblythy)
1832
- 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)
1933
- IMPROVE: Parse Server will from now on be continuously tested against all relevant Postgres versions (minor versions). Added Postgres compatibility table to Parse Server docs. [#7176](https://github.com/parse-community/parse-server/pull/7176). Thanks to [Corey Baker](https://github.com/cbaker6).
34+
- FIX: Fix error when a not yet inserted job is updated [#7196](https://github.com/parse-community/parse-server/pull/7196). Thanks to [Antonio Davi Macedo Coelho de Castro](https://github.com/davimacedo).
2035
- FIX: request.context for afterFind triggers. [#7078](https://github.com/parse-community/parse-server/pull/7078). Thanks to [dblythy](https://github.com/dblythy)
2136
- FIX: Winston Logger interpolating stdout to console [#7114](https://github.com/parse-community/parse-server/pull/7114). Thanks to [dplewis](https://github.com/dplewis)
2237

CONTRIBUTING.md

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,65 @@
1-
# Contributing to Parse Server
1+
# Contributing to Parse Server <!-- omit in toc -->
22

3-
We really want Parse to be yours, to see it grow and thrive in the open source community.
3+
## Table of Contents <!-- omit in toc -->
4+
- [Contributing](#contributing)
5+
- [Why Contributing?](#why-contributing)
6+
- [Environment Setup](#environment-setup)
7+
- [Recommended Tools](#recommended-tools)
8+
- [Setting up your local machine](#setting-up-your-local-machine)
9+
- [Good to Know](#good-to-know)
10+
- [Troubleshooting](#troubleshooting)
11+
- [Please Do's](#please-dos)
12+
- [Test against Postgres](#test-against-postgres)
13+
- [Postgres with Docker](#postgres-with-docker)
14+
- [Feature Considerations](#feature-considerations)
15+
- [Security Checks](#security-checks)
16+
- [Parse Error](#parse-error)
17+
- [Parse Server Configuration](#parse-server-configuration)
18+
- [Code of Conduct](#code-of-conduct)
419

5-
Before you jump into the coding element of contributing, please make sure you first [open an issue](https://github.com/parse-community/parse-server/issues/new/choose) relating to your contribution, or continue the discussion in the existing issue.
20+
## Contributing
621

7-
This helps us all plan out the best conceptual approach for the contribution, so that your time isn't wasted on approaches or features that could be tackled in a different way. Our team are also happy to give you pointers and suggestions to speed up the process.
22+
Before you start to code, please open a [new issue](https://github.com/parse-community/parse-server/issues/new/choose) to describe your idea, or search for and continue the discussion in an [existing issue](https://github.com/parse-community/parse-server/issues).
823

9-
When opening an issue, please make sure you follow the templates and provide as much detail as possible.
24+
> ⚠️ Please do not post a security vulnerability on GitHub or in the Parse Community Forum. Instead, follow the [Parse Community Security Policy](https://github.com/parse-community/parse-server/security/policy).
1025
11-
After you've completed the contribution, you'll need to submit a Pull Request (PR).
26+
Please completely fill out any templates to provide essential information about your new feature or the bug you discovered.
1227

13-
If you are not familiar with Pull Requests and want to know more about them, you can visit the [Creating a pull request](https://help.github.com/articles/creating-a-pull-request/) article. It contains detailed informations about the process.
28+
Together we will plan out the best conceptual approach for your contribution, so that your and our time is invested in the best possible approach. The discussion often reveals how to leverage existing features of Parse Server to reach your goal with even less effort and in a more sustainable way.
1429

15-
If you need any help along the way, you can open a Draft PR where we can help finalize your contribution.
30+
When you are ready to code, you can find more information about opening a pull request in the [GitHub docs](https://help.github.com/articles/creating-a-pull-request/).
1631

17-
Contributing can be challenging, so don't be discouraged if you're having difficulties. Please don't hesitate to ask for help.
32+
Whether this is your first contribution or you are already an experienced contributor, the Parse Community has your back – don't hesitate to ask for help!
1833

19-
## Setting up the project for debugging and contributing:
34+
## Why Contributing?
2035

21-
### Recommended setup:
36+
Buy cheap, buy twice. What? No, this is not the Economics 101 class, but the same is true for contributing.
37+
38+
There are two ways of writing a feature or fixing a bug. Sometimes the quick solution is to just write a Cloud Code function that does what you want. Contributing by making the change directly in Parse Server may take a bit longer, but it actually saves you much more time in the long run.
39+
40+
Consider the benefits you get:
41+
42+
- #### 🚀 Higher efficiency
43+
Your code is examined for efficiency and interoperability with existing features by the community.
44+
- #### 🛡 Stronger security
45+
Your code is scrutinized for bugs and vulnerabilities and automated checks help to identify security issues that may arise in the future.
46+
- #### 🧬 Continuous improvement
47+
If your feature is used by others it is likely to be continuously improved and extended by the community.
48+
- #### 💝 Giving back
49+
You give back to the community that contributed to make the Parse Platform become what it is today and for future developers to come.
50+
- #### 🧑‍🎓 Improving yourself
51+
You learn to better understand the inner workings of Parse Server, which will help you to write more efficient and resilient code for your own application.
52+
53+
Most importantly, with every contribution you improve your skills so that future contributions take even less time and you get all the benefits above for free — easy choice, right?
54+
55+
## Environment Setup
56+
57+
### Recommended Tools
2258

2359
* [vscode](https://code.visualstudio.com), the popular IDE.
2460
* [Jasmine Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-jasmine-test-adapter), a very practical test exploration plugin which let you run, debug and see the test results inline.
2561

26-
### Setting up you local machine:
62+
### Setting up your local machine
2763

2864
* [Fork](https://github.com/parse-community/parse-server) this project and clone the fork on your local machine:
2965

@@ -39,13 +75,15 @@ $ npm run watch # run babel watching for local file changes
3975
4076
Once you have babel running in watch mode, you can start making changes to parse-server.
4177

42-
### Good to know:
78+
### Good to Know
4379

44-
* The `lib/` folder is not commited, so never make changes in there.
80+
* The `lib/` folder is not committed, so never make changes in there.
4581
* Always make changes to files in the `src/` folder.
4682
* All the tests should point to sources in the `lib/` folder.
83+
* The `lib/` folder is produced by `babel` using either the `npm run build`, `npm run watch`, or the `npm run prepare` step.
84+
* The `npm run prepare` step is automatically invoked when your package depends on forked parse-server installed via git for example using `npm install --save git+https://github.com/[username]/parse-server#[branch/commit]`.
4785

48-
### Troubleshooting:
86+
### Troubleshooting
4987

5088
*Question*: I modify the code in the src folder but it doesn't seem to have any effect.<br/>
5189
*Answer*: Check that `npm run watch` is running
@@ -54,7 +92,10 @@ Once you have babel running in watch mode, you can start making changes to parse
5492
*Answer*: The easiest way is to install [Jasmine Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer), it will let you run selectively tests and debug them.
5593

5694
*Question*: How do I deploy my forked version on my servers?<br/>
57-
*Answer*: In your `package.json`, update the `parse-server` dependency to `https://github.com/MY_USERNAME/parse-server#MY_FEATURE`. Run `npm install`, commit the changes and deploy to your servers.
95+
*Answer*: In your `package.json`, update the `parse-server` dependency to `https://github.com/[username]/parse-server#[branch/commit]`. Run `npm install`, commit the changes and deploy to your servers.
96+
97+
*Question*: How do I deploy my forked version using docker?<br/>
98+
*Answer*: In your `package.json`, update the `parse-server` dependency to `https://github.com/[username]/parse-server#[branch/commit]`. Make sure the `npm install` step in your `Dockerfile` is running under non-privileged user for the ``npm run prepare`` step to work correctly. For official node images from hub.docker.com that non-privileged user is `node` with `/home/node` working directory.
5899

59100

60101
### Please Do's
@@ -67,11 +108,11 @@ Once you have babel running in watch mode, you can start making changes to parse
67108
* **Do not** publish the *lib* folder.
68109
* Please consider if any changes to the [docs](http://docs.parseplatform.org) are needed or add additional sections in the case of an enhancement or feature.
69110

70-
### Run your tests against Postgres (optional)
111+
### Test against Postgres
71112

72113
If your pull request introduces a change that may affect the storage or retrieval of objects, you may want to make sure it plays nice with Postgres.
73114

74-
* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/.travis.yml#L43) or use [`Docker`](#run-a-parse-postgres-with-docker).
115+
* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker).
75116
* The Postgres adapter has a special debugger that traces all the sql commands. You can enable it with setting the environment variable `PARSE_SERVER_LOG_LEVEL=debug`
76117
* If your feature is intended to only work with MongoDB, you should disable PostgreSQL-specific tests with:
77118

@@ -89,12 +130,12 @@ If your pull request introduces a change that may affect the storage or retrieva
89130
- `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
90131
- `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
91132

92-
#### Run Postgres setup for Parse with Docker
133+
#### Postgres with Docker
93134

94135
[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:
95136

96137
```
97-
docker run -d --name parse-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password --rm postgis/postgis:11-3.0-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 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
138+
docker run -d --name parse-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password --rm postgis/postgis:11-3.0-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
98139
```
99140
To stop the Postgres instance:
100141

0 commit comments

Comments
 (0)