Skip to content

Commit

Permalink
[eas-cli] improve eas env:pull logging (#2720)
Browse files Browse the repository at this point in the history
<!-- If this PR requires a changelog entry, add it by commenting the PR with the command `/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]`. -->
<!-- You can skip the changelog check by labeling the PR with "no changelog". -->

# Why

https://exponent-internal.slack.com/archives/C06FK950085/p1732258126230829

# How

Improve logs

# Test Plan

Tests
  • Loading branch information
szdziedzic authored Nov 22, 2024
1 parent bd2d39f commit 8da6adf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🧹 Chores

- Improve logging in `eas env:pull`. ([#2720](https://github.com/expo/eas-cli/pull/2720) by [@szdziedzic](https://github.com/szdziedzic))

## [13.4.0](https://github.com/expo/eas-cli/releases/tag/v13.4.0) - 2024-11-22

### 🎉 New features
Expand Down
14 changes: 7 additions & 7 deletions packages/eas-cli/src/commands/env/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class EnvPull extends EasCommand {
return `${variable.name}=${currentEnvLocal[variable.name]}`;
}
skippedSecretVariables.push(variable.name);
return `# ${variable.name}=***** (secret variables are not available for reading)`;
return `# ${variable.name}=***** (secret)`;
}
if (variable.type === EnvironmentSecretType.FileBase64 && variable.valueWithFileContent) {
const filePath = path.join(envDir, variable.name);
Expand All @@ -130,20 +130,20 @@ export default class EnvPull extends EasCommand {
await fs.writeFile(targetPath, filePrefix + envFileContentLines.join('\n'));

Log.log(
`Pulled environment variables from ${environment.toLowerCase()} environment to ${targetPath}.`
`Pulled plain text and sensitive environment variables from "${environment.toLowerCase()}" environment to ${targetPath}.`
);

if (overridenSecretVariables.length > 0) {
Log.addNewLineIfNone();
Log.log(`Reused local values for following secrets: ${overridenSecretVariables.join('\n')}`);
Log.log(`Reused local values for following secrets: ${overridenSecretVariables.join('\n')}.`);
}

if (skippedSecretVariables.length > 0) {
Log.addNewLineIfNone();
Log.warn(
`The following variables have the secret visibility and can not be read outside of EAS servers. Set their values manually in .env.local: ${skippedSecretVariables.join(
'\n'
)}`
Log.log(
`The following variables have the secret visibility and can't be read outside of EAS servers. Set their values manually in your .env file: ${skippedSecretVariables.join(
', '
)}.`
);
}
}
Expand Down

0 comments on commit 8da6adf

Please sign in to comment.