if not main_trackers:
log.warning(f"Failed to find any main trackers for PR #{orig_pr} ({pr_url})")
- irregularities.append(f"**Orphaned Main PR:** Could not find a Redmine tracker for `main` PR #{orig_pr}. Please create a ticket, set its 'Pull Request ID', populate the 'Backports' field, and ensure it is in the 'Pending Backport' state.")
+ irregularities.append(f"**Orphaned Main PR:** Could not find a Redmine tracker for `main` PR #{orig_pr}. Please create a ticket, set its 'Pull Request ID', populate the 'Backport' field, and ensure it is in the 'Pending Backport' state.")
continue
for main_tracker in main_trackers:
if not bp_trackers:
log.warning(f"No backport trackers found for main tracker #{main_tracker.id} ({REDMINE_ENDPOINT}/issues/{main_tracker.id}) targeting base '{base}'")
- irregularities.append(f"**Missing Backport Tracker:** Main tracker [#{main_tracker.id}]({REDMINE_ENDPOINT}/issues/{main_tracker.id}) does not have a backport tracker for `{base}`. Please adjust the 'Backports' field on the main tracker appropriately and remove 'backport_processed' from 'Tags (freeform)'.")
+ irregularities.append(f"**Missing Backport Tracker:** Main tracker [#{main_tracker.id}]({REDMINE_ENDPOINT}/issues/{main_tracker.id}) does not have a backport tracker for `{base}`. Please adjust the 'Backport' field on the main tracker appropriately and remove 'backport_processed' from 'Tags (freeform)'.")
continue
for bp_tracker in bp_trackers:
def _transform_set_status_on_merge(self, issue_update):
"""
Transformation: Updates the status of an issue after its associated PR is merged.
- If the 'Backports' field contains entries, sets status to 'Pending Backport'.
- If 'Backports' is empty, sets status to 'Resolved'.
+ If the 'Backport' field contains entries, sets status to 'Pending Backport'.
+ If 'Backport' is empty, sets status to 'Resolved'.
"""
issue_update.logger.debug("Running _transform_set_status_on_merge")
backports_list = [bp.strip() for bp in (backports_field_value or "").split(',') if bp.strip()]
if backports_list:
- # If 'Backports' field has entries, move to PENDING_BACKPORT
+ # If 'Backport' field has entries, move to PENDING_BACKPORT
if current_status_id != REDMINE_STATUS_ID_PENDING_BACKPORT:
issue_update.logger.info(f"Backports defined: {backports_list}. Setting status to 'Pending Backport'.")
return issue_update.change_field('status_id', REDMINE_STATUS_ID_PENDING_BACKPORT)
issue_update.logger.info("Status is already 'Pending Backport'. No change needed.")
return False
else:
- # If 'Backports' field is empty, move to RESOLVED
+ # If 'Backport' field is empty, move to RESOLVED
if current_status_id != REDMINE_STATUS_ID_RESOLVED:
issue_update.logger.info("No backports defined. Setting status to 'Resolved'.")