Skip to content

Conversation

AnOtterGithubUser
Copy link

Hello,
I added a new flag --include-all-tags that works with --tags options to get the behavior requested in #1466
Default flag value is set to false to keep existing behavior unchanged

@google-cla
Copy link

google-cla bot commented Mar 11, 2023

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.

Copy link
Contributor

@Ekrekr Ekrekr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"include all" is ambiguous in semantic meaning - IMO something like filterTagsAsIntersection would be better as it's more explicit.

Comment on lines +412 to +417
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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Keep actions with include at least one tag in --tag option
// Select actions which match the union of the set of tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants