Skip to content

Commit 3c40c06

Browse files
authored
Merge branch 'master' into add-deprecation-policy
2 parents 826a533 + c05102b commit 3c40c06

File tree

12 files changed

+256
-185
lines changed

12 files changed

+256
-185
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
MONGODB_STORAGE_ENGINE: wiredTiger
4848
NODE_VERSION: 14.15.5
4949
- name: Mongo 4.0, ReplicaSet, WiredTiger
50-
MONGODB_VERSION: 4.0.22
50+
MONGODB_VERSION: 4.0.23
5151
MONGODB_TOPOLOGY: replicaset
5252
MONGODB_STORAGE_ENGINE: wiredTiger
5353
NODE_VERSION: 14.15.5
@@ -76,7 +76,7 @@ jobs:
7676
MONGODB_VERSION: 4.4.4
7777
MONGODB_TOPOLOGY: standalone
7878
MONGODB_STORAGE_ENGINE: wiredTiger
79-
NODE_VERSION: 15.8.0
79+
NODE_VERSION: 15.9.0
8080
name: ${{ matrix.name }}
8181
timeout-minutes: 30
8282
runs-on: ubuntu-18.04

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ ___
2121
- 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)
2222
- 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)
2323
- NEW: Added Deprecation Policy to govern the introduction of braking changes in a phased pattern that is more predictable for developers. [#7199](https://github.com/parse-community/parse-server/pull/7199). Thanks to [Manuel Trezza](https://github.com/mtrezza).
24+
- 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).
2425
- 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).
2526
- 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).
2627
- 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).
2728
- 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).
2829
- 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)
2930
- 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).
31+
- 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).
3032
- FIX: request.context for afterFind triggers. [#7078](https://github.com/parse-community/parse-server/pull/7078). Thanks to [dblythy](https://github.com/dblythy)
3133
- FIX: Winston Logger interpolating stdout to console [#7114](https://github.com/parse-community/parse-server/pull/7114). Thanks to [dplewis](https://github.com/dplewis)
3234

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Once you have babel running in watch mode, you can start making changes to parse
8282
* The `lib/` folder is not committed, so never make changes in there.
8383
* Always make changes to files in the `src/` folder.
8484
* All the tests should point to sources in the `lib/` folder.
85+
* The `lib/` folder is produced by `babel` using either the `npm run build`, `npm run watch`, or the `npm run prepare` step.
86+
* 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]`.
8587

8688
### Troubleshooting
8789

@@ -92,7 +94,10 @@ Once you have babel running in watch mode, you can start making changes to parse
9294
*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.
9395

9496
*Question*: How do I deploy my forked version on my servers?<br/>
95-
*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.
97+
*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.
98+
99+
*Question*: How do I deploy my forked version using docker?<br/>
100+
*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.
96101

97102

98103
### Please Do's

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ Parse Server is continuously tested with the most recent releases of Node.js to
109109
| Node.js 10 | 10.23.2 | April 2021 | ✅ Fully compatible |
110110
| Node.js 12 | 12.20.1 | April 2022 | ✅ Fully compatible |
111111
| Node.js 14 | 14.15.4 | April 2023 | ✅ Fully compatible |
112-
| Node.js 15 | 15.8.0 | June 2021 | ✅ Fully compatible |
112+
| Node.js 15 | 15.9.0 | June 2021 | ✅ Fully compatible |
113113

114114
#### MongoDB
115115
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date.
116116

117117
| Version | Latest Patch Version | End-of-Life Date | Compatibility |
118118
|-------------|----------------------|------------------|--------------------|
119119
| MongoDB 3.6 | 3.6.21 | April 2021 | ✅ Fully compatible |
120-
| MongoDB 4.0 | 4.0.22 | January 2022 | ✅ Fully compatible |
120+
| MongoDB 4.0 | 4.0.23 | January 2022 | ✅ Fully compatible |
121121
| MongoDB 4.2 | 4.2.12 | TBD | ✅ Fully compatible |
122122
| MongoDB 4.4 | 4.4.4 | TBD | ✅ Fully compatible |
123123

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"mongodb": "3.6.3",
5050
"mustache": "4.1.0",
5151
"parse": "2.19.0",
52-
"pg-promise": "10.9.1",
52+
"pg-promise": "10.9.2",
5353
"pluralize": "8.0.0",
5454
"redis": "3.0.2",
5555
"semver": "7.3.4",
@@ -108,7 +108,7 @@
108108
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
109109
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
110110
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
111-
"test:mongodb:4.0.22": "npm run test:mongodb --dbversion=4.0.22",
111+
"test:mongodb:4.0.23": "npm run test:mongodb --dbversion=4.0.23",
112112
"test:mongodb:4.2.12": "npm run test:mongodb --dbversion=4.2.12",
113113
"test:mongodb:4.4.4": "npm run test:mongodb --dbversion=4.4.4",
114114
"posttest:mongodb": "mongodb-runner stop",

spec/CloudCode.spec.js

Lines changed: 79 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,9 @@ describe('Cloud Code', () => {
15491549
describe('cloud jobs', () => {
15501550
it('should define a job', done => {
15511551
expect(() => {
1552-
Parse.Cloud.job('myJob', () => {});
1552+
Parse.Cloud.job('myJob', ({ message }) => {
1553+
message('Hello, world!!!');
1554+
});
15531555
}).not.toThrow();
15541556

15551557
request({
@@ -1559,15 +1561,19 @@ describe('Cloud Code', () => {
15591561
'X-Parse-Application-Id': Parse.applicationId,
15601562
'X-Parse-Master-Key': Parse.masterKey,
15611563
},
1562-
}).then(
1563-
() => {
1564-
done();
1565-
},
1566-
err => {
1567-
fail(err);
1568-
done();
1569-
}
1570-
);
1564+
})
1565+
.then(async response => {
1566+
const jobStatusId = response.headers['x-parse-job-status-id'];
1567+
const checkJobStatus = async () => {
1568+
const jobStatus = await getJobStatus(jobStatusId);
1569+
return jobStatus.get('finishedAt') && jobStatus.get('message') === 'Hello, world!!!';
1570+
};
1571+
while (!(await checkJobStatus())) {
1572+
await new Promise(resolve => setTimeout(resolve, 100));
1573+
}
1574+
})
1575+
.then(done)
1576+
.catch(done.fail);
15711577
});
15721578

15731579
it('should not run without master key', done => {
@@ -1602,7 +1608,6 @@ describe('Cloud Code', () => {
16021608
expect(typeof req.jobId).toBe('string');
16031609
expect(typeof req.message).toBe('function');
16041610
expect(typeof res).toBe('undefined');
1605-
done();
16061611
});
16071612
}).not.toThrow();
16081613

@@ -1613,13 +1618,19 @@ describe('Cloud Code', () => {
16131618
'X-Parse-Application-Id': Parse.applicationId,
16141619
'X-Parse-Master-Key': Parse.masterKey,
16151620
},
1616-
}).then(
1617-
() => {},
1618-
err => {
1619-
fail(err);
1620-
done();
1621-
}
1622-
);
1621+
})
1622+
.then(async response => {
1623+
const jobStatusId = response.headers['x-parse-job-status-id'];
1624+
const checkJobStatus = async () => {
1625+
const jobStatus = await getJobStatus(jobStatusId);
1626+
return jobStatus.get('finishedAt');
1627+
};
1628+
while (!(await checkJobStatus())) {
1629+
await new Promise(resolve => setTimeout(resolve, 100));
1630+
}
1631+
})
1632+
.then(done)
1633+
.catch(done.fail);
16231634
});
16241635

16251636
it('should run with master key basic auth', done => {
@@ -1630,25 +1641,30 @@ describe('Cloud Code', () => {
16301641
expect(typeof req.jobId).toBe('string');
16311642
expect(typeof req.message).toBe('function');
16321643
expect(typeof res).toBe('undefined');
1633-
done();
16341644
});
16351645
}).not.toThrow();
16361646

16371647
request({
16381648
method: 'POST',
16391649
url: `http://${Parse.applicationId}:${Parse.masterKey}@localhost:8378/1/jobs/myJob`,
1640-
}).then(
1641-
() => {},
1642-
err => {
1643-
fail(err);
1644-
done();
1645-
}
1646-
);
1650+
})
1651+
.then(async response => {
1652+
const jobStatusId = response.headers['x-parse-job-status-id'];
1653+
const checkJobStatus = async () => {
1654+
const jobStatus = await getJobStatus(jobStatusId);
1655+
return jobStatus.get('finishedAt');
1656+
};
1657+
while (!(await checkJobStatus())) {
1658+
await new Promise(resolve => setTimeout(resolve, 100));
1659+
}
1660+
})
1661+
.then(done)
1662+
.catch(done.fail);
16471663
});
16481664

16491665
it('should set the message / success on the job', done => {
16501666
Parse.Cloud.job('myJob', req => {
1651-
const promise = req
1667+
return req
16521668
.message('hello')
16531669
.then(() => {
16541670
return getJobStatus(req.jobId);
@@ -1657,21 +1673,6 @@ describe('Cloud Code', () => {
16571673
expect(jobStatus.get('message')).toEqual('hello');
16581674
expect(jobStatus.get('status')).toEqual('running');
16591675
});
1660-
promise
1661-
.then(() => {
1662-
return getJobStatus(req.jobId);
1663-
})
1664-
.then(jobStatus => {
1665-
expect(jobStatus.get('message')).toEqual('hello');
1666-
expect(jobStatus.get('status')).toEqual('succeeded');
1667-
done();
1668-
})
1669-
.catch(err => {
1670-
console.error(err);
1671-
jfail(err);
1672-
done();
1673-
});
1674-
return promise;
16751676
});
16761677

16771678
request({
@@ -1681,32 +1682,28 @@ describe('Cloud Code', () => {
16811682
'X-Parse-Application-Id': Parse.applicationId,
16821683
'X-Parse-Master-Key': Parse.masterKey,
16831684
},
1684-
}).then(
1685-
() => {},
1686-
err => {
1687-
fail(err);
1688-
done();
1689-
}
1690-
);
1685+
})
1686+
.then(async response => {
1687+
const jobStatusId = response.headers['x-parse-job-status-id'];
1688+
const checkJobStatus = async () => {
1689+
const jobStatus = await getJobStatus(jobStatusId);
1690+
return (
1691+
jobStatus.get('finishedAt') &&
1692+
jobStatus.get('message') === 'hello' &&
1693+
jobStatus.get('status') === 'succeeded'
1694+
);
1695+
};
1696+
while (!(await checkJobStatus())) {
1697+
await new Promise(resolve => setTimeout(resolve, 100));
1698+
}
1699+
})
1700+
.then(done)
1701+
.catch(done.fail);
16911702
});
16921703

16931704
it('should set the failure on the job', done => {
1694-
Parse.Cloud.job('myJob', req => {
1695-
const promise = Promise.reject('Something went wrong');
1696-
new Promise(resolve => setTimeout(resolve, 200))
1697-
.then(() => {
1698-
return getJobStatus(req.jobId);
1699-
})
1700-
.then(jobStatus => {
1701-
expect(jobStatus.get('message')).toEqual('Something went wrong');
1702-
expect(jobStatus.get('status')).toEqual('failed');
1703-
done();
1704-
})
1705-
.catch(err => {
1706-
jfail(err);
1707-
done();
1708-
});
1709-
return promise;
1705+
Parse.Cloud.job('myJob', () => {
1706+
return Promise.reject('Something went wrong');
17101707
});
17111708

17121709
request({
@@ -1716,13 +1713,23 @@ describe('Cloud Code', () => {
17161713
'X-Parse-Application-Id': Parse.applicationId,
17171714
'X-Parse-Master-Key': Parse.masterKey,
17181715
},
1719-
}).then(
1720-
() => {},
1721-
err => {
1722-
fail(err);
1723-
done();
1724-
}
1725-
);
1716+
})
1717+
.then(async response => {
1718+
const jobStatusId = response.headers['x-parse-job-status-id'];
1719+
const checkJobStatus = async () => {
1720+
const jobStatus = await getJobStatus(jobStatusId);
1721+
return (
1722+
jobStatus.get('finishedAt') &&
1723+
jobStatus.get('message') === 'Something went wrong' &&
1724+
jobStatus.get('status') === 'failed'
1725+
);
1726+
};
1727+
while (!(await checkJobStatus())) {
1728+
await new Promise(resolve => setTimeout(resolve, 100));
1729+
}
1730+
})
1731+
.then(done)
1732+
.catch(done.fail);
17261733
});
17271734

17281735
it('should set the failure message on the job error', async () => {

0 commit comments

Comments
 (0)