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][2/n] Setup Env Variables: Define env path #1280

Merged
merged 1 commit into from
Feb 22, 2024
Merged

[vscode][2/n] Setup Env Variables: Define env path #1280

merged 1 commit into from
Feb 22, 2024

Conversation

rossdanlm
Copy link
Contributor

@rossdanlm rossdanlm commented Feb 21, 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

2b363216-0cf5-4a6c-bb5e-d2fc2f781dfb.1.mp4

Stack created with Sapling. Best reviewed with ReviewStack.

@rossdanlm rossdanlm changed the title [vscode][1/n] Setup Env Variables: Define env path [vscode][2/n] Setup Env Variables: Define env path Feb 21, 2024
Comment on lines +773 to +805
// // Create the model registry file from the sample
// const sampleModelRegistryPath = vscode.Uri.joinPath(
// context.extensionUri,
// "static",
// "example_aiconfig_model_registry.py"
// );

// try {
// await vscode.workspace.fs.copy(
// sampleModelRegistryPath,
// vscode.Uri.file(modelRegistryPath),
// { overwrite: false }
// );
// } catch (err) {
// vscode.window.showErrorMessage(
// `Error creating new file ${modelRegistryPath}. Error is ${err}`
// );
// }

// const doc = await vscode.workspace.openTextDocument(modelRegistryPath);
// if (doc) {
// vscode.window.showTextDocument(doc);
// vscode.window.showInformationMessage(
// "Please customize your new model registry."
// );
// }

// let config = vscode.workspace.getConfiguration(EXTENSION_NAME);
// await handleCustomModelRegistryUpdate(
// config,
// aiconfigEditorManager,
// modelRegistryPath
// );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will delete later in stack, just doing small PRs now to get more quick feedback

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
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 rossdanlm merged commit b362fd4 into main Feb 22, 2024
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 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