Currently, every time graph test command is executed, graph-cli will check for the latest matchstick version tag, which is an overkill and unnecessary. Possible solution is to use a file-based cache.
Proposal:
Save the request response to a file, for example latest.json in the <tests_folder>/.cache/ or node_modules/.cache/.
Save either the whole response or only the tag_name and a timestamp when the request has been made
When graph test is executed fetch the tag version from latest.json.
Set a time period after which the cache will "expire", e.g 6 hour, one day, every couple of days (will be discussed)
If the file does not exists/is empty, or the the cache has "expired", make a new request and save the response.
Skip the latest version tag request at all if a version is passed with the -v flag
If the request fails for some reason, fallback to the cache even if it has "expired"
Currently, every time
graph test
command is executed, graph-cli will check for the latest matchstick version tag, which is an overkill and unnecessary. Possible solution is to use a file-based cache.Proposal:
latest.json
in the<tests_folder>/.cache/
ornode_modules/.cache/
.tag_name
and a timestamp when the request has been madegraph test
is executed fetch the tag version fromlatest.json
.-v
flag