eo
eo copied to clipboard
Make HashOfTag testable without accessing web
We need to be able to populate tags with custom values rather than always download it from the web.
@mximp it's hard to imagine how we can make it testable alone, since it's used in PullMojo
by new
. Maybe it's better to introduce new option for PullMojo
, something like: -DofflineHash=*.*.*:a1b2c3d
. Here, *.*.*
means "for any version" and a1b2c3d
is the version that it has to return. Then, we just create a fake implementation of HashOfTag
, which is created if this offlineHash
option is provided, and used instead of a regular HashOfTag
. WDYT?
@yegor256 great idea. The only thing I would make this property to contain a list of such mappings: -DofflineHash="0.2.7:abc2sd3,0.2.8:s4se2fe"
so that we can simulate any content of tags.txt
.
Or even make this property to be a file path for custom tags file.
@mximp yes, a list sounds like a good idea. A file too:
"-DofflineHash=0.*.*:abc2sd3"
"-DofflineHash=0.2.7:abc2sd3,0.2.8:s4se2fe"
"-DofflineHashFile=hello.tags"
@mximp I suggest assigning this to someone
@Nypiaka please assist with the implementation
@yasamprom please assist
@volodya-lombrozo please take this.
@mximp the puzzle #1374 is still not solved.
@mximp we can close it