From be96b93c73340fce0f738628583b294399d7dbfb Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Thu, 15 Jan 2026 16:49:01 -0300 Subject: [PATCH 1/9] fix: comment step out to check babel module --- .github/actions/meteor-build/action.yml | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 13fe7da5b302a..79ad686d0187d 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -165,31 +165,31 @@ runs: yarn build:ci - declare -a meter_modules_to_remove=( - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M - "meteor/babel-compiler/node_modules/typescript" # Removes 31M - "meteor/babel-compiler/node_modules/@babel" # Removes 14M - - "@rocket.chat/i18n/src" # Removes 16M - "typescript" # Removes 19M - # "@babel" # Removes 34M - Needed by Minimongo - ) - - du -s /tmp/dist/bundle - - for dir_path in "${meter_modules_to_remove[@]}"; do - path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} - - if [ -d "$path" ]; then - rm -rf "$path" - - echo "Removed directory: $path" - else - echo "Path is not a directory or does not exist: $path" - fi - done + # declare -a meter_modules_to_remove=( + # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M + # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M + # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M + # "meteor/babel-compiler/node_modules/typescript" # Removes 31M + # "meteor/babel-compiler/node_modules/@babel" # Removes 14M + # + # "@rocket.chat/i18n/src" # Removes 16M + # "typescript" # Removes 19M + # # "@babel" # Removes 34M - Needed by Minimongo + # ) + # + # du -s /tmp/dist/bundle + # + # for dir_path in "${meter_modules_to_remove[@]}"; do + # path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} + # + # if [ -d "$path" ]; then + # rm -rf "$path" + # + # echo "Removed directory: $path" + # else + # echo "Path is not a directory or does not exist: $path" + # fi + # done # Remove all .d.ts files from node_modules to reduce size # Removes 184M From 454a5cda401be135a0ecc9f5d66ae6fcdc75baa5 Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Fri, 16 Jan 2026 12:18:33 -0300 Subject: [PATCH 2/9] add end-to-end test and see run on CI --- .github/actions/meteor-build/action.yml | 50 +++++++++---------- .../end-to-end/api/incoming-integrations.ts | 36 +++++++++++++ 2 files changed, 61 insertions(+), 25 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 79ad686d0187d..13fe7da5b302a 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -165,31 +165,31 @@ runs: yarn build:ci - # declare -a meter_modules_to_remove=( - # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M - # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M - # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M - # "meteor/babel-compiler/node_modules/typescript" # Removes 31M - # "meteor/babel-compiler/node_modules/@babel" # Removes 14M - # - # "@rocket.chat/i18n/src" # Removes 16M - # "typescript" # Removes 19M - # # "@babel" # Removes 34M - Needed by Minimongo - # ) - # - # du -s /tmp/dist/bundle - # - # for dir_path in "${meter_modules_to_remove[@]}"; do - # path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} - # - # if [ -d "$path" ]; then - # rm -rf "$path" - # - # echo "Removed directory: $path" - # else - # echo "Path is not a directory or does not exist: $path" - # fi - # done + declare -a meter_modules_to_remove=( + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M + "meteor/babel-compiler/node_modules/typescript" # Removes 31M + "meteor/babel-compiler/node_modules/@babel" # Removes 14M + + "@rocket.chat/i18n/src" # Removes 16M + "typescript" # Removes 19M + # "@babel" # Removes 34M - Needed by Minimongo + ) + + du -s /tmp/dist/bundle + + for dir_path in "${meter_modules_to_remove[@]}"; do + path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} + + if [ -d "$path" ]; then + rm -rf "$path" + + echo "Removed directory: $path" + else + echo "Path is not a directory or does not exist: $path" + fi + done # Remove all .d.ts files from node_modules to reduce size # Removes 184M diff --git a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts index bdc1691f79869..e2b932c4867ad 100644 --- a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts +++ b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts @@ -473,6 +473,42 @@ describe('[Incoming Integrations]', () => { await removeIntegration(withScript._id, 'incoming'); }); + + it('should return a response with scriptCompiled and without scriptError when the script is valid', async () => { + const res = await request + .post(api('integrations.create')) + .set(credentials) + .send({ + type: 'webhook-incoming', + name: 'Incoming test', + enabled: true, + alias: 'test', + username: 'rocket.cat', + scriptEnabled: true, + scriptEngine: 'isolated-vm', + channel: '#general', + script: ` + class Script { + process_incoming_request({ request }) { + return { + content:{ + text: request.content.text + } + }; + } + } + `, + }) + .expect('Content-Type', 'application/json') + .expect(200); + + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('integration').and.to.be.an('object'); + expect(res.body.integration).to.not.have.property('scriptError'); + expect(res.body.integration).to.have.property('scriptCompiled'); + const integrationId = res.body.integration._id; + await removeIntegration(integrationId, 'incoming'); + }); }); describe('[/integrations.history]', () => { From 0772ed67e3920c45d6edb6d8e02af235f5611364 Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Fri, 16 Jan 2026 13:33:05 -0300 Subject: [PATCH 3/9] comment out CI lines again --- .github/actions/meteor-build/action.yml | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 13fe7da5b302a..79ad686d0187d 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -165,31 +165,31 @@ runs: yarn build:ci - declare -a meter_modules_to_remove=( - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M - "meteor/babel-compiler/node_modules/typescript" # Removes 31M - "meteor/babel-compiler/node_modules/@babel" # Removes 14M - - "@rocket.chat/i18n/src" # Removes 16M - "typescript" # Removes 19M - # "@babel" # Removes 34M - Needed by Minimongo - ) - - du -s /tmp/dist/bundle - - for dir_path in "${meter_modules_to_remove[@]}"; do - path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} - - if [ -d "$path" ]; then - rm -rf "$path" - - echo "Removed directory: $path" - else - echo "Path is not a directory or does not exist: $path" - fi - done + # declare -a meter_modules_to_remove=( + # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M + # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M + # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M + # "meteor/babel-compiler/node_modules/typescript" # Removes 31M + # "meteor/babel-compiler/node_modules/@babel" # Removes 14M + # + # "@rocket.chat/i18n/src" # Removes 16M + # "typescript" # Removes 19M + # # "@babel" # Removes 34M - Needed by Minimongo + # ) + # + # du -s /tmp/dist/bundle + # + # for dir_path in "${meter_modules_to_remove[@]}"; do + # path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} + # + # if [ -d "$path" ]; then + # rm -rf "$path" + # + # echo "Removed directory: $path" + # else + # echo "Path is not a directory or does not exist: $path" + # fi + # done # Remove all .d.ts files from node_modules to reduce size # Removes 184M From fc3929867dc2aa0c1614ce1bb5c0cc257878c605 Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Fri, 16 Jan 2026 14:40:55 -0300 Subject: [PATCH 4/9] add changeset and updatePermission on test --- .changeset/blue-pugs-greet.md | 5 +++++ apps/meteor/tests/end-to-end/api/incoming-integrations.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/blue-pugs-greet.md diff --git a/.changeset/blue-pugs-greet.md b/.changeset/blue-pugs-greet.md new file mode 100644 index 0000000000000..b90bbfbe68e8e --- /dev/null +++ b/.changeset/blue-pugs-greet.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes integration saving error because of missing babel dependencies by commenting out a CI slice of code diff --git a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts index e2b932c4867ad..258ea31d5ad09 100644 --- a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts +++ b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts @@ -475,6 +475,7 @@ describe('[Incoming Integrations]', () => { }); it('should return a response with scriptCompiled and without scriptError when the script is valid', async () => { + await updatePermission('manage-own-incoming-integrations', ['admin']); const res = await request .post(api('integrations.create')) .set(credentials) From cfade6edfbdfa7c20537bef720f3ac43e7654b6d Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Fri, 16 Jan 2026 15:58:02 -0300 Subject: [PATCH 5/9] comment out only babel modules --- .github/actions/meteor-build/action.yml | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 79ad686d0187d..fd691ed9215a1 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -165,31 +165,31 @@ runs: yarn build:ci - # declare -a meter_modules_to_remove=( + declare -a meter_modules_to_remove=( # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M # "meteor/babel-compiler/node_modules/typescript" # Removes 31M # "meteor/babel-compiler/node_modules/@babel" # Removes 14M - # - # "@rocket.chat/i18n/src" # Removes 16M - # "typescript" # Removes 19M - # # "@babel" # Removes 34M - Needed by Minimongo - # ) - # - # du -s /tmp/dist/bundle - # - # for dir_path in "${meter_modules_to_remove[@]}"; do - # path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} - # - # if [ -d "$path" ]; then - # rm -rf "$path" - # - # echo "Removed directory: $path" - # else - # echo "Path is not a directory or does not exist: $path" - # fi - # done + + "@rocket.chat/i18n/src" # Removes 16M + "typescript" # Removes 19M + # "@babel" # Removes 34M - Needed by Minimongo + ) + + du -s /tmp/dist/bundle + + for dir_path in "${meter_modules_to_remove[@]}"; do + path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} + + if [ -d "$path" ]; then + rm -rf "$path" + + echo "Removed directory: $path" + else + echo "Path is not a directory or does not exist: $path" + fi + done # Remove all .d.ts files from node_modules to reduce size # Removes 184M From 9588971fdde220ff4fc40f6eeb77c49a98cf03cd Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Sun, 18 Jan 2026 21:33:11 -0300 Subject: [PATCH 6/9] uncomment packages that shouldnt break babel --- .github/actions/meteor-build/action.yml | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index fd691ed9215a1..0394d4988277c 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -166,30 +166,30 @@ runs: yarn build:ci declare -a meter_modules_to_remove=( - # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M - # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M - # "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M - # "meteor/babel-compiler/node_modules/typescript" # Removes 31M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M + "meteor/babel-compiler/node_modules/typescript" # Removes 31M # "meteor/babel-compiler/node_modules/@babel" # Removes 14M - "@rocket.chat/i18n/src" # Removes 16M - "typescript" # Removes 19M - # "@babel" # Removes 34M - Needed by Minimongo - ) + "@rocket.chat/i18n/src" # Removes 16M + "typescript" # Removes 19M + # "@babel" # Removes 34M - Needed by Minimongo + ) - du -s /tmp/dist/bundle + du -s /tmp/dist/bundle - for dir_path in "${meter_modules_to_remove[@]}"; do - path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} + for dir_path in "${meter_modules_to_remove[@]}"; do + path=/tmp/dist/bundle/programs/server/npm/node_modules/${dir_path} - if [ -d "$path" ]; then - rm -rf "$path" + if [ -d "$path" ]; then + rm -rf "$path" - echo "Removed directory: $path" - else - echo "Path is not a directory or does not exist: $path" - fi - done + echo "Removed directory: $path" + else + echo "Path is not a directory or does not exist: $path" + fi + done # Remove all .d.ts files from node_modules to reduce size # Removes 184M From ac216009f4817450c9fc99f96685dff8445601b4 Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Mon, 19 Jan 2026 12:13:39 -0300 Subject: [PATCH 7/9] wrap test on describe --- .../end-to-end/api/incoming-integrations.ts | 78 +++++++++++-------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts index 258ea31d5ad09..3bad5551f3cc1 100644 --- a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts +++ b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts @@ -474,41 +474,51 @@ describe('[Incoming Integrations]', () => { await removeIntegration(withScript._id, 'incoming'); }); - it('should return a response with scriptCompiled and without scriptError when the script is valid', async () => { - await updatePermission('manage-own-incoming-integrations', ['admin']); - const res = await request - .post(api('integrations.create')) - .set(credentials) - .send({ - type: 'webhook-incoming', - name: 'Incoming test', - enabled: true, - alias: 'test', - username: 'rocket.cat', - scriptEnabled: true, - scriptEngine: 'isolated-vm', - channel: '#general', - script: ` - class Script { - process_incoming_request({ request }) { - return { - content:{ - text: request.content.text - } - }; - } - } - `, - }) - .expect('Content-Type', 'application/json') - .expect(200); + describe('With manage-own-incoming-integrations permission', () => { + let integrationId: string; - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('integration').and.to.be.an('object'); - expect(res.body.integration).to.not.have.property('scriptError'); - expect(res.body.integration).to.have.property('scriptCompiled'); - const integrationId = res.body.integration._id; - await removeIntegration(integrationId, 'incoming'); + before(async () => { + await updatePermission('manage-own-incoming-integrations', ['admin']); + }); + + after(async () => { + if (integrationId) { + await removeIntegration(integrationId, 'incoming'); + } + }); + + it('should return scriptCompiled and no scriptError', async () => { + const res = await request + .post(api('integrations.create')) + .set(credentials) + .send({ + type: 'webhook-incoming', + name: 'Incoming test', + enabled: true, + alias: 'test', + username: 'rocket.cat', + scriptEnabled: true, + scriptEngine: 'isolated-vm', + channel: '#general', + script: ` + class Script { + process_incoming_request({ request }) { + return { + content:{ + text: request.content.text + } + }; + } + } + `, + }) + .expect(200); + + expect(res.body.integration).to.have.property('scriptCompiled'); + expect(res.body.integration).to.not.have.property('scriptError'); + + integrationId = res.body.integration._id; + }); }); }); From e8c17ea855963dfedf15a1fb89c6bac2b9258412 Mon Sep 17 00:00:00 2001 From: Nazareno Bucciarelli Date: Mon, 19 Jan 2026 12:16:56 -0300 Subject: [PATCH 8/9] remove unneeded spaces --- .github/actions/meteor-build/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 0394d4988277c..9466a172cebf7 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -166,10 +166,10 @@ runs: yarn build:ci declare -a meter_modules_to_remove=( - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M - "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M - "meteor/babel-compiler/node_modules/typescript" # Removes 31M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-darwin-arm64" # Removes 35M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M + "meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M + "meteor/babel-compiler/node_modules/typescript" # Removes 31M # "meteor/babel-compiler/node_modules/@babel" # Removes 14M "@rocket.chat/i18n/src" # Removes 16M From 486965166ccb78d2b741620a366e9d498f89d6c8 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 19 Jan 2026 19:08:32 -0600 Subject: [PATCH 9/9] Actualizar blue-pugs-greet.md --- .changeset/blue-pugs-greet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/blue-pugs-greet.md b/.changeset/blue-pugs-greet.md index b90bbfbe68e8e..e350e872d866f 100644 --- a/.changeset/blue-pugs-greet.md +++ b/.changeset/blue-pugs-greet.md @@ -2,4 +2,4 @@ '@rocket.chat/meteor': patch --- -Fixes integration saving error because of missing babel dependencies by commenting out a CI slice of code +Fixes integration saving error because of missing babel dependencies inside the docker container