MCPcopy Create free account
hub / github.com/apache/arrow / get_current_state

Method get_current_state

dev/archery/archery/bot.py:155–167  ·  view source on GitHub ↗

Returns a PullRequestState with the current PR state label based on label starting with LABEL_PREFIX. If more than one label is found raises EventError. If no label is found returns None.

(self)

Source from the content-addressed store, hash-verified

153 self.set_state(next_state)
154
155 def get_current_state(self):
156 """
157 Returns a PullRequestState with the current PR state label
158 based on label starting with LABEL_PREFIX.
159 If more than one label is found raises EventError.
160 If no label is found returns None.
161 """
162 states = [label.name for label in self.pull.get_labels()
163 if label.name.startswith(LABEL_PREFIX)]
164 if len(states) > 1:
165 raise EventError(f"PR cannot be on more than one states - {states}")
166 elif states:
167 return PullRequestState(states[0])
168
169 def clear_current_state(self):
170 """

Callers 1

handleMethod · 0.95

Calls 3

lenFunction · 0.85
EventErrorClass · 0.85
PullRequestStateClass · 0.85

Tested by

no test coverage detected