Skip to content

feat(cli): reload environment variables with --watch and --env-file - #30197

Merged
dsherret merged 43 commits into
denoland:mainfrom
meetdhanani17:fix/env_not_update_in_watch_mode
Sep 4, 2025
Merged

dsherret merged 43 commits into
denoland:mainfrom
meetdhanani17:fix/env_not_update_in_watch_mode

Conversation

@meetdhanani17

@meetdhanani17 meetdhanani17 commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

fix(cli/watch): Reload environment variables with --watch and --env-file

  • Added functionality to watch the env file and reload its variables during hot reload execution.
  • fixes issue #29483, #29201

@CLAassistant

CLAassistant commented Jul 24, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dsherret dsherret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Would it be possible to add a test for this to ensure it works and continues to work in the future?

Comment thread cli/tools/run/mod.rs Resolved
@dsherret dsherret changed the title Fix - Reload environment variables with --watch and --env-file fix: reload environment variables with --watch and --env-file Jul 24, 2025
@dsherret

Copy link
Copy Markdown
Contributor

I think this is a duplicate of #29555 ?

@meetdhanani17

Copy link
Copy Markdown
Contributor Author

I think this is a duplicate of #29555 ?

no it's different, you can take reference of the code changes

@meetdhanani17 meetdhanani17 changed the title fix: reload environment variables with --watch and --env-file feat: reload environment variables with --watch and --env-file Jul 27, 2025
@meetdhanani17

meetdhanani17 commented Jul 29, 2025 •

Copy link
Copy Markdown
Contributor Author

Hello @dsherret, Could you please guide me with fixes the test cases of pipeline ci / test debug linux-aarch64 (pull_request)?

@dsherret dsherret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! This PR seems to be on the right track.

Comment thread cli/tools/run/mod.rs Resolved
Comment thread cli/util/env_manager.rs Resolved
Comment thread cli/util/env_manager.rs Resolved
Comment thread cli/main.rs Resolved
Comment thread cli/util/env_manager.rs Resolved
Comment thread cli/util/env_manager.rs Resolved
Comment thread cli/util/env_manager.rs Resolved
…e management

- Added WatchEnvTracker to track and manage environment variables loaded from .env files.
- Updated `resolve_flags_and_init` and `run_with_watch` functions to utilize the new tracker.
- Enhanced error handling for loading environment variables from files.
@meetdhanani17
meetdhanani17 requested a review from dsherret August 7, 2025 17:52
@dsherret dsherret modified the milestones: 2.4.0, 2.5.0 Aug 14, 2025
@meetdhanani17

meetdhanani17 commented Aug 15, 2025 •

Copy link
Copy Markdown
Contributor Author

Hello @dsherret, I have already requested the PR review after resolving all the comments. If there are any changes required, please let me know

@dsherret dsherret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

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