Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode][4/n] Setup Env Variables: Add helper text to existing env path #1284

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

rossdanlm
Copy link
Contributor

@rossdanlm rossdanlm commented Feb 22, 2024

[vscode][4/n] Setup Env Variables: Add helper text to existing env path

This PR I had some issues with reading the env template, so for now I'm splitting up this logic and will follow up next PR

Test Plan

4bbf3184-5b10-4e4c-a831-6f1507edfd04.mp4

Stack created with Sapling. Best reviewed with ReviewStack.

rossdanlm added a commit that referenced this pull request Feb 22, 2024
[vscode][2/n] Setup Env Variables: Define env path

Opening a window for user to enter in an `.env` path. Using the home dir
for now, but can change to workspace if you want, not a big deal.

Next diffs will implement a static file template and use that when env
path doesn't exist. Diff after that I'll deal with existing env path
situation

## Test Plan


https://github.com/lastmile-ai/aiconfig/assets/151060367/cceadc3a-cd20-4164-b8b2-c8d11b36b5bb

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1280).
* #1284
* #1283
* __->__ #1280
rossdanlm added a commit that referenced this pull request Feb 22, 2024
#1283)

[vscode][3/n] Setup Env Variables: Use env template file for new files

If the file does not exist, created a template file with some helper
text to help guide people on how to set their environment variables.

Next PR I will handle the use case for when the env file already exists

## Test Plan


https://github.com/lastmile-ai/aiconfig/assets/151060367/4608833c-d64f-4906-a7ed-94af12174c6d

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1283).
* #1284
* __->__ #1283
* #1280
@rossdanlm rossdanlm marked this pull request as ready for review February 22, 2024 00:46
This PR I had some issues with reading the env template, so for now I'm splitting up this logic and will follow up next PR

## Test Plan

https://github.com/lastmile-ai/aiconfig/assets/151060367/6aad117f-0c55-4549-8f46-1b438c6ebf4b
vscode.window.showInformationMessage(
"Env file already exists, will implement next PR"
);
var helperText: string = "\ntest, will change next PR";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: don't use var, use let

});
vscode.window.showInformationMessage(
"Please define your environment variables."
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add if/else to catch if this needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@Ankush-lastmile Ankush-lastmile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, approving to unblock

"Env file already exists, will implement next PR"
);
var helperText: string = "\ntest, will change next PR";
// fs.readFile(envTemplatePath.fsPath, function read(err, data) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Remove commented out code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change it in the next PR, just wasn't able to get it to work and wanted quick feedback

@rossdanlm rossdanlm merged commit 12af50c into main Feb 22, 2024
rossdanlm added a commit that referenced this pull request Feb 22, 2024
…e and append to existing file (#1285)

[vscode][5/n] Setup Env Variables: Read the text from the env template
and append to existing file

TSIA, and making the function async now that we call an await statement


## Test Plan


https://github.com/lastmile-ai/aiconfig/assets/151060367/6679e13d-6d58-4ec4-a237-360cb273e59c

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1285).
* __->__ #1285
* #1284
* #1283
* #1280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants