Fix getSnippetHash
not considering all files
#765
Merged
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.
Made a stupid mistake in the previous PR: #759 🤦 🤦. Instead of a
continue
, I put areturn nil
, so whenever a file is already handled, the function doesn't consider other imports in the fileThis fixes it and adds another benchmark test to ensure it doesn't happen again.
I also removed the Github Actions benchmark test, as it's not really useful, anytime we change the tests, we'll get erroneous results which will be annoying.
Instead, I added the benchmark tests to the Drone run, we can compare whenever we want.
Benchmark comparison with v0.22.1:
whereas the same test just fails on the
main
branch. I also verified with our largest projects here at Grafana Labs, and the hashes are now consistent with v0.22.1. Runtime goes from 1.8s to 200ms