Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

manually trigger a job rerun #9

Closed
lonnen opened this Issue · 10 comments

3 participants

@lonnen

External dependencies break, network traffic gets dropped, GH outages, etc can cause builds to fail. Some means to manually rerun certain jobs would be nice. My current workaround is to add a trivial commit to cause the rebuild, then rebase the commit off the branch before merging.

Maybe a command line tool to resend the build message to Jenkins? Could be run as a one-off command from leeroy: leeroy rebuild --project=FOO --pull-requst=32

@joeshaw
Owner

Sounds good, and is something I would like myself. I'll probably add an HTTP endpoint for it, and pull in Flask-Script so we can have a cli tool for it like you suggest.

@lonnen

Alternative idea: having it serve a single webpage enumerating repos and PRs with some 'click to rerun' UI would also work. Something like the Janky interface: janky Probably a bit more work than a cli tool, though.

@lonnen

I've successfully gotten a job to rerun by spoofing the JSON blob sent by github, no additional code in Leeroy necessary.

The following is enough information:

{
    "type": "SimulatedPullRequestEvent",
    "action": "synchronize",
    "pull_request": {
        "number": "921",
        "html_url": "https://github.com/mozilla/socorro/pulls/921",
        "base": {
            "repo": {
                "full_name": "mozilla/socorro"
            }
        },
        "head": {
            "repo": {
                "full_name": "rhelmer/socorro"
            },
            "sha": "76ee6507b7676e704440d45d2e7ca7af1fb71aab"
        }
    }
}

Rather than adding new code to rerun jobs, a dashboard (independent or served from leeroy) could enumerate open PR's and allow sending of spoofed events to rerun jobs.

@steveprentice steveprentice referenced this issue from a commit in steveprentice/leeroy
@steveprentice steveprentice Initiate build when PR is reopened.
When a PR has been reopened, kick off another build for the commit(s). This
also helps address issue #9 as you can close/reopen a PR to force a rebuild.
27fe283
@davedash

@lonnen does #25 help with this?

@lonnen

@davedash #25 addresses the minor case. More often we have jobs that failed for spurious environmental reasons (bad response from pypi mirror, jenkins out of disk, etc) that need a real rerun.

@davedash

@lonnen Have you tried the Jenkins Rebuild plugin?

IMO, that works better, it just rebuilds whatever build you are looking at with the exact same params.

@lonnen

I have not. Most of use reroy, which has some hardcoded constants specific to my leeroy instance but could easily be forked. That's been a good 80/20 for now.

@joeshaw
Owner

Yeah, we use the rebuild plugin and it's very helpful when a build fails for some transient reason.

@davedash

@joeshaw well I just discovered if the parameters were screwed up (my fault) then the retry command isn't that helpful unless you know what to change =) So I wrote this to clean up my mess.

@joeshaw joeshaw closed this in #30
@lonnen

I created a hubot plugin that will rerun jobs as well. It's not flexible as leeroy so you'll need to hack it a little if you use github enterprise. Gists don't have pull requests, but I'll happily update it if anyone wants to jump through that hoop and send me the new version.

https://gist.github.com/lonnen/11163857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.