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

Ignoring statuses from the try branch. #5

Closed
bheesham opened this issue Dec 15, 2014 · 0 comments
Closed

Ignoring statuses from the try branch. #5

bheesham opened this issue Dec 15, 2014 · 0 comments

Comments

@bheesham
Copy link
Contributor

@bheesham bheesham commented Dec 15, 2014

I'll submit a PR when I get more work done. This is more to keep @larsbergstrom updated, and for anyone to help out.

Right now I've found something that works to work as a filter for reporting statuses. (This all goes in master.cfg for Buildbot.)

def conditional_status(branch=None):
    def bn(branch=None):
        return branch if branch else "master"
    return bn(branch) != "try"

old_buildFinished = GitHubStatus.buildFinished
old_buildStarted = GitHubStatus.buildStarted

def new_buildFinished(self, builderName, build, results):
    source_stamp = build.getSourceStamps()[0]
    builder = build.getBuilder()

    if conditional_status(source_stamp.branch):
        old_buildFinished(self, builderName, build, results)

def new_buildStarted(self, builderName, build):
    source_stamp = build.getSourceStamps()[0]
    builder = build.getBuilder()

    if conditional_status(source_stamp.branch):
        old_buildStarted(self, builderName, build)

GitHubStatus.buildFinished = new_buildFinished
GitHubStatus.buildStarted = new_buildStarted

It's not pretty, but it works. I'm going to try to make this look a little prettier so that it can be used in the config file without making anyone feel gross.

Any improvement on this would be great.

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.