Skip to content

jira_sync: re-check the Fixes reference when a PR body changes - #212

Merged
yaronkaikov merged 1 commit into
scylladb:mainfrom
yaronkaikov:fix-releng-81-require-fixes-with-backport-label
Aug 9, 2026
Merged

jira_sync: re-check the Fixes reference when a PR body changes#212
yaronkaikov merged 1 commit into
scylladb:mainfrom
yaronkaikov:fix-releng-81-require-fixes-with-backport-label

Conversation

@yaronkaikov

Copy link
Copy Markdown
Collaborator

Summary

enforce_backport_fixes_reference (RELENG-175) only runs on the labeled event. A PR that was labelled while its body linked a valid issue therefore keeps the backport label even if the reference is later edited away, and the missing Fixes: surfaces only when the backport runs, after the merge — exactly the late, confusing failure RELENG-81 asks us to move to the beginning of the process.

  • New enforce_backport_fixes_on_body_change reads the backport labels currently on the PR and, when at least one backport/<release> label is present, applies the existing enforcement (comment once, strip the backport labels).
  • Wired as step 0 of manage_opened_gh_event, which serves both the opened and edited events. It has to run before step 1, because extract_jira_keys returns early precisely in the case we care about. scylladb's call_jira_sync.yml already sends edited, so no workflow change is needed.
  • PRs with no backport label, or only backport/none, are never asked for a Fixes: reference, so feature and cleanup PRs are unaffected. A failure to read the label list fails open.

Testing

Four new cases in test_enforce_backport_fixes.py: no-label noop, valid reference allowed, reference edited away is enforced, label-lookup failure fails open. Full suite: 448 passed.

Related PRs

Fixes: RELENG-81

@yaronkaikov

yaronkaikov commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full-review

@yaronkaikov

Copy link
Copy Markdown
Collaborator Author

@coderabbitai please review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@yaronkaikov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 1caae8be-38ca-426e-9d5a-e37c182bdee1

📥 Commits

Reviewing files that changed from the base of the PR and between f520ada and 13d66a5.

📒 Files selected for processing (3)
  • .github/tests/test_enforce_backport_fixes.py
  • scripts/jira_sync_logic.py
  • scripts/jira_sync_modules.py

Comment @coderabbitai help to get the list of available commands.

@yaronkaikov
yaronkaikov requested a review from dani-tweig August 9, 2026 14:13

@dani-tweig dani-tweig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One change to consider.

(I didnt go over the test code)

Comment thread scripts/jira_sync_logic.py Outdated
if enforce_backport_fixes_on_body_change(
pr_title, pr_body, pr_number, owner_repo, gh_token, jira_auth,
):
print("Backport label(s) removed: the PR body must link a valid issue before re-labelling.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The message is not clear IMO.

Suggest the following:
"Backport label(s) removed. Please add to the PR body a link ('Fixes:') to a valid Jira issue and only then re-label the PR for backport."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

enforce_backport_fixes_reference only runs on the 'labeled' event, so a PR
that was labelled while its body linked a valid issue keeps the backport
label even if the reference is later edited away. The missing "Fixes:" then
surfaces only when the backport runs, after the merge - exactly the confusing
late failure RELENG-81 asks us to move to the beginning of the process.

Add enforce_backport_fixes_on_body_change, which reads the backport labels
currently on the PR and, when at least one backport/<release> label is
present, applies the same enforcement. Wire it as step 0 of
manage_opened_gh_event, which serves both the 'opened' and 'edited' events,
before extract_jira_keys returns early on a body with no keys.

PRs with no backport label, or only backport/none, are never asked for a
Fixes: reference, so feature and cleanup PRs are unaffected. A failure to
read the label list fails open.

Fixes: RELENG-81

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Fan1bYR7CTpK82DjfedrZ
@yaronkaikov
yaronkaikov force-pushed the fix-releng-81-require-fixes-with-backport-label branch from 13c236b to 13d66a5 Compare August 9, 2026 14:41
@yaronkaikov
yaronkaikov merged commit 8c0e616 into scylladb:main Aug 9, 2026
3 checks passed
@yaronkaikov
yaronkaikov deleted the fix-releng-81-require-fixes-with-backport-label branch August 9, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants