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-43400] Print the error to the build log rather than swallowing it #9

Merged
merged 1 commit into from Jun 6, 2017

Conversation

@jglick
Copy link
Member

commented Jun 5, 2017

Now when reproducing JENKINS-43400 according to instructions, you will see for example

…
Obtained Jenkinsfile from 59c3e61135c26f53e88d8420e6cf54840747e60d
Loading library tools@master
…
Checking out Revision 7436f27280bc1a007bbccf2e46cb98f62d31fb8b (master)
…
Loading library testResult@master
…
Checking out Revision f2ac4aad52aa18109585c2f7b6c999bc5e0a4721 (master)
…
First time build. Skipping changelog.
fatal: bad object 7436f27280bc1a007bbccf2e46cb98f62d31fb8b
…
[Pipeline] checkout
…
First time build. Skipping changelog.
fatal: bad object 7436f27280bc1a007bbccf2e46cb98f62d31fb8b
…
[longerTests]  > git checkout -f 59c3e61135c26f53e88d8420e6cf54840747e60d
[longerTests] fatal: bad object 7436f27280bc1a007bbccf2e46cb98f62d31fb8b
…

which makes the problem quite apparent: the plugin as written cannot work. It is assuming that the SCM passed to SCMListener.onCheckout can offer information on BuildData.getLastBuiltRevision(). In this case one of the BuildDatas would in fact be appropriate, but the plugin is always fetching the first one, even when processing checkouts from unrelated repositories.

I suspect you want to drop the workflow-job dependency (completely gratuitous), look for SCMRevisionAction on the build rather than BuildData (so we see what the actual Jenkinsfile revision was), then check for either a AbstractGitSCMSource.SCMRevisionImpl or PullRequestSCMRevision. Perhaps. I am assuming that is what you are interested in; it is not clear to me what your goal is in this plugin: the behavior seems rather vague.

@reviewbybees

@reviewbybees

This comment has been minimized.

Copy link

commented Jun 5, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@i386

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2017

Thanks @jglick - Ill take this PR and do some debugging.

@i386 i386 merged commit 398fc00 into jenkinsci:master Jun 6, 2017
@jglick jglick deleted the jglick:diag-JENKINS-43400 branch Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.