@@ -22,10 +22,13 @@ class QueryValidator
2222
2323 TAG_SELECTORS = %i[ tag ] . freeze
2424
25+ COMMITFEST_SELECTORS = %i[ commitfest ]
26+
2527 ALL_SELECTORS = ( DATE_SELECTORS + COUNT_SELECTORS + AUTHOR_SELECTORS +
26- STATE_SELECTORS + CONTENT_SELECTORS + TAG_SELECTORS + [ :has ] ) . freeze
28+ STATE_SELECTORS + CONTENT_SELECTORS + TAG_SELECTORS +
29+ COMMITFEST_SELECTORS + [ :has ] ) . freeze
2730
28- HAS_VALUES = %w[ attachment patch contributor committer core_team ] . freeze
31+ HAS_VALUES = %w[ attachment patch contributor committer core_team commitfest ] . freeze
2932
3033 # Valid sub-conditions for each parent selector
3134 VALID_SUB_CONDITIONS = {
@@ -34,7 +37,8 @@ class QueryValidator
3437 attachment : %i[ from count name ] ,
3538 patch : %i[ from count ]
3639 } ,
37- tag : %i[ from added_before added_after ]
40+ tag : %i[ from added_before added_after ] ,
41+ commitfest : %i[ name status tag ]
3842 } . freeze
3943
4044 # Sub-condition keywords that require date values
@@ -104,6 +108,8 @@ def validate_selector(node)
104108 validate_content_selector ( node )
105109 when *TAG_SELECTORS
106110 validate_tag_selector ( node )
111+ when *COMMITFEST_SELECTORS
112+ validate_commitfest_selector ( node )
107113 when :has
108114 validate_has_selector ( node )
109115 else
@@ -124,7 +130,7 @@ def validate_selector(node)
124130
125131 def supports_empty_value_with_conditions? ( key , conditions )
126132 # tag: can have empty value with conditions (e.g., tag:[from:me])
127- key == :tag && conditions . present?
133+ key . in? ( [ :tag , :commitfest ] ) && conditions . present?
128134 end
129135
130136 def validate_conditions ( parent_key , parent_value , conditions )
@@ -182,6 +188,8 @@ def get_valid_sub_conditions(parent_key, parent_value)
182188 has_conditions [ normalized_value ] || [ ]
183189 when :tag
184190 VALID_SUB_CONDITIONS [ :tag ] || [ ]
191+ when :commitfest
192+ VALID_SUB_CONDITIONS [ :commitfest ] || [ ]
185193 else
186194 [ ]
187195 end
@@ -252,6 +260,10 @@ def validate_tag_selector(node)
252260 node
253261 end
254262
263+ def validate_commitfest_selector ( node )
264+ node
265+ end
266+
255267 def validate_has_selector ( node )
256268 value = node [ :value ] . to_s . downcase
257269
0 commit comments