Skip to content

Conversation

@Jazzcort
Copy link
Collaborator

This patch extends the supervisor to handle those issues without errata link. We now fetch issues that contain labels in the following set:

  • "jotnar_merged": Check if the MR has been merge for more than 24 hours, if yes, flag attention. Otherwise, reschedule it for 1 hour in the future.
  • "jotnar_backported" and "jotnar_rebased": Check if the MR has been merged, if yes, label it "jotnar_merged". Otherwise, reschedule it for 3 hours in the future.

Copy link
Collaborator

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks along the lines I was thinking, some assorted comments.


def resolve_wait(self, why: str):
return WorkflowResult(status=why, reschedule_in=WAIT_DELAY)
def resolve_wait(self, why: str, *, reschedule_in: float | None = None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more transparent to do reschedule_in: float = WAIT_DELAY

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! What I did here is totally unnecessary. 😅

"""
async def run_before_errata_created(self) -> WorkflowResult:
issue = self.issue
labels_set = set(issue.labels)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The set of labels should be small enough that a few linear scans of if "jotnar_merged" in labels won't matter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change!

logger.info("Running workflow for issue %s", issue.url)
else:
# TODO: We should not encounter this scenario
raise ValueError(f"Issue without target labels: {issue.labels}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things may have changed between when the collector runs and when an issue is processed, so the general structure of a handler is:

  • Check if it still is matching the collector query
    • If not, call resolve_remove_work_item()
    • If yes, do stuff

(This actually implies to me that the collector should check for backported, rebased, or merged labels, since it's weird to me if the backported/rebased labels are removed but the merged label is left that we'd stop processing.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! I'll change this to call resolve_remove_work_item(). 😁

# add_issue_label(
# issue.key,
# "jotnar_merged",
# "MR has been merged",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a particularly useful comment ... we don't need to have a comment, but I think in this case it would be useful, along the lines:

A [merge request| https://...]. resolving this issue has been merged; waiting for errata creation and final testing.

One thing that I'm thinking about is that it's quite possible and even normal for errata creation to happen before we get here; if we don't set the jotnar_merged label in that case, then we're going to make "dashboard" JIRA queries harder. So, I think we could have a function that if backported/rebased is set but not merged, checks for merged MR's and sets the merged flag, and call that from both branches.

It probably doesn't need to requeue - it can probably just set the label and let processing continue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll work on creating this function.

It probably doesn't need to requeue - it can probably just set the label and let processing continue.

I'll change to to call resolve_remove_work_item instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant "just do whatever would happen next on the requeue immediately" - not remove the work item.

@Jazzcort Jazzcort force-pushed the handle-issues-with-no-errata branch from 44b851b to 8feedde Compare October 16, 2025 18:50
@Jazzcort Jazzcort marked this pull request as ready for review October 16, 2025 18:54
Copy link
Collaborator Author

@Jazzcort Jazzcort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owtaylor Marked a few places where I need your advice! Please let me know if there are any changes needed! Thanks! 😁

@Jazzcort Jazzcort force-pushed the handle-issues-with-no-errata branch from 8feedde to 793f1b1 Compare October 21, 2025 15:12
@Jazzcort Jazzcort requested a review from owtaylor October 21, 2025 15:17
@Jazzcort Jazzcort force-pushed the handle-issues-with-no-errata branch from 793f1b1 to b94aba9 Compare October 21, 2025 15:42
Copy link
Collaborator

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can tighten it up for organization a bit more.

@Jazzcort Jazzcort force-pushed the handle-issues-with-no-errata branch from b94aba9 to 878ddcf Compare October 21, 2025 19:24
@Jazzcort Jazzcort requested a review from owtaylor October 21, 2025 19:46
Copy link
Collaborator

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting down to the small stuff! It's looking geat.

This patch extends the supervisor to handle those issues without errata link.
We now fetch issues that contain labels in the following set:
  - "jotnar_merged": Check if the MR has been merge for more than 24 hours,
     if yes, flag attention. Otherwise, reschedule it for 1 hour in the
     future.
  - "jotnar_backported": Check if the MR has been merged, if yes, label it
    "jotnar_merged". Otherwise, reschedule it for 3 hours in the future.
  - "jotnar_rebased": Same as "jotnar_backported".
@Jazzcort Jazzcort force-pushed the handle-issues-with-no-errata branch from 878ddcf to b3d2452 Compare October 22, 2025 16:54
@Jazzcort Jazzcort requested a review from owtaylor October 22, 2025 16:54
Copy link
Collaborator

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@Jazzcort
Copy link
Collaborator Author

Thanks for the review! 😁

@Jazzcort Jazzcort merged commit 863126e into packit:main Oct 22, 2025
6 checks passed
@Jazzcort Jazzcort deleted the handle-issues-with-no-errata branch October 24, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants