From ba32dae268732f39630fdd327781e9595f0f6def Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 30 Mar 2021 23:58:03 +0200 Subject: [PATCH 1/4] bumped node ci (#7306) --- .github/workflows/ci.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef0da0040e..0195bb8e1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: MONGODB_VERSION: 4.4.4 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 12.21.0 + NODE_VERSION: 12.22.0 - name: Node 15 MONGODB_VERSION: 4.4.4 MONGODB_TOPOLOGY: standalone diff --git a/README.md b/README.md index 3f9ed6ffd2..4e88df4093 100644 --- a/README.md +++ b/README.md @@ -113,9 +113,9 @@ Parse Server is continuously tested with the most recent releases of Node.js to | Version | Latest Patch Version | End-of-Life Date | Compatibility | |------------|----------------------|------------------|--------------------| | Node.js 10 | 10.24.0 | April 2021 | ✅ Fully compatible | -| Node.js 12 | 12.21.0 | April 2022 | ✅ Fully compatible | +| Node.js 12 | 12.22.0 | April 2022 | ✅ Fully compatible | | Node.js 14 | 14.16.0 | April 2023 | ✅ Fully compatible | -| Node.js 15 | 15.12.0 | June 2021 | ✅ Fully compatible | +| Node.js 15 | 15.12.0 | June 2021 | ✅ Fully compatible | #### MongoDB 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. From 626352d594aed731d653d447231a894d23b07bd9 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 2 Apr 2021 15:46:02 +0200 Subject: [PATCH 2/4] Use Node.js 15.13.0 in CI (#7312) * Use Node.js 15.13.0 in CI * CI: Allow check-postgres 20 timeout * CI: 30 min timeout for check-postgres * reverted postgres timeout to 15 Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 1 + README.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0195bb8e1a..5736173730 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: MONGODB_VERSION: 4.4.4 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 15.12.0 + NODE_VERSION: 15.13.0 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b6accab4..1b4422f4b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -120,6 +120,7 @@ ___ - Improve data consistency in Push and Job Status update (Diamond Lewis) [#7267](https://github.com/parse-community/parse-server/pull/7267) - Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273) - Added centralized feature deprecation with standardized warning logs (Manuel Trezza) [#7303](https://github.com/parse-community/parse-server/pull/7303) +- Use Node.js 15.13.0 in CI (Olle Jonsson) [#7312](https://github.com/parse-community/parse-server/pull/7312) ___ ## 4.5.0 [Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0) diff --git a/README.md b/README.md index 4e88df4093..dd45e33738 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Parse Server is continuously tested with the most recent releases of Node.js to | Node.js 10 | 10.24.0 | April 2021 | ✅ Fully compatible | | Node.js 12 | 12.22.0 | April 2022 | ✅ Fully compatible | | Node.js 14 | 14.16.0 | April 2023 | ✅ Fully compatible | -| Node.js 15 | 15.12.0 | June 2021 | ✅ Fully compatible | +| Node.js 15 | 15.13.0 | June 2021 | ✅ Fully compatible | #### MongoDB 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. From 4d167026aebed38bf3a3b74599ab3771d1da3245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20O=C4=9Fuzhan=20Y=C4=B1ld=C4=B1z?= Date: Fri, 2 Apr 2021 18:29:46 +0300 Subject: [PATCH 3/4] fix: empty file tags cause upload error for some providers (#7300) * fix: empty file tags cause upload error for some providers DigitalOcean and Linode object storage solutions do not accept `tags` option while uploading a file. Previously, tags option was set to default empty object. Now, we do not include it if it is empty. * chore: add tests for saving a file with/without tags * chore: update file tags handling to make tests pass * chore: refactor file tag tests * chore: update file tag tests * chore: update changelog * chore: update changelog entry * chore: remove duplicated changelog entry --- CHANGELOG.md | 1 + spec/ParseFile.spec.js | 29 +++++++++++++++++++++++++++++ src/Routers/FilesRouter.js | 14 ++++++++++---- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b4422f4b4..75a80c51f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,6 +121,7 @@ ___ - Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273) - Added centralized feature deprecation with standardized warning logs (Manuel Trezza) [#7303](https://github.com/parse-community/parse-server/pull/7303) - Use Node.js 15.13.0 in CI (Olle Jonsson) [#7312](https://github.com/parse-community/parse-server/pull/7312) +- Fix file upload issue for S3 compatible storage (Linode, DigitalOcean) by avoiding empty tags property when creating a file (Ali Oguzhan Yildiz) [#7300](https://github.com/parse-community/parse-server/pull/7300) ___ ## 4.5.0 [Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0) diff --git a/spec/ParseFile.spec.js b/spec/ParseFile.spec.js index b55dd7404a..af1de35ee7 100644 --- a/spec/ParseFile.spec.js +++ b/spec/ParseFile.spec.js @@ -3,6 +3,7 @@ 'use strict'; +const { FilesController } = require('../lib/Controllers/FilesController'); const request = require('../lib/request'); const str = 'Hello World!'; @@ -205,6 +206,34 @@ describe('Parse.File testing', () => { notEqual(file.name(), 'hello.txt'); }); + it('saves the file with tags', async () => { + spyOn(FilesController.prototype, 'createFile').and.callThrough(); + const file = new Parse.File('hello.txt', data, 'text/plain'); + const tags = { hello: 'world' }; + file.setTags(tags); + expect(file.url()).toBeUndefined(); + const result = await file.save(); + expect(file.name()).toBeDefined(); + expect(file.url()).toBeDefined(); + expect(result.tags()).toEqual(tags); + expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({ + tags: tags, + metadata: {}, + }); + }); + + it('does not pass empty file tags while saving', async () => { + spyOn(FilesController.prototype, 'createFile').and.callThrough(); + const file = new Parse.File('hello.txt', data, 'text/plain'); + expect(file.url()).toBeUndefined(); + expect(file.name()).toBeDefined(); + await file.save(); + expect(file.url()).toBeDefined(); + expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({ + metadata: {}, + }); + }); + it('save file in object', async done => { const file = new Parse.File('hello.txt', data, 'text/plain'); ok(!file.url()); diff --git a/src/Routers/FilesRouter.js b/src/Routers/FilesRouter.js index df768e6d0b..c0c7e00f13 100644 --- a/src/Routers/FilesRouter.js +++ b/src/Routers/FilesRouter.js @@ -166,16 +166,22 @@ export class FilesRouter { // update fileSize const bufferData = Buffer.from(fileObject.file._data, 'base64'); fileObject.fileSize = Buffer.byteLength(bufferData); + // prepare file options + const fileOptions = { + metadata: fileObject.file._metadata, + }; + // some s3-compatible providers (DigitalOcean, Linode) do not accept tags + // so we do not include the tags option if it is empty. + const fileTags = + Object.keys(fileObject.file._tags).length > 0 ? { tags: fileObject.file._tags } : {}; + Object.assign(fileOptions, fileTags); // save file const createFileResult = await filesController.createFile( config, fileObject.file._name, bufferData, fileObject.file._source.type, - { - tags: fileObject.file._tags, - metadata: fileObject.file._metadata, - } + fileOptions ); // update file with new data fileObject.file._name = createFileResult.name; From 70e13476238375f6d612727595cd49e5f401136e Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 3 Apr 2021 01:13:09 +0200 Subject: [PATCH 4/4] Remove Node 10 support (EOL) (#7314) * removed node 10 support (EOL) * added changelog entry * updated CI check * updated babel env preset to node 12 --- .babelrc | 2 +- .github/workflows/ci.yml | 7 +------ CHANGELOG.md | 1 + README.md | 3 +-- resources/ci/ciCheck.js | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.babelrc b/.babelrc index 1eb1208aa6..9151969bde 100644 --- a/.babelrc +++ b/.babelrc @@ -6,7 +6,7 @@ "presets": [ ["@babel/preset-env", { "targets": { - "node": "8" + "node": "12" } }] ], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5736173730..70abb020ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: - '**' env: COVERAGE_OPTION: ./node_modules/.bin/nyc - NODE_VERSION: 10 + NODE_VERSION: 14.16.0 PARSE_SERVER_TEST_TIMEOUT: 20000 jobs: check-ci: @@ -82,11 +82,6 @@ jobs: MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 14.16.0 - - name: Node 10 - MONGODB_VERSION: 4.4.4 - MONGODB_TOPOLOGY: standalone - MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 10.24.0 - name: Node 12 MONGODB_VERSION: 4.4.4 MONGODB_TOPOLOGY: standalone diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a80c51f5..fe4720b1e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,7 @@ ___ - Added Parse Server Security Check to report weak security settings (Manuel Trezza, dblythy) [#7247](https://github.com/parse-community/parse-server/issues/7247) - EXPERIMENTAL: Added new page router with placeholder rendering and localization of custom and feature pages such as password reset and email verification (Manuel Trezza) [#6891](https://github.com/parse-community/parse-server/issues/6891) - EXPERIMENTAL: Added custom routes to easily customize flows for password reset, email verification or build entirely new flows (Manuel Trezza) [#7231](https://github.com/parse-community/parse-server/issues/7231) +- Remove support for Node 10 which has reached its End-of-Life support date (Manuel Trezza) [#7314](https://github.com/parse-community/parse-server/pull/7314) ### Other Changes - Fix error when a not yet inserted job is updated (Antonio Davi Macedo Coelho de Castro) [#7196](https://github.com/parse-community/parse-server/pull/7196) - request.context for afterFind triggers (dblythy) [#7078](https://github.com/parse-community/parse-server/pull/7078) diff --git a/README.md b/README.md index dd45e33738..8016b2d7fc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ npm version Join the conversation Snyk badge - Node.js 10,12,14,15 + Node.js 12,14,15 MongoDB 3.6,4.0,4.2,4.4 PostgreSQL 10,11,12,13

@@ -112,7 +112,6 @@ Parse Server is continuously tested with the most recent releases of Node.js to | Version | Latest Patch Version | End-of-Life Date | Compatibility | |------------|----------------------|------------------|--------------------| -| Node.js 10 | 10.24.0 | April 2021 | ✅ Fully compatible | | Node.js 12 | 12.22.0 | April 2022 | ✅ Fully compatible | | Node.js 14 | 14.16.0 | April 2023 | ✅ Fully compatible | | Node.js 15 | 15.13.0 | June 2021 | ✅ Fully compatible | diff --git a/resources/ci/ciCheck.js b/resources/ci/ciCheck.js index 66ee6d9aa0..0686931833 100644 --- a/resources/ci/ciCheck.js +++ b/resources/ci/ciCheck.js @@ -59,8 +59,7 @@ async function checkNodeVersions() { releasedVersions, latestComponent: CiVersionCheck.versionComponents.minor, ignoreReleasedVersions: [ - '<10.0.0', // These versions have reached their end-of-life support date - '>=11.0.0 <12.0.0', // These versions have reached their end-of-life support date + '<12.0.0', // These versions have reached their end-of-life support date '>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date '>=16.0.0', // This version has not been officially released yet ],