Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-49777] Abort running build if Gerrit patchset is abandoned #483

Merged
merged 5 commits into from Feb 24, 2023
Merged

[JENKINS-49777] Abort running build if Gerrit patchset is abandoned #483

merged 5 commits into from Feb 24, 2023

Conversation

ckreisl
Copy link
Contributor

@ckreisl ckreisl commented Jan 12, 2023

Related to JENKINS-49777.

Providing an option to abort running builds if the patchset is abandoned by the developer in the meantime on Gerrit side.
Since the current implementation of the Gerrit Trigger plugin takes events and processes them by checking whether a build should be triggered or not the order now has slightly changed.

Within the EventListener after checking whether the event is of interest we first abort the build(s) and check whether the event should re-trigger another build.

Note: One open point might be the feedback back to Gerrit. Right now if a Gerrit patchset has the state "change-closed" (Abandoned / Merged) the feedback via SSH raises an Exception due to this fact and not comment nor feedback is provided.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Initial implemented logic to abort
running builds if the related
patchset is abandoned in Gerrit
* fix event not added to running jobs if 'retriggered'
* add new interruption cause
@rsandell rsandell merged commit c778a14 into jenkinsci:master Feb 24, 2023
@ckreisl ckreisl deleted the feature-abort-abandoned-patchsets branch February 24, 2023 21:04
@basil
Copy link
Member

basil commented Jun 6, 2023

Causes a regression; see JENKINS-61928 and JENKINS-71328.

@ckreisl
Copy link
Contributor Author

ckreisl commented Jun 11, 2023

Causes a regression; see JENKINS-61928 and JENKINS-71328.

Checked it on my end. The NPE which breaks everything right now is related to: sonyxperiadev/gerrit-events#119 .

The patchset information is "null" which results in a not valid gerrit query in the ParameterExpander class.

The build is still triggered but sending the commands back to Gerrit runs into the NPE as mentioned in the linked issue which results in not adding any build started nor stopped comments on the Gerrit side.

Tested Plugin vers. 2.39.0 and 2.38.1.
Gerrit vers. 3.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants