From 6979c8d67bd80522e3f025dda0fb228f2a1250eb Mon Sep 17 00:00:00 2001 From: Szymon Dziedzic Date: Fri, 15 Nov 2024 11:51:41 +0100 Subject: [PATCH] [eas-cli] make logs anouncing loading env variables less noisy (#2694) --- .../build/evaluateConfigWithEnvVarsAsync.ts | 19 ++----------------- ...loadServerSideEnvironmentVariablesAsync.ts | 13 ++----------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts b/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts index 64d707125c..be1488a569 100644 --- a/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts +++ b/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts @@ -83,24 +83,13 @@ async function resolveEnvVarsAsync({ if (Object.keys(serverEnvVars).length > 0) { Log.log( - `Environment variables loaded from the "${environment.toLowerCase()}" environment on EAS servers: ${Object.keys( + `Environment variables with visibility "Plain text" and "Sensitive" loaded from the "${environment.toLowerCase()}" environment on EAS servers: ${Object.keys( serverEnvVars ).join(', ')}.` ); } else { Log.log( - `No environment variables found for the "${environment.toLowerCase()}" environment on EAS servers.` - ); - } - - const encryptedEnvVars = environmentVariables.filter(({ name, value }) => name && !value); - if (encryptedEnvVars.length > 0) { - Log.warn( - `Some environment variables defined in the "${environment.toLowerCase()}" environment on EAS servers are of "encrypted" type and cannot be read outside of the EAS servers (including EAS CLI): ${encryptedEnvVars - .map(({ name }) => name) - .join( - ', ' - )}. However, they will be available during the build process happening on the EAS servers. This can lead to potential configuration mismatches between the local development environment and the build environment if the encrypted environment variables are used to resolve the app config.` + `No environment variables with visibility "Plain text" and "Sensitive" found for the "${environment.toLowerCase()}" environment on EAS servers.` ); } @@ -110,10 +99,6 @@ async function resolveEnvVarsAsync({ buildProfile.env && Object.keys(buildProfile.env).join(', ') }.` ); - } else { - Log.log( - `No environment variables specified in the "${buildProfileName}" build profile "env" configuration.` - ); } if ( diff --git a/packages/eas-cli/src/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.ts b/packages/eas-cli/src/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.ts index d682d76169..03e4d9d0e5 100644 --- a/packages/eas-cli/src/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.ts +++ b/packages/eas-cli/src/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.ts @@ -42,22 +42,13 @@ export async function loadServerSideEnvironmentVariablesAsync({ if (Object.keys(serverEnvVars).length > 0) { Log.log( - `Environment variables loaded from the "${environment.toLowerCase()}" environment on EAS servers: ${Object.keys( + `Environment variables with visibility "Plain text" and "Sensitive" loaded from the "${environment.toLowerCase()}" environment on EAS servers: ${Object.keys( serverEnvVars ).join(', ')}.` ); } else { Log.log( - `No readable environment variables found for the "${environment.toLowerCase()}" environment on EAS servers.` - ); - } - - const encryptedEnvVars = environmentVariables.filter(({ name, value }) => name && !value); - if (encryptedEnvVars.length > 0) { - Log.warn( - `Some environment variables defined in the "${environment.toLowerCase()}" environment on EAS servers are of "encrypted" type and cannot be read outside of the EAS servers (including EAS CLI): ${encryptedEnvVars - .map(({ name }) => name) - .join(', ')}. ` + `No environment variables with visibility "Plain text" and "Sensitive" found for the "${environment.toLowerCase()}" environment on EAS servers.` ); } Log.newLine();