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][3/n] Setup Env Variables: Use env template file for new files #1283

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

rossdanlm
Copy link
Contributor

@rossdanlm rossdanlm commented Feb 21, 2024

[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

8a9bc3bf-bd57-47bc-a919-927a59f30d15.mp4

Stack created with Sapling. Best reviewed with ReviewStack.

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
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
@@ -0,0 +1,15 @@
# Uncomment the following lines to set these common env variables for
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tanya said this is too much text. I'm just going to land and we can fix later

"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.

nit: what if it doesn't open?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, will follow up someday

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

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 rossdanlm merged commit 13a54bc into main Feb 22, 2024
rossdanlm added a commit that referenced this pull request Feb 22, 2024
…th (#1284)

[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


https://github.com/lastmile-ai/aiconfig/assets/151060367/6aad117f-0c55-4549-8f46-1b438c6ebf4b

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1284).
* #1285
* __->__ #1284
* #1283
* #1280
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.

2 participants