Failed builds hide Project action

80 views
Skip to first unread message

fkp...@gmail.com

unread,
Nov 1, 2016, 2:26:28 AM11/1/16
to Jenkins Developers
Hi,
I've noticed on my plugin that if all the builds marked as failed than the project actions won't show up, even though it should be visible since the file were copied and it failed only due to tests.
We mark the build failed due to a use case that wants to mark the build failed if our tests failed.

I've noticed to happen also with TestResultProjectAction of the JUnit plugin.

Is it a defect or feature? :)
any suggestions on how to solve this?

Jesse Glick

unread,
Nov 1, 2016, 9:54:34 AM11/1/16
to Jenkins Dev
On Tue, Nov 1, 2016 at 2:26 AM, <fkp...@gmail.com> wrote:
> I've noticed on my plugin that if all the builds marked as failed than the
> project actions won't show up, even though it should be visible since the
> file were copied and it failed only due to tests.

Then you should mark the build unstable, not failed.

> I've noticed to happen also with TestResultProjectAction of the JUnit
> plugin.
>
> Is it a defect or feature?

Feature generally. See:

https://github.com/jenkinsci/jenkins/blob/8242e0eb1625454ae5539c444c8d8ecf99a70b62/core/src/main/java/jenkins/tasks/SimpleBuildStep.java#L119-L121

Fima

unread,
Nov 2, 2016, 2:43:56 AM11/2/16
to Jenkins Dev
Thanks!
1. Why look at the last successful and not the last builds?
2. Why it doesn't effect actions added by the transient factory?
3. Is it open for a change? By the "TOD"O mark I understand that it waits for a contributions ?
so I can make It can check for last completed check if results were or actions were recorded and use replace actions to add them instead of relaying on latest successful?

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/j38TfS6ymJ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2Drf%2B9eLpsiQF9p92MY8oLJGg0r3hUYf6pAepYDv56Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

fkp...@gmail.com

unread,
Nov 2, 2016, 8:32:12 AM11/2/16
to Jenkins Developers
Moreover, sometimes customers will prefer the build to fail after some failed load test.

And it seem to affect stage view also (aborted builds).

Ullrich Hafner

unread,
Nov 2, 2016, 9:05:32 AM11/2/16
to Jenkins Developers
Hmm, I think this is a regression which breaks several plug-ins (junit, static analysis, etc…). A bug report already has been filed for the JUnit plug-in. I changed the component in Jira to ‚core‘ since the reason is located in SimpleBuildStep implementation:

Or is there a workaround available for plug-ins so that both freestyle projects *and* pipeline work as expected?
 

Fima

unread,
Nov 2, 2016, 1:01:11 PM11/2/16
to Jenkins Developers
Test analyzer seem to workaround this with transient factory
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/j38TfS6ymJ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E2AD56D7-2F8B-44BF-B41F-03DC456F6ADC%40gmail.com.

Jesse Glick

unread,
Nov 7, 2016, 3:33:30 PM11/7/16
to Jenkins Dev
On Wed, Nov 2, 2016 at 2:43 AM, Fima <fkp...@gmail.com> wrote:
> 1. Why look at the last successful and not the last builds?

Because in general if the build failed, the publisher may not have
run. If all build steps have run, but there is something wrong with
the source code, then the status should be `UNSTABLE`. Using
`getLastSuccessfulBuild` guarantees that only complete builds are
considered.

> I can make It can check for last completed check if results were or
> actions were recorded and use replace actions to add them instead of
> relaying on latest successful?

Did not understand that sentence.

Possibly the logic could be amended to check both
`getLastSuccessfulBuild` and `getLastCompletedBuild` in case both
exist but the latter is newer; collecting all the `LastBuildAction`s
from each; for each `LastBuildAction` class, picking the newest of the
two choices, if both exist; and then calling `getProjectActions` on
those. Would be easy enough to write the main code; needs test
coverage.
Reply all
Reply to author
Forward
0 new messages