Conversation
There was a problem hiding this comment.
Code Review
This pull request adds backward compatibility for test filters by reading from release-test-attr-regex-filters as a fallback to release-test-filters. The change is correct, but it continues a pattern of overwriting filters which can be problematic. I've added a comment with a suggestion to merge filters instead, which would make the filtering logic more robust and intuitive.
| if test_name_filter: | ||
| settings["test_filters"] = get_test_filters("name:" + test_name_filter) | ||
|
|
||
| test_filters = get_buildkite_prompt_value("release-test-filters") | ||
| test_filters = get_buildkite_prompt_value( | ||
| "release-test-filters" | ||
| ) or get_buildkite_prompt_value("release-test-attr-regex-filters") | ||
| if test_filters: | ||
| settings["test_filters"] = get_test_filters(test_filters) |
There was a problem hiding this comment.
The current logic overwrites test_filters if multiple filter sources are provided (e.g., release-test-name and release-test-filters). This can lead to unexpected behavior if a user intends for the filters to be combined. For example, if release-test-name is set to 'test_A' and release-test-filters is set to 'team:core', only the 'team:core' filter will be applied. The filter on the test name will be lost.
While this overwriting pattern is also present in update_settings_from_environment, it would be more robust and less error-prone to merge the filters. This would allow for more complex and intuitive filtering.
I suggest refactoring this block to ensure filters are merged. The proposed change also handles potential string values for test_filters coming from update_settings_from_environment and improves code formatting for readability.
| if test_name_filter: | |
| settings["test_filters"] = get_test_filters("name:" + test_name_filter) | |
| test_filters = get_buildkite_prompt_value("release-test-filters") | |
| test_filters = get_buildkite_prompt_value( | |
| "release-test-filters" | |
| ) or get_buildkite_prompt_value("release-test-attr-regex-filters") | |
| if test_filters: | |
| settings["test_filters"] = get_test_filters(test_filters) | |
| # Ensure test_filters is a dictionary to allow merging. | |
| if not isinstance(settings.get("test_filters"), dict): | |
| settings["test_filters"] = get_test_filters(settings.get("test_filters") or "") | |
| if test_name_filter: | |
| settings["test_filters"].update(get_test_filters("name:" + test_name_filter)) | |
| test_filters_str = ( | |
| get_buildkite_prompt_value("release-test-filters") | |
| or get_buildkite_prompt_value("release-test-attr-regex-filters") | |
| ) | |
| if test_filters_str: | |
| settings["test_filters"].update(get_test_filters(test_filters_str)) |
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: Gang Zhao <gang@gang-JQ62HD2C37.local>
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: sampan <sampan@anyscale.com>
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: jugalshah291 <shah.jugal291@gmail.com>
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: yenhong.wong <yenhong.wong@grabtaxi.com>
…e-test-attr-regex-filters (#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
…e-test-attr-regex-filters (ray-project#56039) `release-test-attr-regex-filters` is the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after adding `release-test-filters` Signed-off-by: kevin <kevin@anyscale.com>
release-test-attr-regex-filtersis the metadata being used in the input box for Release pipeline which we need to make it backward compatible still after addingrelease-test-filters