(self, suppress_mail=True)
| 321 | return False |
| 322 | |
| 323 | def get_update_payload(self, suppress_mail=True): # Added suppress_mail parameter |
| 324 | today = datetime.now(timezone.utc).isoformat(timespec='seconds') |
| 325 | self.add_or_update_custom_field(REDMINE_CUSTOM_FIELD_ID_UPKEEP_TIMESTAMP, today) |
| 326 | |
| 327 | current_tags_str = self.get_custom_field(REDMINE_CUSTOM_FIELD_ID_TAGS) |
| 328 | current_tags = [] |
| 329 | if current_tags_str: |
| 330 | current_tags = [tag.strip() for tag in current_tags_str.split(',') if tag.strip()] |
| 331 | if "upkeep-failed" in current_tags: |
| 332 | self.logger.info(f"'upkeep-failed' tag found in '{current_tags_str}'. Removing for update.") |
| 333 | current_tags.remove("upkeep-failed") |
| 334 | self.add_or_update_custom_field(REDMINE_CUSTOM_FIELD_ID_TAGS, ", ".join(current_tags)) |
| 335 | |
| 336 | payload = { |
| 337 | 'issue': self.update_payload, |
| 338 | } |
| 339 | if suppress_mail: |
| 340 | payload['suppress_mail'] = "1" |
| 341 | return payload |
| 342 | |
| 343 | def get_pr_id(self): |
| 344 | self.logger.debug("Attempting to fetch PR data.") |
no test coverage detected