Skip to content

Add the base Python environments "watchers".#13735

Merged
ericsnowcurrently merged 8 commits intomicrosoft:masterfrom
ericsnowcurrently:pyenvs-component-base-watchers
Sep 2, 2020
Merged

Add the base Python environments "watchers".#13735
ericsnowcurrently merged 8 commits intomicrosoft:masterfrom
ericsnowcurrently:pyenvs-component-base-watchers

Conversation

@ericsnowcurrently
Copy link
Copy Markdown

The watchers are the event-based part of locators.

(Note that 2/3 of this PR is new tests.)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • [ ] Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • [ ] Has sufficient logging.
  • [ ] Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • [ ] Test plan is updated as appropriate.
  • [ ] package-lock.json has been regenerated by running npm install (if dependencies have changed).
  • [ ] The wiki is updated with any design decisions/details.

@ericsnowcurrently ericsnowcurrently added the no-changelog No news entry required label Sep 1, 2020
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 1, 2020

Codecov Report

Merging #13735 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13735      +/-   ##
==========================================
+ Coverage   59.82%   59.87%   +0.05%     
==========================================
  Files         675      678       +3     
  Lines       37799    37872      +73     
  Branches     5446     5455       +9     
==========================================
+ Hits        22613    22676      +63     
+ Misses      14027    14019       -8     
- Partials     1159     1177      +18     
Impacted Files Coverage Δ
src/client/pythonEnvironments/base/watcher.ts 100.00% <100.00%> (ø)
src/client/pythonEnvironments/base/watchers.ts 100.00% <100.00%> (ø)
src/client/datascience/crossProcessLock.ts 79.41% <0.00%> (-11.77%) ⬇️
src/client/common/utils/platform.ts 56.00% <0.00%> (-4.00%) ⬇️
src/client/linters/pydocstyle.ts 86.66% <0.00%> (-2.23%) ⬇️
src/client/datascience/debugLocationTracker.ts 76.56% <0.00%> (-1.57%) ⬇️
src/client/common/process/proc.ts 14.49% <0.00%> (-0.73%) ⬇️
src/client/common/types.ts 100.00% <0.00%> (ø)
src/client/logging/levels.ts 61.11% <0.00%> (ø)
src/client/logging/logger.ts 62.74% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 761242a...077c6e0. Read the comment docs.

Comment thread src/client/common/utils/misc.ts Outdated
Comment thread src/client/common/utils/misc.ts Outdated
Comment thread src/test/common/utils/misc.unit.test.ts Outdated
Comment thread src/client/common/utils/misc.ts Outdated
@ericsnowcurrently ericsnowcurrently force-pushed the pyenvs-component-base-watchers branch from b9baba8 to b5d60b7 Compare September 2, 2020 16:27
Copy link
Copy Markdown

@kimadeline kimadeline left a comment

Choose a reason for hiding this comment

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

Looks good to me, but there are points I don't understand 😅

Comment thread src/client/pythonEnvironments/base/watcher.ts
Comment thread src/client/pythonEnvironments/base/watchers.ts Outdated
Comment thread src/client/pythonEnvironments/base/watchers.ts
Comment thread src/client/pythonEnvironments/base/watchers.ts Outdated
*
* The same rule-of-thumb for subclassing `WatcherBase` applies here.
*/
export class BasicPythonEnvsWatcher extends WatcherBase<BasicPythonEnvsChangedEvent> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In which use cases would we use a BasicPythonEnvsWatcher instead of a PythonEnvsWatcher? i.e why are we exporting it, is it just for tests?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's for the case that a watcher does not possibly provide non-basic info (currently only searchLocation). That said, it is somewhat of an artifact of an earlier design I was exploring, where the actual locators (not wrappers) were all basic and wrappers provided the non-basic info.

There isn't much cost to leaving BasicPythonEnvsWatcher for now, adding it later would be more painful than removing it later, and my gut is telling me that it will be useful later, so I'd like to leave it. We can circle back on removing it after we have refactored our existing locators. Is there any additional clarification I could put in a comment that would help avoid any confusion about why BasicPythonEnvsWatcher exists?

Comment thread src/client/pythonEnvironments/base/watchers.ts Outdated
Comment thread src/client/pythonEnvironments/base/watchers.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 2, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ericsnowcurrently ericsnowcurrently merged commit 6a3db71 into microsoft:master Sep 2, 2020
@ericsnowcurrently ericsnowcurrently deleted the pyenvs-component-base-watchers branch September 2, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants