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

Don't automatically mark the parent job as SUCCESS #148

Merged
merged 1 commit into from
Nov 12, 2020
Merged

Don't automatically mark the parent job as SUCCESS #148

merged 1 commit into from
Nov 12, 2020

Conversation

danudey
Copy link
Contributor

@danudey danudey commented Nov 7, 2020

When this plugin is used to call another job during the build or pre-scm build stages, and the user chooses to block on the job until it's completed, this plugin sets the parent job status to "SUCCESS", even though there should be no assumption that the success of the child job mandates success of the parent job.

Example:

  1. Job A -> enables "Run buildstep before SCM runs" and adds a "Trigger/call builds on other projects" step, to call Job B
  2. Job B completes successfully.
  3. The parameterized trigger plugin sets the result of Job A to "SUCCESS" even though nothing that's happened so far indicates that Job A is "SUCCESS".

This can cause strange issues in a few cases; for example, the extended e-mail notifier plugin can send e-mails at various stages, including "immediately before the build starts". We have an e-mail template that goes out to developers, and we include ${BUILD_STATUS} in the template, but because of this behaviour in this plugin, the "Your build has started" e-mail tells them that the build is a success; when they go to view the job, it's not finished, and they're left wondering why they got an e-mail saying success when it's not successful.

While the user can customize marking the build as failed, as a failure, or as unstable, there's no option for the user to choose to mark the current build as success; furthermore, I don't think that marking the build as a success so early in the build process necessarily makes sense, but I could be mistaken.

@olamy
Copy link
Member

olamy commented Nov 11, 2020

Sounds a nice. Any simple test to ensure this doesn't get change in the future?

@olamy olamy merged commit 02ee6ea into jenkinsci:master Nov 12, 2020
hashar added a commit to hashar/parameterized-trigger-plugin that referenced this pull request Apr 10, 2024
I keep having log messages such as:

  WARNING: [hudson.plugins.parameterizedtrigger.TriggerBuilder perform]
  Attempting to use the result of unfinished build <name of job> #1234

The message was introduced in jenkinsci#161 by 06d8f19 but in jenkinsci#148 / 02ee6ea,
mapBuildResult() was made to return `null` by default (eg on SUCCESS).

The resut is the warning is always triggered when the triggered build
succeeds.

Fixes https://phabricator.wikimedia.org/T336782
MarkEWaite added a commit that referenced this pull request May 7, 2024
I keep having log messages such as:

  WARNING: [hudson.plugins.parameterizedtrigger.TriggerBuilder perform]
  Attempting to use the result of unfinished build <name of job> #1234

The message was introduced in #161 by 06d8f19 but in #148 / 02ee6ea,
mapBuildResult() was made to return `null` by default (eg on SUCCESS).

The resut is the warning is always triggered when the triggered build
succeeds.

Fixes https://phabricator.wikimedia.org/T336782

Co-authored-by: Mark Waite <[email protected]>
Co-authored-by: Bruno Verachten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants