2727@dataclass
2828class State :
2929 dry_run : bool = False
30+ ignore_needs_attention : bool = False
3031
3132
3233app_state = State ()
@@ -108,7 +109,11 @@ async def process_once(queue: WorkQueue):
108109
109110 if work_item .item_type == WorkItemType .PROCESS_ISSUE :
110111 issue = get_issue (work_item .item_data , full = True )
111- result = await IssueHandler (issue , dry_run = app_state .dry_run ).run ()
112+ result = await IssueHandler (
113+ issue ,
114+ dry_run = app_state .dry_run ,
115+ ignore_needs_attention = app_state .ignore_needs_attention ,
116+ ).run ()
112117 if result .reschedule_in >= 0 :
113118 await queue .schedule_work_items ([work_item ], delay = result .reschedule_in )
114119 else :
@@ -122,7 +127,11 @@ async def process_once(queue: WorkQueue):
122127 )
123128 elif work_item .item_type == WorkItemType .PROCESS_ERRATUM :
124129 erratum = get_erratum (work_item .item_data )
125- result = await ErratumHandler (erratum , dry_run = app_state .dry_run ).run ()
130+ result = await ErratumHandler (
131+ erratum ,
132+ dry_run = app_state .dry_run ,
133+ ignore_needs_attention = app_state .ignore_needs_attention ,
134+ ).run ()
126135 if result .reschedule_in >= 0 :
127136 await queue .schedule_work_items ([work_item ], delay = result .reschedule_in )
128137 else :
@@ -163,7 +172,11 @@ async def do_process_issue(key: str):
163172 await init_kerberos_ticket ()
164173
165174 issue = get_issue (key , full = True )
166- result = await IssueHandler (issue , dry_run = app_state .dry_run ).run ()
175+ result = await IssueHandler (
176+ issue ,
177+ dry_run = app_state .dry_run ,
178+ ignore_needs_attention = app_state .ignore_needs_attention ,
179+ ).run ()
167180 logger .info (
168181 "Issue %s processed, status=%s, reschedule_in=%s" ,
169182 key ,
@@ -197,7 +210,11 @@ async def do_process_erratum(id: str):
197210 await init_kerberos_ticket ()
198211
199212 erratum = get_erratum (id )
200- result = await ErratumHandler (erratum , dry_run = app_state .dry_run ).run ()
213+ result = await ErratumHandler (
214+ erratum ,
215+ dry_run = app_state .dry_run ,
216+ ignore_needs_attention = app_state .ignore_needs_attention ,
217+ ).run ()
201218
202219 logger .info (
203220 "Erratum %s (%s) processed, status=%s, reschedule_in=%s" ,
@@ -228,8 +245,9 @@ def process_erratum(id_or_url: str):
228245@app .callback ()
229246def main (
230247 debug : bool = typer .Option (False , help = "Enable debug mode." ),
231- dry_run : bool = typer .Option (
232- False , "--dry-run" , help = "Don't actually change anything."
248+ dry_run : bool = typer .Option (False , help = "Don't actually change anything." ),
249+ ignore_needs_attention : bool = typer .Option (
250+ False , help = "Process issues or errata flagged with jotnar_needs_attention."
233251 ),
234252):
235253 if debug :
@@ -240,6 +258,7 @@ def main(
240258 logging .basicConfig (level = logging .INFO )
241259
242260 app_state .dry_run = dry_run
261+ app_state .ignore_needs_attention = ignore_needs_attention
243262
244263 collector_endpoint = os .environ .get ("COLLECTOR_ENDPOINT" )
245264 if collector_endpoint is not None :
0 commit comments