From 439efe40522bd8f851da94b2858d80f89a2d9669 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Tue, 2 Jun 2020 19:24:41 -0300 Subject: [PATCH 1/2] Add Apps-Engine to Engine Versions on History --- .houston/metadata.js | 18 ++++++++++++++++++ .houston/templates/versions.hbs | 3 +++ 2 files changed, 21 insertions(+) diff --git a/.houston/metadata.js b/.houston/metadata.js index 34de398bc857..98f54a2c3a6d 100644 --- a/.houston/metadata.js +++ b/.houston/metadata.js @@ -36,8 +36,24 @@ const getNodeNpmVersions = async function({ version, git, request }) { return {}; }; +const getAppsEngineVersion = async function({ version, git }) { + try { + const packageJson = await git.show([`${ version }:package.json`]); + const { dependencies } = JSON.parse(packageJson); + const appsEngineVersion = dependencies['@rocket.chat/apps-engine']; + + return appsEngineVersion; + } catch (e) { + console.error(e); + } + + return undefined; +}; + module.exports = async function({ version, git, request }) { const mongo_versions = await getMongoVersion({ version, git }); + const apps_engine_version = await getAppsEngineVersion({ version, git }); + const { node_version, npm_version, @@ -47,5 +63,7 @@ module.exports = async function({ version, git, request }) { node_version, npm_version, mongo_versions, + apps_engine_version, }; }; + diff --git a/.houston/templates/versions.hbs b/.houston/templates/versions.hbs index 8ee2a4f98551..46da32d49ed4 100644 --- a/.houston/templates/versions.hbs +++ b/.houston/templates/versions.hbs @@ -10,4 +10,7 @@ {{#if release.mongo_versions}} - MongoDB: `{{ join release.mongo_versions ', ' }}` {{/if}} +{{#if release.apps_engine_version}} +- Apps-Engine: `{{ release.apps_engine_version }}` +{{/if}} {{/if}} From be8164ed072c703b1d5c9a20031c8b2ad547f725 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Wed, 3 Jun 2020 15:20:02 -0300 Subject: [PATCH 2/2] Update metadata grabbing --- .houston/metadata.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.houston/metadata.js b/.houston/metadata.js index 98f54a2c3a6d..df78a54991e5 100644 --- a/.houston/metadata.js +++ b/.houston/metadata.js @@ -38,9 +38,9 @@ const getNodeNpmVersions = async function({ version, git, request }) { const getAppsEngineVersion = async function({ version, git }) { try { - const packageJson = await git.show([`${ version }:package.json`]); + const packageJson = await git.show([`${ version }:package-lock.json`]); const { dependencies } = JSON.parse(packageJson); - const appsEngineVersion = dependencies['@rocket.chat/apps-engine']; + const { version: appsEngineVersion } = dependencies['@rocket.chat/apps-engine']; return appsEngineVersion; } catch (e) { @@ -62,8 +62,8 @@ module.exports = async function({ version, git, request }) { return { node_version, npm_version, - mongo_versions, apps_engine_version, + mongo_versions, }; };