Do not add to env cache if already present#15108
Merged
Merged
Conversation
|
See #15109 for the linting fix |
Codecov Report
@@ Coverage Diff @@
## main #15108 +/- ##
======================================
Coverage 65% 65%
======================================
Files 557 558 +1
Lines 26220 26226 +6
Branches 3729 3725 -4
======================================
+ Hits 17061 17074 +13
+ Misses 8463 8460 -3
+ Partials 696 692 -4
|
kimadeline
approved these changes
Jan 8, 2021
karrtikr
commented
Jan 8, 2021
Comment on lines
+58
to
+72
| /** | ||
| * If the cache has been activated, return environment info objects that match a env. | ||
| * If none of the environments in the cache match the env, return an empty array. | ||
| */ | ||
| private filterMatchingEnvsFromCache(env: string | PythonEnvInfo): PythonEnvInfo[] { | ||
| // If necessary we could be more aggressive about invalidating | ||
| // the cached value. | ||
| const query = getMinimalPartialInfo(env); | ||
| if (query === undefined) { | ||
| return []; | ||
| } | ||
| const candidates = this.cache.filterEnvs(query); | ||
| return candidates !== undefined && candidates.length > 0 ? candidates : []; | ||
| } | ||
|
|
Author
There was a problem hiding this comment.
@kimadeline Ideally this is the filterEnvs the cache should have exposed instead of the one it does.
karthiknadig
approved these changes
Jan 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For: Dups envs showing up when creating env in workspace on Windows
Environment was being added to cache list midway, and then was again pushed to list. So duplicate entries for the same env were showing up.
Linting errors not related to the PR.