Fix info overwriting when retrieving from cache#472
Merged
rnjudge merged 1 commit intotern-tools:masterfrom Oct 16, 2019
Merged
Fix info overwriting when retrieving from cache#472rnjudge merged 1 commit intotern-tools:masterfrom
rnjudge merged 1 commit intotern-tools:masterfrom
Conversation
When checking to see if information about an image layer is already cached, the tool will record that information in a notice. When the cache gets saved at the end of a run, all the notices recorded when the layer was first processed gets overwritten by the new notice which just informs you that it got the information about the layer from the cache. This change fixes this bug. - Remove the recording of the notice that the tool has pulled information from the cache. It's enough if the tool just logs that event. - Along with loading the package information from the cache into the layer object, also load the notices. Added a new function to load the notices from the cache. - For the Origin's class method add_notice_origin, check first if the origin string already exists in the list of notice origin objects before adding it. This prevents multiple instances of the class with the same origin string. - Made some changes to the message format to make it more understandable about what method the tool used to get the information - Added a function to cache.py to retrieve the 'origins' part of the cache which will be used in the load_notices_from_cache function in common.py Resolves tern-tools#466 Signed-off-by: Nisha K <nishak@vmware.com>
Contributor
Author
|
Tested on my end using: |
rnjudge
approved these changes
Oct 16, 2019
Contributor
|
Overwriting the cache had always bothered me running Tern. Thanks for the fix! |
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.
When checking to see if information about an image layer is already
cached, the tool will record that information in a notice. When the
cache gets saved at the end of a run, all the notices recorded when
the layer was first processed gets overwritten by the new notice
which just informs you that it got the information about the layer
from the cache. This change fixes this bug.
information from the cache. It's enough if the tool just logs that
event.
the layer object, also load the notices. Added a new function to
load the notices from the cache.
the origin string already exists in the list of notice origin
objects before adding it. This prevents multiple instances of the
class with the same origin string.
understandable about what method the tool used to get the
information
the cache which will be used in the load_notices_from_cache
function in common.py
Resolves #466
Signed-off-by: Nisha K nishak@vmware.com