Skip to content

Conversation

Copy link

Copilot AI commented Feb 4, 2026

  • Create separate validation function following DOT principle
    • Extract validation logic from addDevEnvVariables() into validateDevEnvVariables()
    • Keep addDevEnvVariables() focused on loading env file
    • Call validateDevEnvVariables() after loading
  • Remove unnecessary comment from extensionData.ts line 98
  • Reorder functions - addDevEnvVariables() now comes before validateDevEnvVariables()
  • Run code review - No issues found
  • Run security checks - No vulnerabilities found

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 4, 2026 19:45
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback on loading dev-only environment variables Validate DEV_USER_EXTENSIONS_PATH before use to prevent activation failures Feb 4, 2026
Copilot AI requested a review from yCodeTech February 4, 2026 19:47
Copy link
Owner

@yCodeTech yCodeTech left a comment

Choose a reason for hiding this comment

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

A lot of this validation and errors should probably go in the util function that adds it to the env in the first place.

Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 5, 2026

A lot of this validation and errors should probably go in the util function that adds it to the env in the first place.

Moved the validation logic from extensionData.ts to the addDevEnvVariables() utility function in utils.ts. The environment variable is now validated and sanitized when it's loaded (early in extension activation), rather than when it's used. Invalid paths are removed from process.env with error logging, ensuring the value is either valid or undefined when accessed later.

Addressed in commit 88864fe.

Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Copilot AI changed the title Validate DEV_USER_EXTENSIONS_PATH before use to prevent activation failures Validate DEV_USER_EXTENSIONS_PATH in utility function to prevent activation failures Feb 5, 2026
Copilot AI requested a review from yCodeTech February 5, 2026 02:48
Copy link
Owner

@yCodeTech yCodeTech left a comment

Choose a reason for hiding this comment

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

Hmm. Maybe it should be in a new util function for validation? Because of the DOT principle.

…nciple

Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 5, 2026

Hmm. Maybe it should be in a new util function for validation? Because of the DOT principle.

Created a separate validateDevEnvVariables() function following the DOT principle. The addDevEnvVariables() function now focuses solely on loading the .env file, while validateDevEnvVariables() handles validation and sanitization. This keeps each function responsible for one thing.

Addressed in commit 64f50b5.

Copy link
Owner

@yCodeTech yCodeTech left a comment

Choose a reason for hiding this comment

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

Why is this above the addDevEnvVariables? Please move it below for better organisation.

Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 6, 2026

Why is this above the addDevEnvVariables? Please move it below for better organisation.

Moved validateDevEnvVariables() below addDevEnvVariables() for better organization.

Addressed in commit 25e5e94.

yCodeTech added a commit that referenced this pull request Feb 6, 2026
- Added `validateDevEnvVariables` util function to validate and sanitize the `DEV_USER_EXTENSIONS_PATH` env variable value. Added it's function call to `addDevEnvVariables` util function.

This function is based on the code Copilot created in PR #23, but with significant improvement.
@yCodeTech
Copy link
Owner

Superseded by #24.

@yCodeTech yCodeTech closed this Feb 6, 2026
@yCodeTech yCodeTech deleted the copilot/sub-pr-22 branch February 6, 2026 03:20
yCodeTech added a commit that referenced this pull request Feb 6, 2026
- Added `validateDevEnvVariables` util function to validate and sanitize
the `DEV_USER_EXTENSIONS_PATH` env variable value. Added it's function
call to `addDevEnvVariables` util function.

This function is based on the code Copilot created in PR #23, but with
significant improvement.
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