Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rayci] support select & tag together as a filter #234

Merged
merged 2 commits into from
May 9, 2024

Conversation

can-anyscale
Copy link
Collaborator

If both selects and tags are provided as a filter, select nodes based on both filtering. I need this for using select in microcheck, otherwise we will incur costs by saving all microcheck tests on PR. Let me know if there is a better alternative.

Test:

  • CI

@can-anyscale can-anyscale requested review from aslonnie and khluu May 8, 2024 21:24
Comment on lines 63 to 75
func newSelectAndTagsStepFilter(
skipTags []string, selects []string, filterCmd []string,
) (*stepFilter, error) {
select_filter := newSelectStepFilter(skipTags, selects)
tag_filter, err := newTagsStepFilter(skipTags, filterCmd)

return &stepFilter{
skipTags: skipTags,
selects: select_filter.selects,
runAll: tag_filter.runAll,
tags: tag_filter.tags,
}, err
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

so, maybe just do this:

  • have a newStepFilter that takes selects and tags
  • rename newTagsStepFilter into stepFilterFromCmd, and when it gets the tags, call newStepFilter()?

@@ -22,12 +22,29 @@ func (f *stepFilter) reject(step *stepNode) bool {
}

func (f *stepFilter) accept(step *stepNode) bool {
if f.selects != nil && f.tags != nil {
// in both key selection mode, hit when the step has both keys and tags
return f.acceptSelectHit(step) && f.acceptTagHit(step)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel that we can make this function always return:

f.acceptSelectHit(step) && f.acceptTagHit(step)

and treat missing selects always as return true?

probably needs to change the runAll field in the stepFilter into runAllTags now, as it semantically only applies to tags selection.

@can-anyscale can-anyscale force-pushed the can-select-and-tag-filter branch from dec277f to ac6c079 Compare May 9, 2024 02:20
@can-anyscale
Copy link
Collaborator Author

@aslonnie's comments, combining both tag and select filter

@can-anyscale can-anyscale requested a review from aslonnie May 9, 2024 02:21
Copy link
Collaborator

@aslonnie aslonnie left a comment

Choose a reason for hiding this comment

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

I will let this in to unblock your work. I might follow up with some more refactoring later for the code styling.

@can-anyscale
Copy link
Collaborator Author

let's go!

@can-anyscale can-anyscale merged commit ce9e1da into main May 9, 2024
1 check passed
@can-anyscale can-anyscale deleted the can-select-and-tag-filter branch May 9, 2024 19:35
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