[#1466] Filter intersection of tags#1467
[#1466] Filter intersection of tags#1467AnOtterGithubUser wants to merge 4 commits intodataform-co:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Ekrekr
left a comment
There was a problem hiding this comment.
Sorry that this went under the radar for so long! It just needs a sync and a few nits, then we can get this in.
| message RunConfig { | ||
| repeated string actions = 1; | ||
| repeated string tags = 5; | ||
| bool include_all_tags = 10; |
There was a problem hiding this comment.
"include all" is ambiguous in semantic meaning - IMO something like filterTagsAsIntersection would be better as it's more explicit.
| expect(actionNames).includes("schema.op_e"); | ||
| expect(actionNames).includes("schema.tab_a"); | ||
| expect(actionNames).not.includes("schema.op_a"); | ||
| expect(actionNames).not.includes("schema.op_b"); | ||
| expect(actionNames).not.includes("schema.op_c"); | ||
| expect(actionNames).not.includes("schema.op_d"); |
There was a problem hiding this comment.
This would be better as expect(actionNames).deep.equals(["schema.op_e", "schema.op_a"]);
| allActions | ||
| .filter(action => action.tags.some(tag => runConfig.tags.includes(tag))) | ||
| .forEach(action => includedActionNames.add(targetAsReadableString(action.target))); | ||
| // Keep actions wich include every tags in --tag option |
There was a problem hiding this comment.
| // Keep actions wich include every tags in --tag option | |
| // Select actions which match the intersection of the set of tags. |
| .filter(action => runConfig.tags.every(tag => action.tags.includes(tag))) | ||
| .forEach(action => includedActionNames.add(targetAsReadableString(action.target))); | ||
| } | ||
| // Keep actions with include at least one tag in --tag option |
There was a problem hiding this comment.
| // Keep actions with include at least one tag in --tag option | |
| // Select actions which match the union of the set of tags. |
Hello,
I added a new flag
--include-all-tagsthat works with--tagsoptions to get the behavior requested in #1466Default flag value is set to false to keep existing behavior unchanged