Redis actions extension. Hash commands.#1550
Conversation
| .mapNotNull { cmd -> | ||
| when (cmd.command) { | ||
| "GET" -> { | ||
| val keyGene = StringGene("key", cmd.key) |
There was a problem hiding this comment.
hi! bit confused here. is keyGene supposed to be a constant? or something that be modified during the search? In former case, shouldn't use a gene for it, but directly a val stirng in the action. In latter case, the value cmd.key will be lost as soon as the action is initialized
| "GET" -> { | ||
| val keyGene = StringGene("key", cmd.key) | ||
| val valueGene = StringGene("value").also { | ||
| it.randomize(randomness, false) |
There was a problem hiding this comment.
those calls to it.randomize might be redundant, as might be called again when intializing the action
| } | ||
| "KEYS" -> { | ||
| val keyGene = StringGene("key").also { | ||
| it.addSpecializations("key", |
There was a problem hiding this comment.
this is a bit confusing. specialzations is for Taint Analysis handling. if here you already know it is going to be a regex, why not using a RegexGene directly? Or is just a matter of typing in the action? note that specialization can be deactivated during the search
| it.addSpecializations("key", | ||
| listOf(StringSpecializationInfo(StringSpecialization.REGEX_WHOLE, cmd.pattern)), | ||
| randomness, | ||
| updateGlobalInfo = false, // should this be false? |
There was a problem hiding this comment.
yes. otherwise it crash, as you are adding a specialization to a gene that is not mount yet inside an Individual
| valueGene = valueGene | ||
| ) | ||
| } | ||
| else -> { |
There was a problem hiding this comment.
add a LoggingUtils.uniqueWarn here, as well as a assert(false), to make it crash if it happens in any test case
Redis hash commands HGET and HGETALL are now included in the data generation process, generating RedisHsetActions.
Since RedisDbAction has now multiple concrete subclasses, the impact collection system was failing to match actions by class name across mutations. Added getImpactGroupKey() to Action — overridden in RedisDbAction to return a shared key for all its subtypes — and updated ImpactUtils and EvaluatedIndividual to use it instead of the raw class name.